Skip to content

Commit 52b4b92

Browse files
committed
Merge branch 'compliance' into 'main'
components/esp_matter: Update revisions, new device types of v1.4.2 See merge request app-frameworks/esp-matter!1235
2 parents 519a3d0 + ec8c3b9 commit 52b4b92

File tree

7 files changed

+65
-7
lines changed

7 files changed

+65
-7
lines changed

components/esp_matter/data_model/esp_matter_attribute.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ attribute_t *create_tag_list(cluster_t *cluster, uint8_t *value, uint16_t length
7676
esp_matter_array(value, length, count));
7777
}
7878

79+
#if CHIP_CONFIG_USE_ENDPOINT_UNIQUE_ID
80+
attribute_t *create_endpoint_unique_id(cluster_t *cluster, uint8_t *value, uint16_t length)
81+
{
82+
return esp_matter::attribute::create(cluster, Descriptor::Attributes::EndpointUniqueID::Id, ATTRIBUTE_FLAG_MANAGED_INTERNALLY,
83+
esp_matter_char_str(value, length));
84+
}
85+
#endif
7986
} /* attribute */
8087
} /* descriptor */
8188

components/esp_matter/data_model/esp_matter_attribute.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ attribute_t *create_server_list(cluster_t *cluster, uint8_t *value, uint16_t len
3939
attribute_t *create_client_list(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
4040
attribute_t *create_parts_list(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
4141
attribute_t *create_tag_list(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
42+
attribute_t *create_endpoint_unique_id(cluster_t *cluster, uint8_t *value, uint16_t length);
4243
} /* attribute */
4344
} /* descriptor */
4445

components/esp_matter/data_model/esp_matter_endpoint.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,6 +2006,37 @@ esp_err_t add(endpoint_t *endpoint, config_t *config)
20062006
}
20072007
} /* heat_pump */
20082008

2009+
namespace thermostat_controller {
2010+
uint32_t get_device_type_id()
2011+
{
2012+
return ESP_MATTER_THERMOSTAT_CONTROLLER_DEVICE_TYPE_ID;
2013+
}
2014+
2015+
uint8_t get_device_type_version()
2016+
{
2017+
return ESP_MATTER_THERMOSTAT_CONTROLLER_DEVICE_TYPE_VERSION;
2018+
}
2019+
2020+
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data)
2021+
{
2022+
endpoint_t * endpoint = common::create<config_t>(node, config, flags, priv_data, add);
2023+
VerifyOrReturnError(endpoint != nullptr, NULL);
2024+
2025+
cluster_t *binding_cluster = binding::create(endpoint, &(config->binding), CLUSTER_FLAG_SERVER);
2026+
VerifyOrReturnValue(binding_cluster != nullptr, NULL, ESP_LOGE(TAG, "Failed to create binding cluster"));
2027+
2028+
return endpoint;
2029+
}
2030+
2031+
esp_err_t add(endpoint_t *endpoint, config_t *config)
2032+
{
2033+
esp_err_t err = add_device_type(endpoint, get_device_type_id(), get_device_type_version());
2034+
VerifyOrReturnError(err == ESP_OK, err);
2035+
cluster::thermostat::create(endpoint, NULL, CLUSTER_FLAG_CLIENT);
2036+
2037+
return ESP_OK;
2038+
}
2039+
} /* thermostat_controller */
20092040
} /* endpoint */
20102041

20112042
namespace node {

components/esp_matter/data_model/esp_matter_endpoint.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
#define ESP_MATTER_MODE_SELECT_DEVICE_TYPE_ID 0x0027
113113
#define ESP_MATTER_MODE_SELECT_DEVICE_TYPE_VERSION 1
114114
#define ESP_MATTER_ROBOTIC_VACUUM_CLEANER_DEVICE_TYPE_ID 0x0074
115-
#define ESP_MATTER_ROBOTIC_VACUUM_CLEANER_DEVICE_TYPE_VERSION 3
115+
#define ESP_MATTER_ROBOTIC_VACUUM_CLEANER_DEVICE_TYPE_VERSION 4
116116
#define ESP_MATTER_WATER_LEAK_DETECTOR_DEVICE_TYPE_ID 0x0043
117117
#define ESP_MATTER_WATER_LEAK_DETECTOR_DEVICE_TYPE_VERSION 1
118118
#define ESP_MATTER_RAIN_SENSOR_DEVICE_TYPE_ID 0x0044
@@ -148,6 +148,8 @@
148148
#define ESP_MATTER_THREAD_BORDER_ROUTER_DEVICE_TYPE_VERSION 2
149149
#define ESP_MATTER_HEAT_PUMP_DEVICE_TYPE_ID 0x0309
150150
#define ESP_MATTER_HEAT_PUMP_DEVICE_TYPE_VERSION 1
151+
#define ESP_MATTER_THERMOSTAT_CONTROLLER_DEVICE_TYPE_ID 0x030A
152+
#define ESP_MATTER_THERMOSTAT_CONTROLLER_DEVICE_TYPE_VERSION 1
151153

152154
namespace esp_matter {
153155

@@ -1020,6 +1022,16 @@ endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_dat
10201022
esp_err_t add(endpoint_t *endpoint, config_t *config);
10211023
} /** heat_pump **/
10221024

1025+
namespace thermostat_controller {
1026+
using config_t = app_client_config;
1027+
1028+
uint32_t get_device_type_id();
1029+
uint8_t get_device_type_version();
1030+
endpoint_t *create(node_t *node, config_t *config, uint8_t flags, void *priv_data);
1031+
esp_err_t add(endpoint_t *endpoint, config_t *config);
1032+
} /** thermostat_controller **/
1033+
1034+
10231035
} /* endpoint */
10241036

