Skip to content

Commit 3b1aae0

Browse files
committed
Merge branch 'update/submodule_update_1.3-sve_9f6d627' into 'main'
updated submodule to 1.3-sve branch See merge request app-frameworks/esp-matter!641
2 parents c6ec214 + 4409873 commit 3b1aae0

28 files changed

+508
-602
lines changed

components/esp_matter/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ endif()
5555
target_compile_options(${COMPONENT_LIB} PUBLIC
5656
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>")
5757

58+
# TODO: remove this option after https://github.com/project-chip/connectedhomeip/pull/32287 merged
59+
if (${IDF_VERSION_MAJOR} LESS 5)
60+
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=conversion;-Wno-conversion" APPEND)
61+
endif()
62+
5863
# Time sync client feature depends on read client, disable it when read client is disabled.
5964
if (CONFIG_DISABLE_READ_CLIENT)
6065
target_compile_options(${COMPONENT_LIB} PUBLIC "-DTIME_SYNC_ENABLE_TSC_FEATURE=0")

components/esp_matter/esp_matter_attribute.cpp

+35-36
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint1
277277
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
278278
}
279279

280+
attribute_t *create_specification_version(cluster_t *cluster, uint32_t value)
281+
{
282+
return esp_matter::attribute::create(cluster, BasicInformation::Attributes::SpecificationVersion::Id, ATTRIBUTE_FLAG_NONE,
283+
esp_matter_uint32(value));
284+
}
285+
286+
attribute_t *create_max_paths_per_invoke(cluster_t *cluster, uint16_t value)
287+
{
288+
return esp_matter::attribute::create(cluster, BasicInformation::Attributes::MaxPathsPerInvoke::Id, ATTRIBUTE_FLAG_NONE,
289+
esp_matter_uint16(value));
290+
}
291+
280292
} /* attribute */
281293
} /* basic_information */
282294

@@ -447,6 +459,12 @@ attribute_t *create_reboot_count(cluster_t *cluster, uint16_t value)
447459
ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint16(value));
448460
}
449461

462+
attribute_t *create_up_time(cluster_t *cluster, uint64_t value)
463+
{
464+
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::UpTime::Id,
465+
ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint64(value));
466+
}
467+
450468
attribute_t *create_test_event_triggers_enabled(cluster_t *cluster, bool value)
451469
{
452470
return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::TestEventTriggersEnabled::Id,
@@ -1047,47 +1065,28 @@ attribute_t *create_group_name_support(cluster_t *cluster, uint8_t value)
10471065
} /* attribute */
10481066
} /* groups */
10491067

1050-
namespace scenes {
1068+
namespace scenes_management {
10511069
namespace attribute {
1052-
1053-
attribute_t *create_scene_count(cluster_t *cluster, uint8_t value)
1054-
{
1055-
return esp_matter::attribute::create(cluster, Scenes::Attributes::SceneCount::Id, ATTRIBUTE_FLAG_NONE,
1056-
esp_matter_uint8(value));
1057-
}
1058-
1059-
attribute_t *create_current_scene(cluster_t *cluster, uint8_t value)
1070+
attribute_t *create_last_configured_by(cluster_t *cluster, uint64_t value)
10601071
{
1061-
return esp_matter::attribute::create(cluster, Scenes::Attributes::CurrentScene::Id, ATTRIBUTE_FLAG_NONE,
1062-
esp_matter_uint8(value));
1072+
return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::LastConfiguredBy::Id, ATTRIBUTE_FLAG_NONE,
1073+
esp_matter_uint64(value));
10631074
}
10641075

1065-
attribute_t *create_current_group(cluster_t *cluster, uint16_t value)
1076+
attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value)
10661077
{
1067-
return esp_matter::attribute::create(cluster, Scenes::Attributes::CurrentGroup::Id, ATTRIBUTE_FLAG_NONE,
1078+
return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::SceneTableSize::Id, ATTRIBUTE_FLAG_NONE,
10681079
esp_matter_uint16(value));
10691080
}
10701081

1071-
attribute_t *create_scene_valid(cluster_t *cluster, bool value)
1072-
{
1073-
return esp_matter::attribute::create(cluster, Scenes::Attributes::SceneValid::Id, ATTRIBUTE_FLAG_NONE,
1074-
esp_matter_bool(value));
1075-
}
1076-
1077-
attribute_t *create_scene_name_support(cluster_t *cluster, uint8_t value)
1078-
{
1079-
return esp_matter::attribute::create(cluster, Scenes::Attributes::NameSupport::Id, ATTRIBUTE_FLAG_NONE,
1080-
esp_matter_bitmap8(value));
1081-
}
1082-
1083-
attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value)
1082+
attribute_t *create_fabric_scene_info(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count)
10841083
{
1085-
return esp_matter::attribute::create(cluster, Scenes::Attributes::SceneTableSize::Id, ATTRIBUTE_FLAG_NONE,
1086-
esp_matter_uint16(value));
1084+
return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::FabricSceneInfo::Id, ATTRIBUTE_FLAG_NONE,
1085+
esp_matter_array((uint8_t*)value, length, count));
10871086
}
10881087

10891088
} /* attribute */
1090-
} /* scenes */
1089+
} /* scenes_management */
10911090

10921091
namespace on_off {
10931092
namespace attribute {
@@ -1251,7 +1250,7 @@ attribute_t *create_current_saturation(cluster_t *cluster, uint8_t value, uint8_
12511250
attribute_t *attribute =
12521251
esp_matter::attribute::create(cluster, ColorControl::Attributes::CurrentSaturation::Id,
12531252
ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint8(value));
1254-
if (!attribute) {
1253+
if (!attribute) {
12551254
ESP_LOGE(TAG, "Could not create attribute");
12561255
return NULL;
12571256
}
@@ -1308,7 +1307,7 @@ attribute_t *create_color_temperature_mireds(cluster_t *cluster, uint16_t value,
13081307
attribute_t *attribute =
13091308
esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id,
13101309
ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint16(value));
1311-
if (!attribute) {
1310+
if (!attribute) {
13121311
ESP_LOGE(TAG, "Could not create attribute");
13131312
return NULL;
13141313
}
@@ -1321,7 +1320,7 @@ attribute_t *create_color_temp_physical_min_mireds(cluster_t *cluster, uint16_t
13211320
attribute_t *attribute =
13221321
esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorTempPhysicalMinMireds::Id,
13231322
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
1324-
if (!attribute) {
1323+
if (!attribute) {
13251324
ESP_LOGE(TAG, "Could not create attribute");
13261325
return NULL;
13271326
}
@@ -1334,7 +1333,7 @@ attribute_t *create_color_temp_physical_max_mireds(cluster_t *cluster, uint16_t
13341333
attribute_t *attribute =
13351334
esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id,
13361335
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
1337-
if (!attribute) {
1336+
if (!attribute) {
13381337
ESP_LOGE(TAG, "Could not create attribute");
13391338
return NULL;
13401339
}
@@ -1347,7 +1346,7 @@ attribute_t *create_couple_color_temp_to_level_min_mireds(cluster_t *cluster, ui
13471346
attribute_t *attribute =
13481347
esp_matter::attribute::create(cluster, ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id,
13491348
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
1350-
if (!attribute) {
1349+
if (!attribute) {
13511350
ESP_LOGE(TAG, "Could not create attribute");
13521351
return NULL;
13531352
}
@@ -1391,7 +1390,7 @@ attribute_t *create_current_y(cluster_t *cluster, uint16_t value, uint16_t min,
13911390
attribute_t *create_drift_compensation(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max)
13921391
{
13931392
attribute_t *attribute =
1394-
esp_matter::attribute::create(cluster, ColorControl::Attributes::DriftCompensation::Id,
1393+
esp_matter::attribute::create(cluster, ColorControl::Attributes::DriftCompensation::Id,
13951394
ATTRIBUTE_FLAG_NONE, esp_matter_enum8(value));
13961395
if (!attribute) {
13971396
ESP_LOGE(TAG, "Could not create attribute");
@@ -1484,7 +1483,7 @@ attribute_t *create_primary_n_x(cluster_t *cluster, uint16_t value, uint8_t inde
14841483
break;
14851484
}
14861485
return NULL;
1487-
1486+
14881487
}
14891488

14901489
attribute_t *create_primary_n_y(cluster_t *cluster, uint16_t value, uint8_t index)

components/esp_matter/esp_matter_attribute.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ attribute_t *create_access_control_entries_per_fabric(cluster_t *cluster, uint16
6363
} /* access_control */
6464

6565
namespace basic_information {
66-
constexpr uint8_t k_max_node_label_length = 32;
66+
constexpr uint8_t k_max_node_label_length = 32;
6767

6868
namespace attribute {
6969
attribute_t *create_data_model_revision(cluster_t *cluster, uint16_t value);
@@ -91,6 +91,8 @@ attribute_t *create_local_config_disabled(cluster_t *cluster, bool value);
9191
attribute_t *create_reachable(cluster_t *cluster, bool value);
9292
attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length);
9393
attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
94+
attribute_t *create_specification_version(cluster_t *cluster, uint32_t value);
95+
attribute_t *create_max_paths_per_invoke(cluster_t *cluster, uint16_t value);
9496
} /* attribute */
9597
} /* basic_information */
9698

@@ -139,6 +141,7 @@ namespace general_diagnostics {
139141
namespace attribute {
140142
attribute_t *create_network_interfaces(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
141143
attribute_t *create_reboot_count(cluster_t *cluster, uint16_t value);
144+
attribute_t *create_up_time(cluster_t *cluster, uint64_t value);
142145
attribute_t *create_test_event_triggers_enabled(cluster_t *cluster, bool value);
143146
} /* attribute */
144147
} /* general_diagnostics */
@@ -298,16 +301,13 @@ attribute_t *create_group_name_support(cluster_t *cluster, uint8_t value);
298301
} /* attribute */
299302
} /* groups */
300303

301-
namespace scenes {
304+
namespace scenes_management {
302305
namespace attribute {
303-
attribute_t *create_scene_count(cluster_t *cluster, uint8_t value);
304-
attribute_t *create_current_scene(cluster_t *cluster, uint8_t value);
305-
attribute_t *create_current_group(cluster_t *cluster, uint16_t value);
306-
attribute_t *create_scene_valid(cluster_t *cluster, bool value);
307-
attribute_t *create_scene_name_support(cluster_t *cluster, uint8_t value);
306+
attribute_t *create_last_configured_by(cluster_t *cluster, uint64_t value);
308307
attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value);
308+
attribute_t *create_fabric_scene_info(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count);
309309
} /* attribute */
310-
} /* scenes */
310+
} /* scenes_management */
311311

312312
namespace on_off {
313313
namespace attribute {
@@ -678,7 +678,7 @@ attribute_t *create_supported_rinses(cluster_t *cluster, uint8_t *value, uint16_
678678

679679
namespace dish_washer_mode {
680680
namespace attribute {
681-
attribute_t *create_supported_modes(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count);
681+
attribute_t *create_supported_modes(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count);
682682
attribute_t *create_current_mode(cluster_t *cluster, uint8_t value);
683683
} /* attribute */
684684
} /* dish_washer_mode */

components/esp_matter/esp_matter_attribute_utils.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -1906,10 +1906,10 @@ esp_err_t get_val_raw(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attrib
19061906
}
19071907

19081908
esp_err_t err = ESP_OK;
1909-
EmberAfStatus status = emberAfReadAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_size);
1910-
if (status != EMBER_ZCL_STATUS_SUCCESS) {
1909+
Status status = emberAfReadAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_size);
1910+
if (status != Status::Success) {
19111911
ESP_LOGE(TAG, "Error getting Endpoint 0x%04" PRIX16 "'s Cluster 0x%08" PRIX32 "'s Attribute 0x%08" PRIX32 "'s raw value from matter: 0x%x",
1912-
endpoint_id, cluster_id, attribute_id, status);
1912+
endpoint_id, cluster_id, attribute_id, static_cast<uint16_t>(status));
19131913
err = ESP_FAIL;
19141914
}
19151915
if (lock_status == lock::SUCCESS) {
@@ -1944,12 +1944,12 @@ esp_err_t update(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_i
19441944
get_data_from_attr_val(val, &attribute_type, &attribute_size, value);
19451945

19461946
/* Update matter */
1947-
EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS;
1947+
Status status = Status::Success;
19481948
if (emberAfContainsServer(endpoint_id, cluster_id)) {
19491949
status = emberAfWriteAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_type);
1950-
if (status != EMBER_ZCL_STATUS_SUCCESS) {
1950+
if (status != Status::Success) {
19511951
ESP_LOGE(TAG, "Error updating Endpoint 0x%04" PRIX16 "'s Cluster 0x%08" PRIX32 "'s Attribute 0x%08" PRIX32 " to matter: 0x%X", endpoint_id,
1952-
cluster_id, attribute_id, status);
1952+
cluster_id, attribute_id, static_cast<uint16_t>(status));
19531953
esp_matter_mem_free(value);
19541954
if (lock_status == lock::SUCCESS) {
19551955
lock::chip_stack_unlock();
@@ -2049,15 +2049,15 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &p
20492049
execute_callback(attribute::POST_UPDATE, endpoint_id, cluster_id, attribute_id, &val);
20502050
}
20512051

2052-
EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, ClusterId cluster_id,
2052+
Status emberAfExternalAttributeReadCallback(EndpointId endpoint_id, ClusterId cluster_id,
20532053
const EmberAfAttributeMetadata *matter_attribute, uint8_t *buffer,
20542054
uint16_t max_read_length)
20552055
{
20562056
/* Get value */
20572057
uint32_t attribute_id = matter_attribute->attributeId;
20582058
node_t *node = node::get();
20592059
if (!node) {
2060-
return EMBER_ZCL_STATUS_FAILURE;
2060+
return Status::Failure;
20612061
}
20622062
endpoint_t *endpoint = endpoint::get(node, endpoint_id);
20632063
cluster_t *cluster = cluster::get(endpoint, cluster_id);
@@ -2069,7 +2069,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, Clust
20692069
esp_err_t err = execute_override_callback(attribute, attribute::READ, endpoint_id, cluster_id, attribute_id,
20702070
&val);
20712071
if (err != ESP_OK) {
2072-
return EMBER_ZCL_STATUS_FAILURE;
2072+
return Status::Failure;
20732073
}
20742074
} else {
20752075
attribute::get_val(attribute, &val);
@@ -2084,22 +2084,22 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, Clust
20842084
if (attribute_size > max_read_length) {
20852085
ESP_LOGE(TAG, "Insufficient space for reading Endpoint 0x%04" PRIX16 "'s Cluster 0x%08" PRIX32 "'s Attribute 0x%08" PRIX32
20862086
": required: %" PRIu16 ", max: %" PRIu16 "", endpoint_id, cluster_id, attribute_id, attribute_size, max_read_length);
2087-
return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED;
2087+
return Status::ResourceExhausted;
20882088
}
20892089

20902090
/* Assign value */
20912091
attribute::get_data_from_attr_val(&val, NULL, &attribute_size, buffer);
2092-
return EMBER_ZCL_STATUS_SUCCESS;
2092+
return Status::Success;
20932093
}
20942094

2095-
EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, ClusterId cluster_id,
2095+
Status emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, ClusterId cluster_id,
20962096
const EmberAfAttributeMetadata *matter_attribute, uint8_t *buffer)
20972097
{
20982098
/* Get value */
20992099
uint32_t attribute_id = matter_attribute->attributeId;
21002100
node_t *node = node::get();
21012101
if (!node) {
2102-
return EMBER_ZCL_STATUS_FAILURE;
2102+
return Status::Failure;
21032103
}
21042104
endpoint_t *endpoint = endpoint::get(node, endpoint_id);
21052105
cluster_t *cluster = cluster::get(endpoint, cluster_id);
@@ -2115,14 +2115,14 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, Clus
21152115
if (flags & ATTRIBUTE_FLAG_OVERRIDE) {
21162116
esp_err_t err = execute_override_callback(attribute, attribute::WRITE, endpoint_id, cluster_id, attribute_id,
21172117
&val);
2118-
EmberAfStatus status = (err == ESP_OK) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE;
2118+
Status status = (err == ESP_OK) ? Status::Success : Status::Failure;
21192119
return status;
21202120
}
21212121

21222122
/* Update val */
21232123
if (val.type == ESP_MATTER_VAL_TYPE_INVALID) {
2124-
return EMBER_ZCL_STATUS_FAILURE;
2124+
return Status::Failure;
21252125
}
21262126
attribute::set_val(attribute, &val);
2127-
return EMBER_ZCL_STATUS_SUCCESS;
2127+
return Status::Success;
21282128
}

0 commit comments

Comments
 (0)