10251037
namespace node {

components/esp_matter/private/esp_matter_cluster_revisions.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ constexpr uint16_t cluster_revision = 7;
144144
} // namespace color_control
145145

146146
namespace fan_control {
147-
constexpr uint16_t cluster_revision = 4;
147+
constexpr uint16_t cluster_revision = 5;
148148
} // namespace fan_control
149149

150150
namespace thermostat {
@@ -236,7 +236,7 @@ constexpr uint16_t cluster_revision = 1;
236236
} // namespace smoke_co_alarm
237237

238238
namespace door_lock {
239-
constexpr uint16_t cluster_revision = 8;
239+
constexpr uint16_t cluster_revision = 9;
240240
} // namespace door_lock
241241

242242
namespace window_covering {
@@ -312,7 +312,7 @@ constexpr uint16_t cluster_revision = 3;
312312
} // namespace rvc_run_mode
313313

314314
namespace rvc_clean_mode {
315-
constexpr uint16_t cluster_revision = 3;
315+
constexpr uint16_t cluster_revision = 4;
316316
} // namespace rvc_clean_mode
317317

318318
namespace water_heater_mode {
@@ -328,7 +328,7 @@ constexpr uint16_t cluster_revision = 1;
328328
} // namespace microwave_oven_control
329329

330330
namespace rvc_operational_state {
331-
constexpr uint16_t cluster_revision = 2;
331+
constexpr uint16_t cluster_revision = 3;
332332
} // namespace rvc_operational_state
333333

334334
namespace keypad_input {
@@ -340,7 +340,7 @@ constexpr uint16_t cluster_revision = 1;
340340
} // namespace power_topology
341341

342342
namespace electrical_power_measurement {
343-
constexpr uint16_t cluster_revision = 1;
343+
constexpr uint16_t cluster_revision = 3;
344344
} // namespace electrical_power_measurement
345345

346346
namespace electrical_energy_measurement {
@@ -384,7 +384,7 @@ constexpr uint16_t cluster_revision = 1;
384384
} // namespace thread_network_directory
385385

386386
namespace service_area {
387-
constexpr uint16_t cluster_revision = 1;
387+
constexpr uint16_t cluster_revision = 2;
388388
} // namespace service_area
389389

390390
namespace water_heater_management {

examples/all_device_types_app/main/device_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ enum device_type_enum {
5959
ESP_MATTER_SOLAR_POWER,
6060
ESP_MATTER_BATTERY_STORAGE,
6161
ESP_MATTER_HEAT_PUMP,
62+
ESP_MATTER_THERMOSTAT_CONTROLLER,
6263
ESP_MATTER_DEVICE_TYPE_MAX
6364
};
6465

@@ -124,5 +125,6 @@ const device_type_name device_type_list[ESP_MATTER_DEVICE_TYPE_MAX] = {
124125
{"solar_power", ESP_MATTER_SOLAR_POWER},
125126
{"battery_storage", ESP_MATTER_BATTERY_STORAGE},
126127
{"heat_pump", ESP_MATTER_HEAT_PUMP},
128+
{"thermostat_controller", ESP_MATTER_THERMOSTAT_CONTROLLER},
127129
};
128130
} /* namespace esp_matter */

examples/all_device_types_app/main/esp_matter_console_helpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,11 @@ int create(uint8_t device_type_index)
587587
endpoint = esp_matter::endpoint::heat_pump::create(node, &heat_pump_config, ENDPOINT_FLAG_NONE, NULL);
588588
break;
589589
}
590+
case ESP_MATTER_THERMOSTAT_CONTROLLER: {
591+
esp_matter::endpoint::thermostat_controller::config_t thermostat_controller_config;
592+
endpoint = esp_matter::endpoint::thermostat_controller::create(node, &thermostat_controller_config, ENDPOINT_FLAG_NONE, NULL);
593+
break;
594+
}
590595
default: {
591596
ESP_LOGE(TAG, "Please input a valid device type");
592597
break;

0 commit comments

Comments
 (0)