From e439f600c77f0d2ee9c21ccd74451cee40eed1ce Mon Sep 17 00:00:00 2001 From: Sayon Deep Date: Wed, 21 Feb 2024 14:31:48 +0530 Subject: [PATCH 1/8] updated submodule to 1.3-sve branch --- connectedhomeip/connectedhomeip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectedhomeip/connectedhomeip b/connectedhomeip/connectedhomeip index d38a6496c..9f6d627e0 160000 --- a/connectedhomeip/connectedhomeip +++ b/connectedhomeip/connectedhomeip @@ -1 +1 @@ -Subproject commit d38a6496c3abeb3daf6429b1f11172cfa0112a1a +Subproject commit 9f6d627e0262e1d023986291948bb4e845be803e From 77d0c849d11b8aa8798fa1ab06612d5ac7f3edbc Mon Sep 17 00:00:00 2001 From: liyashuai Date: Mon, 29 Jan 2024 15:28:56 +0800 Subject: [PATCH 2/8] fix build error for submodule update to 1.3-sve --- .../esp_matter/esp_matter_attribute.cpp | 75 ++++--- components/esp_matter/esp_matter_attribute.h | 18 +- .../esp_matter/esp_matter_attribute_utils.cpp | 32 +-- components/esp_matter/esp_matter_client.cpp | 25 +-- components/esp_matter/esp_matter_client.h | 18 +- components/esp_matter/esp_matter_cluster.cpp | 127 ++++++------ components/esp_matter/esp_matter_cluster.h | 28 ++- components/esp_matter/esp_matter_command.cpp | 79 ++++---- components/esp_matter/esp_matter_command.h | 10 +- components/esp_matter/esp_matter_core.cpp | 6 +- components/esp_matter/esp_matter_endpoint.cpp | 30 +-- components/esp_matter/esp_matter_endpoint.h | 16 +- components/esp_matter/esp_matter_feature.cpp | 154 ++++++--------- components/esp_matter/esp_matter_feature.h | 44 +++-- .../app/PluginApplicationCallbacks.h | 2 +- .../zap_common/app/callback-stub.cpp | 6 +- .../zap_common/zap-generated/gen_config.h | 85 ++++---- .../esp_matter_controller_cluster_command.cpp | 32 +-- .../logger/zap-generated/DataModelLogger.cpp | 184 ++++-------------- .../logger/zap-generated/DataModelLogger.h | 24 +-- examples/zap_light/CMakeLists.txt | 49 ++--- 21 files changed, 460 insertions(+), 584 deletions(-) diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp index 2a335182f..cd3ca5f03 100644 --- a/components/esp_matter/esp_matter_attribute.cpp +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -277,6 +277,18 @@ attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint1 ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count)); } +attribute_t *create_specification_version(cluster_t *cluster, uint32_t value) +{ + return esp_matter::attribute::create(cluster, BasicInformation::Attributes::SpecificationVersion::Id, ATTRIBUTE_FLAG_NONE, + esp_matter_uint32(value)); +} + +attribute_t *create_max_path_per_invoke_version(cluster_t *cluster, uint16_t value) +{ + return esp_matter::attribute::create(cluster, BasicInformation::Attributes::MaxPathsPerInvoke::Id, ATTRIBUTE_FLAG_NONE, + esp_matter_uint16(value)); +} + } /* attribute */ } /* basic_information */ @@ -447,6 +459,12 @@ attribute_t *create_reboot_count(cluster_t *cluster, uint16_t value) ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint16(value)); } +attribute_t *create_up_time(cluster_t *cluster, uint64_t value) +{ + return esp_matter::attribute::create(cluster, GeneralDiagnostics::Attributes::UpTime::Id, + ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint64(value)); +} + attribute_t *create_test_event_triggers_enabled(cluster_t *cluster, bool value) { 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) } /* attribute */ } /* groups */ -namespace scenes { +namespace scenes_management { namespace attribute { - -attribute_t *create_scene_count(cluster_t *cluster, uint8_t value) +attribute_t *create_last_configure_by(cluster_t *cluster, uint64_t value) { - return esp_matter::attribute::create(cluster, Scenes::Attributes::SceneCount::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_uint8(value)); -} - -attribute_t *create_current_scene(cluster_t *cluster, uint8_t value) -{ - return esp_matter::attribute::create(cluster, Scenes::Attributes::CurrentScene::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_uint8(value)); -} - -attribute_t *create_current_group(cluster_t *cluster, uint16_t value) -{ - return esp_matter::attribute::create(cluster, Scenes::Attributes::CurrentGroup::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_uint16(value)); -} - -attribute_t *create_scene_valid(cluster_t *cluster, bool value) -{ - return esp_matter::attribute::create(cluster, Scenes::Attributes::SceneValid::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_bool(value)); -} - -attribute_t *create_scene_name_support(cluster_t *cluster, uint8_t value) -{ - return esp_matter::attribute::create(cluster, Scenes::Attributes::NameSupport::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_bitmap8(value)); + return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::LastConfiguredBy::Id, ATTRIBUTE_FLAG_NONE, + esp_matter_uint64(value)); } attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value) { - return esp_matter::attribute::create(cluster, Scenes::Attributes::SceneTableSize::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::SceneTableSize::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); } +attribute_t *create_fabric_scene_info(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count) +{ + return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::FabricSceneInfo::Id, ATTRIBUTE_FLAG_NONE, + esp_matter_array((uint8_t*)value, length, count)); +} + } /* attribute */ -} /* scenes */ +} /* scenes_management */ namespace on_off { namespace attribute { @@ -1251,7 +1250,7 @@ attribute_t *create_current_saturation(cluster_t *cluster, uint8_t value, uint8_ attribute_t *attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::CurrentSaturation::Id, ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint8(value)); - if (!attribute) { + if (!attribute) { ESP_LOGE(TAG, "Could not create attribute"); return NULL; } @@ -1308,7 +1307,7 @@ attribute_t *create_color_temperature_mireds(cluster_t *cluster, uint16_t value, attribute_t *attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id, ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_uint16(value)); - if (!attribute) { + if (!attribute) { ESP_LOGE(TAG, "Could not create attribute"); return NULL; } @@ -1321,7 +1320,7 @@ attribute_t *create_color_temp_physical_min_mireds(cluster_t *cluster, uint16_t attribute_t *attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorTempPhysicalMinMireds::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); - if (!attribute) { + if (!attribute) { ESP_LOGE(TAG, "Could not create attribute"); return NULL; } @@ -1334,7 +1333,7 @@ attribute_t *create_color_temp_physical_max_mireds(cluster_t *cluster, uint16_t attribute_t *attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorTempPhysicalMaxMireds::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); - if (!attribute) { + if (!attribute) { ESP_LOGE(TAG, "Could not create attribute"); return NULL; } @@ -1347,7 +1346,7 @@ attribute_t *create_couple_color_temp_to_level_min_mireds(cluster_t *cluster, ui attribute_t *attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::CoupleColorTempToLevelMinMireds::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); - if (!attribute) { + if (!attribute) { ESP_LOGE(TAG, "Could not create attribute"); return NULL; } @@ -1391,7 +1390,7 @@ attribute_t *create_current_y(cluster_t *cluster, uint16_t value, uint16_t min, attribute_t *create_drift_compensation(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max) { attribute_t *attribute = - esp_matter::attribute::create(cluster, ColorControl::Attributes::DriftCompensation::Id, + esp_matter::attribute::create(cluster, ColorControl::Attributes::DriftCompensation::Id, ATTRIBUTE_FLAG_NONE, esp_matter_enum8(value)); if (!attribute) { 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 break; } return NULL; - + } attribute_t *create_primary_n_y(cluster_t *cluster, uint16_t value, uint8_t index) diff --git a/components/esp_matter/esp_matter_attribute.h b/components/esp_matter/esp_matter_attribute.h index f65eb3e45..4eb311642 100644 --- a/components/esp_matter/esp_matter_attribute.h +++ b/components/esp_matter/esp_matter_attribute.h @@ -63,7 +63,7 @@ attribute_t *create_access_control_entries_per_fabric(cluster_t *cluster, uint16 } /* access_control */ namespace basic_information { -constexpr uint8_t k_max_node_label_length = 32; +constexpr uint8_t k_max_node_label_length = 32; namespace attribute { 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); attribute_t *create_reachable(cluster_t *cluster, bool value); attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length); attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count); +attribute_t *create_specification_version(cluster_t *cluster, uint32_t value); +attribute_t *create_max_path_per_invoke_version(cluster_t *cluster, uint16_t value); } /* attribute */ } /* basic_information */ @@ -139,6 +141,7 @@ namespace general_diagnostics { namespace attribute { attribute_t *create_network_interfaces(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count); attribute_t *create_reboot_count(cluster_t *cluster, uint16_t value); +attribute_t *create_up_time(cluster_t *cluster, uint64_t value); attribute_t *create_test_event_triggers_enabled(cluster_t *cluster, bool value); } /* attribute */ } /* general_diagnostics */ @@ -298,16 +301,13 @@ attribute_t *create_group_name_support(cluster_t *cluster, uint8_t value); } /* attribute */ } /* groups */ -namespace scenes { +namespace scenes_management { namespace attribute { -attribute_t *create_scene_count(cluster_t *cluster, uint8_t value); -attribute_t *create_current_scene(cluster_t *cluster, uint8_t value); -attribute_t *create_current_group(cluster_t *cluster, uint16_t value); -attribute_t *create_scene_valid(cluster_t *cluster, bool value); -attribute_t *create_scene_name_support(cluster_t *cluster, uint8_t value); +attribute_t *create_last_configure_by(cluster_t *cluster, uint64_t value); attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value); +attribute_t *create_fabric_scene_info(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count); } /* attribute */ -} /* scenes */ +} /* scenes_management */ namespace on_off { namespace attribute { @@ -678,7 +678,7 @@ attribute_t *create_supported_rinses(cluster_t *cluster, uint8_t *value, uint16_ namespace dish_washer_mode { namespace attribute { -attribute_t *create_supported_modes(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count); +attribute_t *create_supported_modes(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count); attribute_t *create_current_mode(cluster_t *cluster, uint8_t value); } /* attribute */ } /* dish_washer_mode */ diff --git a/components/esp_matter/esp_matter_attribute_utils.cpp b/components/esp_matter/esp_matter_attribute_utils.cpp index 82953cb76..949443ab5 100644 --- a/components/esp_matter/esp_matter_attribute_utils.cpp +++ b/components/esp_matter/esp_matter_attribute_utils.cpp @@ -1906,10 +1906,10 @@ esp_err_t get_val_raw(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attrib } esp_err_t err = ESP_OK; - EmberAfStatus status = emberAfReadAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_size); - if (status != EMBER_ZCL_STATUS_SUCCESS) { + Status status = emberAfReadAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_size); + if (status != Status::Success) { 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", - endpoint_id, cluster_id, attribute_id, status); + endpoint_id, cluster_id, attribute_id, static_cast(status)); err = ESP_FAIL; } 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 get_data_from_attr_val(val, &attribute_type, &attribute_size, value); /* Update matter */ - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + Status status = Status::Success; if (emberAfContainsServer(endpoint_id, cluster_id)) { status = emberAfWriteAttribute(endpoint_id, cluster_id, attribute_id, value, attribute_type); - if (status != EMBER_ZCL_STATUS_SUCCESS) { + if (status != Status::Success) { 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, - cluster_id, attribute_id, status); + cluster_id, attribute_id, static_cast(status)); esp_matter_mem_free(value); if (lock_status == lock::SUCCESS) { lock::chip_stack_unlock(); @@ -2049,7 +2049,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &p execute_callback(attribute::POST_UPDATE, endpoint_id, cluster_id, attribute_id, &val); } -EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, ClusterId cluster_id, +Status emberAfExternalAttributeReadCallback(EndpointId endpoint_id, ClusterId cluster_id, const EmberAfAttributeMetadata *matter_attribute, uint8_t *buffer, uint16_t max_read_length) { @@ -2057,7 +2057,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, Clust uint32_t attribute_id = matter_attribute->attributeId; node_t *node = node::get(); if (!node) { - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } endpoint_t *endpoint = endpoint::get(node, endpoint_id); cluster_t *cluster = cluster::get(endpoint, cluster_id); @@ -2069,7 +2069,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, Clust esp_err_t err = execute_override_callback(attribute, attribute::READ, endpoint_id, cluster_id, attribute_id, &val); if (err != ESP_OK) { - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } } else { attribute::get_val(attribute, &val); @@ -2084,22 +2084,22 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint_id, Clust if (attribute_size > max_read_length) { ESP_LOGE(TAG, "Insufficient space for reading Endpoint 0x%04" PRIX16 "'s Cluster 0x%08" PRIX32 "'s Attribute 0x%08" PRIX32 ": required: %" PRIu16 ", max: %" PRIu16 "", endpoint_id, cluster_id, attribute_id, attribute_size, max_read_length); - return EMBER_ZCL_STATUS_RESOURCE_EXHAUSTED; + return Status::ResourceExhausted; } /* Assign value */ attribute::get_data_from_attr_val(&val, NULL, &attribute_size, buffer); - return EMBER_ZCL_STATUS_SUCCESS; + return Status::Success; } -EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, ClusterId cluster_id, +Status emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, ClusterId cluster_id, const EmberAfAttributeMetadata *matter_attribute, uint8_t *buffer) { /* Get value */ uint32_t attribute_id = matter_attribute->attributeId; node_t *node = node::get(); if (!node) { - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } endpoint_t *endpoint = endpoint::get(node, endpoint_id); cluster_t *cluster = cluster::get(endpoint, cluster_id); @@ -2115,14 +2115,14 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint_id, Clus if (flags & ATTRIBUTE_FLAG_OVERRIDE) { esp_err_t err = execute_override_callback(attribute, attribute::WRITE, endpoint_id, cluster_id, attribute_id, &val); - EmberAfStatus status = (err == ESP_OK) ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE; + Status status = (err == ESP_OK) ? Status::Success : Status::Failure; return status; } /* Update val */ if (val.type == ESP_MATTER_VAL_TYPE_INVALID) { - return EMBER_ZCL_STATUS_FAILURE; + return Status::Failure; } attribute::set_val(attribute, &val); - return EMBER_ZCL_STATUS_SUCCESS; + return Status::Success; } diff --git a/components/esp_matter/esp_matter_client.cpp b/components/esp_matter/esp_matter_client.cpp index 955eec22d..11b4a21ea 100644 --- a/components/esp_matter/esp_matter_client.cpp +++ b/components/esp_matter/esp_matter_client.cpp @@ -18,9 +18,12 @@ #include #include + +#if CONFIG_ESP_MATTER_ENABLE_DATA_MODEL #include #include "app/CASESessionManager.h" #include "app/InteractionModelEngine.h" +#endif // CONFIG_ESP_MATTER_ENABLE_DATA_MODEL using namespace chip::app::Clusters; using chip::BitMask; @@ -122,12 +125,12 @@ static void esp_matter_command_client_binding_callback(const EmberBindingTableEn ESP_LOGE(TAG, "Failed to call the binding callback since command handle is NULL"); return; } - if (binding.type == EMBER_UNICAST_BINDING && peer_device) { + if (binding.type == MATTER_UNICAST_BINDING && peer_device) { if (client_command_callback) { cmd_handle->endpoint_id = binding.remote; client_command_callback(peer_device, cmd_handle, command_callback_priv_data); } - } else if (binding.type == EMBER_MULTICAST_BINDING && !peer_device) { + } else if (binding.type == MATTER_MULTICAST_BINDING && !peer_device) { if (client_group_command_callback) { cmd_handle->group_id = binding.groupId; client_group_command_callback(binding.fabricIndex, cmd_handle, command_callback_priv_data); @@ -1165,14 +1168,14 @@ esp_err_t send_remove_group(peer_device_t *remote_device, uint16_t remote_endpoi } // namespace command } // namespace groups -namespace scenes { +namespace scenes_management { namespace command { esp_err_t send_add_scene(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, uint8_t scene_id, uint16_t transition_time, char *scene_name, extension_field_sets &efs, add_scene_callback add_scene_cb) { - Scenes::Commands::AddScene::Type command_data; + ScenesManagement::Commands::AddScene::Type command_data; command_data.groupID = group_id; command_data.sceneID = scene_id; command_data.transitionTime = transition_time; @@ -1188,7 +1191,7 @@ esp_err_t send_add_scene(peer_device_t *remote_device, uint16_t remote_endpoint_ esp_err_t send_view_scene(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, uint8_t scene_id, view_scene_callback view_scene_cb) { - Scenes::Commands::ViewScene::Type command_data; + ScenesManagement::Commands::ViewScene::Type command_data; command_data.groupID = group_id; command_data.sceneID = scene_id; @@ -1201,7 +1204,7 @@ esp_err_t send_view_scene(peer_device_t *remote_device, uint16_t remote_endpoint esp_err_t send_remove_scene(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, uint8_t scene_id, remove_scene_callback remove_scene_cb) { - Scenes::Commands::RemoveScene::Type command_data; + ScenesManagement::Commands::RemoveScene::Type command_data; command_data.groupID = group_id; command_data.sceneID = scene_id; @@ -1214,7 +1217,7 @@ esp_err_t send_remove_scene(peer_device_t *remote_device, uint16_t remote_endpoi esp_err_t send_remove_all_scenes(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, remove_all_scenes_callback remove_all_scenes_cb) { - Scenes::Commands::RemoveAllScenes::Type command_data; + ScenesManagement::Commands::RemoveAllScenes::Type command_data; command_data.groupID = group_id; chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), @@ -1226,7 +1229,7 @@ esp_err_t send_remove_all_scenes(peer_device_t *remote_device, uint16_t remote_e esp_err_t send_store_scene(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, uint8_t scene_id, store_scene_callback store_scene_cb) { - Scenes::Commands::StoreScene::Type command_data; + ScenesManagement::Commands::StoreScene::Type command_data; command_data.groupID = group_id; command_data.sceneID = scene_id; @@ -1239,7 +1242,7 @@ esp_err_t send_store_scene(peer_device_t *remote_device, uint16_t remote_endpoin esp_err_t send_recall_scene(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, uint8_t scene_id) { - Scenes::Commands::RecallScene::Type command_data; + ScenesManagement::Commands::RecallScene::Type command_data; command_data.groupID = group_id; command_data.sceneID = scene_id; @@ -1252,7 +1255,7 @@ esp_err_t send_recall_scene(peer_device_t *remote_device, uint16_t remote_endpoi esp_err_t send_get_scene_membership(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, get_scene_membership_callback get_scene_membership_cb) { - Scenes::Commands::GetSceneMembership::Type command_data; + ScenesManagement::Commands::GetSceneMembership::Type command_data; command_data.groupID = group_id; chip::Controller::ScenesCluster cluster(*remote_device->GetExchangeManager(), @@ -1262,7 +1265,7 @@ esp_err_t send_get_scene_membership(peer_device_t *remote_device, uint16_t remot } } // namespace command -} // namespace scenes +} // namespace scenes_management namespace thermostat { namespace command { diff --git a/components/esp_matter/esp_matter_client.h b/components/esp_matter/esp_matter_client.h index 2c49169df..82f4d4765 100644 --- a/components/esp_matter/esp_matter_client.h +++ b/components/esp_matter/esp_matter_client.h @@ -282,22 +282,22 @@ esp_err_t send_remove_group(peer_device_t *remote_device, uint16_t remote_endpoi } // namespace command } // namespace groups -namespace scenes { +namespace scenes_management { namespace command { -using extension_field_sets = chip::app::DataModel::List; +using extension_field_sets = chip::app::DataModel::List; using add_scene_callback = void (*)(void *, - const chip::app::Clusters::Scenes::Commands::AddScene::Type::ResponseType &); + const chip::app::Clusters::ScenesManagement::Commands::AddScene::Type::ResponseType &); using view_scene_callback = void (*)(void *, - const chip::app::Clusters::Scenes::Commands::ViewScene::Type::ResponseType &); + const chip::app::Clusters::ScenesManagement::Commands::ViewScene::Type::ResponseType &); using remove_scene_callback = void (*)(void *, - const chip::app::Clusters::Scenes::Commands::RemoveScene::Type::ResponseType &); + const chip::app::Clusters::ScenesManagement::Commands::RemoveScene::Type::ResponseType &); using remove_all_scenes_callback = - void (*)(void *, const chip::app::Clusters::Scenes::Commands::RemoveAllScenes::Type::ResponseType &); + void (*)(void *, const chip::app::Clusters::ScenesManagement::Commands::RemoveAllScenes::Type::ResponseType &); using store_scene_callback = void (*)(void *, - const chip::app::Clusters::Scenes::Commands::StoreScene::Type::ResponseType &); + const chip::app::Clusters::ScenesManagement::Commands::StoreScene::Type::ResponseType &); using get_scene_membership_callback = - void (*)(void *, const chip::app::Clusters::Scenes::Commands::GetSceneMembership::Type::ResponseType &); + void (*)(void *, const chip::app::Clusters::ScenesManagement::Commands::GetSceneMembership::Type::ResponseType &); esp_err_t send_add_scene(peer_device_t *remote_device, uint16_t remote_endpoint_id, uint16_t group_id, uint8_t scene_id, uint16_t transition_time, char *scene_name, extension_field_sets &efs, @@ -322,7 +322,7 @@ esp_err_t send_get_scene_membership(peer_device_t *remote_device, uint16_t remot get_scene_membership_callback get_scene_membership_cb); } // namespace command -} // namespace scenes +} // namespace scenes_management namespace thermostat { namespace command { diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index d40c710e2..6cb9323fa 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -188,7 +188,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) #if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE global::attribute::create_event_list(cluster, NULL, 0, 0); #endif - + /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); @@ -240,6 +240,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) attribute::create_software_version(cluster, 0); attribute::create_software_version_string(cluster, NULL, 0); attribute::create_capability_minima(cluster, NULL, 0, 0); + attribute::create_specification_version(cluster, 0); + //attribute::create_max_path_per_invoke_version(cluster, 0); /* Attributes not managed internally */ if (config) { @@ -524,6 +526,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes managed internally */ attribute::create_network_interfaces(cluster, NULL, 0, 0); attribute::create_reboot_count(cluster, 0); + attribute::create_up_time(cluster, 0); attribute::create_test_event_triggers_enabled(cluster, 0); global::attribute::create_feature_map(cluster, 0); #if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE @@ -541,6 +544,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) event::create_boot_reason(cluster); command::create_test_event_trigger(cluster); + command::create_time_snap_shot(cluster); + command::create_time_snap_shot_response(cluster); return cluster; } @@ -550,7 +555,7 @@ namespace administrator_commissioning { const function_generic_t *function_list = NULL; const int function_flags = CLUSTER_FLAG_NONE; -cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) +cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features) { cluster_t *cluster = cluster::create(endpoint, AdministratorCommissioning::Id, flags); if (!cluster) { @@ -582,9 +587,14 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) } } + /* Features */ + if (features & feature::basic::get_id()) { + feature::basic::add(cluster); + } + /* Commands */ command::create_open_commissioning_window(cluster); - command::create_open_basic_commissioning_window(cluster); + //command::create_open_basic_commissioning_window(cluster); command::create_revoke_commissioning(cluster); return cluster; @@ -1175,20 +1185,20 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) } } /* groups */ -namespace scenes { +namespace scenes_management { const function_generic_t *function_list = NULL; const int function_flags = CLUSTER_FLAG_NONE; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) { - cluster_t *cluster = cluster::create(endpoint, Scenes::Id, flags); + cluster_t *cluster = cluster::create(endpoint, ScenesManagement::Id, flags); if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; } if (flags & CLUSTER_FLAG_SERVER) { - static const auto plugin_server_init_cb = CALL_ONCE(MatterScenesPluginServerInitCallback); + static const auto plugin_server_init_cb = CALL_ONCE(MatterScenesManagementPluginServerInitCallback); set_plugin_server_init_callback(cluster, plugin_server_init_cb); add_function_list(cluster, function_list, function_flags); } @@ -1203,12 +1213,9 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); - attribute::create_scene_count(cluster, config->scene_count); - attribute::create_current_scene(cluster, config->current_scene); - attribute::create_current_group(cluster, config->current_group); - attribute::create_scene_valid(cluster, config->scene_valid); - attribute::create_scene_name_support(cluster, config->scene_name_support); + attribute::create_last_configure_by(cluster, 0); attribute::create_scene_table_size(cluster, config->scene_table_size); + attribute::create_fabric_scene_info(cluster, NULL, 0, 0); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1231,7 +1238,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) return cluster; } -} /* scenes */ +} /* scenes_management */ namespace on_off { const function_generic_t function_list[] = { @@ -1393,7 +1400,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_ attribute::create_primary_n_intensity(cluster, nullable(), idx); } } - + /* Commands */ if (features & feature::hue_saturation::get_id() || features & feature::color_temperature::get_id() || features & feature::xy::get_id()) { command::create_stop_move_step(cluster); @@ -1617,14 +1624,14 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; - } + } if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); - } + } if (flags & CLUSTER_FLAG_CLIENT) { create_default_binding_cluster(endpoint); - } + } if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ @@ -1639,8 +1646,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); - } - } + } + } return cluster; } @@ -1675,7 +1682,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1714,7 +1721,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1753,7 +1760,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1792,7 +1799,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1831,7 +1838,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1870,7 +1877,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1909,7 +1916,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1948,7 +1955,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -1987,7 +1994,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -2026,7 +2033,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { - global::attribute::create_cluster_revision(cluster, config->cluster_revision); + global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } @@ -2079,20 +2086,20 @@ const function_generic_t *function_list = NULL; const int function_flags = CLUSTER_FLAG_NONE; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) -{ +{ cluster_t *cluster = cluster::create(endpoint, OperationalState::Id, flags); if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; } - + if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); } if (flags & CLUSTER_FLAG_CLIENT) { create_default_binding_cluster(endpoint); } - + if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ global::attribute::create_feature_map(cluster, 0); @@ -2109,10 +2116,10 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); } else { - ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); + ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } } - + event::create_operational_error(cluster); return cluster; @@ -2166,7 +2173,7 @@ const function_generic_t function_list[] = { const int function_flags = CLUSTER_FLAG_PRE_ATTRIBUTE_CHANGED_FUNCTION; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) -{ +{ cluster_t *cluster = cluster::create(endpoint, LaundryWasherControls::Id, flags); if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); @@ -2208,14 +2215,14 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; - } + } if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); - } + } if (flags & CLUSTER_FLAG_CLIENT) { create_default_binding_cluster(endpoint); - } + } if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ @@ -2247,14 +2254,14 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; - } + } if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); - } + } if (flags & CLUSTER_FLAG_CLIENT) { create_default_binding_cluster(endpoint); - } + } if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ @@ -2284,14 +2291,14 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; - } + } if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); - } + } if (flags & CLUSTER_FLAG_CLIENT) { create_default_binding_cluster(endpoint); - } + } if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ @@ -3144,23 +3151,23 @@ const function_generic_t *function_list = NULL; const int function_flags = CLUSTER_FLAG_NONE; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) -{ +{ cluster_t *cluster = cluster::create(endpoint, RvcRunMode::Id, flags); if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; } - + if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); - + /* Attributes managed internally */ global::attribute::create_feature_map(cluster, 0); #if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE global::attribute::create_event_list(cluster, NULL, 0, 0); #endif attribute::create_supported_modes(cluster, NULL, 0, 0); - + /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); @@ -3172,7 +3179,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Commands */ command::create_change_to_mode(cluster); - + return cluster; } } /* rvc_run_mode */ @@ -3182,33 +3189,33 @@ const function_generic_t *function_list = NULL; const int function_flags = CLUSTER_FLAG_NONE; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) -{ +{ cluster_t *cluster = cluster::create(endpoint, RvcCleanMode::Id, flags); if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; - } - + } + if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); - + /* Attributes managed internally */ global::attribute::create_feature_map(cluster, 0); global::attribute::create_event_list(cluster, NULL, 0, 0); attribute::create_supported_modes(cluster, NULL, 0, 0); - + /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); attribute::create_current_mode(cluster, config->current_mode); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); - } - } + } + } /* Commands */ command::create_change_to_mode(cluster); - + return cluster; } } /* rvc_clean_mode */ @@ -3218,20 +3225,20 @@ const function_generic_t *function_list = NULL; const int function_flags = CLUSTER_FLAG_NONE; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) -{ +{ cluster_t *cluster = cluster::create(endpoint, RvcOperationalState::Id, flags); if (!cluster) { ESP_LOGE(TAG, "Could not create cluster"); return NULL; } - + if (flags & CLUSTER_FLAG_SERVER) { add_function_list(cluster, function_list, function_flags); } if (flags & CLUSTER_FLAG_CLIENT) { create_default_binding_cluster(endpoint); } - + if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ global::attribute::create_feature_map(cluster, 0); @@ -3246,7 +3253,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } } - + return cluster; } } /* rvc_operational_state */ diff --git a/components/esp_matter/esp_matter_cluster.h b/components/esp_matter/esp_matter_cluster.h index b4cf691b8..db993d276 100644 --- a/components/esp_matter/esp_matter_cluster.h +++ b/components/esp_matter/esp_matter_cluster.h @@ -71,7 +71,7 @@ namespace basic_information { typedef struct config { uint16_t cluster_revision; char node_label[32]; - config() : cluster_revision(2), node_label{0} {} + config() : cluster_revision(3), node_label{0} {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); @@ -138,7 +138,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); namespace general_diagnostics { typedef struct config { uint16_t cluster_revision; - config() : cluster_revision(1) {} + config() : cluster_revision(2) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); @@ -159,7 +159,7 @@ typedef struct config { config() : cluster_revision(1) {} } config_t; -cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); +cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features); } /* administrator_commissioning */ namespace operational_credentials { @@ -192,7 +192,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); namespace diagnostics_network_thread { typedef struct config { uint16_t cluster_revision; - config() : cluster_revision(1) {} + config() : cluster_revision(2) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); @@ -248,7 +248,7 @@ typedef struct config { uint32_t idle_mode_interval; uint32_t active_mode_interval; uint16_t active_mode_threshold; - config() : cluster_revision(1), idle_mode_interval(5000), active_mode_interval(300), active_mode_threshold(300) {} + config() : cluster_revision(2), idle_mode_interval(5000), active_mode_interval(300), active_mode_threshold(300) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features); @@ -293,28 +293,22 @@ typedef struct config { cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); } /* groups */ -namespace scenes { +namespace scenes_management { typedef struct config { uint16_t cluster_revision; - uint8_t scene_count; - uint8_t current_scene; - uint16_t current_group; - bool scene_valid; - uint8_t scene_name_support; uint16_t scene_table_size; - config() : cluster_revision(5), scene_count(0), current_scene(0), current_group(0), scene_valid(false), - scene_name_support(0), scene_table_size(0) {} + config() : cluster_revision(6), scene_table_size(16) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); -} /* scenes */ +} /* scenes_management */ namespace on_off { typedef struct config { uint16_t cluster_revision; bool on_off; feature::lighting::config_t lighting; - config() : cluster_revision(5), on_off(false) {} + config() : cluster_revision(6), on_off(false) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features); @@ -403,7 +397,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); namespace hepa_filter_monitoring { typedef struct config { uint16_t cluster_revision; - config() : cluster_revision(1) {} + config() : cluster_revision(1) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); @@ -412,7 +406,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); namespace activated_carbon_filter_monitoring { typedef struct config { uint16_t cluster_revision; - config() : cluster_revision(1) {} + config() : cluster_revision(1) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); diff --git a/components/esp_matter/esp_matter_command.cpp b/components/esp_matter/esp_matter_command.cpp index 99aabea86..01d4f6f70 100644 --- a/components/esp_matter/esp_matter_command.cpp +++ b/components/esp_matter/esp_matter_command.cpp @@ -988,6 +988,17 @@ static esp_err_t esp_matter_command_callback_test_event_trigger(const ConcreteCo return ESP_OK; } +static esp_err_t esp_matter_command_callback_time_snap_shot(const ConcreteCommandPath &command_path, + TLVReader &tlv_data, void *opaque_ptr) +{ + chip::app::Clusters::GeneralDiagnostics::Commands::TimeSnapshot::DecodableType command_data; + CHIP_ERROR error = Decode(tlv_data, command_data); + if (error == CHIP_NO_ERROR) { + emberAfGeneralDiagnosticsClusterTimeSnapshotCallback((CommandHandler *)opaque_ptr, command_path, command_data); + } + return ESP_OK; +} + static esp_err_t esp_matter_command_callback_up_or_open(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *opaque_ptr) { @@ -1376,10 +1387,22 @@ namespace command { command_t *create_test_event_trigger(cluster_t *cluster) { - return esp_matter::command::create(cluster, GeneralDiagnostics::Commands::TestEventTrigger::Id, COMMAND_FLAG_ACCEPTED, + return esp_matter::command::create(cluster, GeneralDiagnostics::Commands::TestEventTrigger::Id, COMMAND_FLAG_ACCEPTED, esp_matter_command_callback_test_event_trigger); } +command_t *create_time_snap_shot(cluster_t *cluster) +{ + return esp_matter::command::create(cluster, GeneralDiagnostics::Commands::TimeSnapshot::Id, COMMAND_FLAG_ACCEPTED, + esp_matter_command_callback_time_snap_shot); +} + +command_t *create_time_snap_shot_response(cluster_t *cluster) +{ + return esp_matter::command::create(cluster, GeneralDiagnostics::Commands::TimeSnapshotResponse::Id, COMMAND_FLAG_GENERATED, + NULL); +} + } /* command */ } /* general_diagnostics */ @@ -1801,109 +1824,89 @@ command_t *create_stay_active_request(cluster_t *cluster) } /* command */ } /* icd_management */ -namespace scenes { +namespace scenes_management { namespace command { command_t *create_add_scene(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::AddScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::AddScene::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_view_scene(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::ViewScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::ViewScene::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_remove_scene(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::RemoveScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::RemoveScene::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_remove_all_scenes(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::RemoveAllScenes::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::RemoveAllScenes::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_store_scene(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::StoreScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::StoreScene::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_recall_scene(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::RecallScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::RecallScene::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_get_scene_membership(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::GetSceneMembership::Id, COMMAND_FLAG_ACCEPTED, NULL); -} - -command_t *create_enhanced_add_scene(cluster_t *cluster) -{ - return esp_matter::command::create(cluster, Scenes::Commands::EnhancedAddScene::Id, COMMAND_FLAG_ACCEPTED, NULL); -} - -command_t *create_enhanced_view_scene(cluster_t *cluster) -{ - return esp_matter::command::create(cluster, Scenes::Commands::EnhancedViewScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::GetSceneMembership::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_copy_scene(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::CopyScene::Id, COMMAND_FLAG_ACCEPTED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::CopyScene::Id, COMMAND_FLAG_ACCEPTED, NULL); } command_t *create_add_scene_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::AddSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::AddSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); } command_t *create_view_scene_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::ViewSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::ViewSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); } command_t *create_remove_scene_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::RemoveSceneResponse::Id, COMMAND_FLAG_GENERATED, + return esp_matter::command::create(cluster, ScenesManagement::Commands::RemoveSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); } command_t *create_remove_all_scenes_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::RemoveAllScenesResponse::Id, COMMAND_FLAG_GENERATED, + return esp_matter::command::create(cluster, ScenesManagement::Commands::RemoveAllScenesResponse::Id, COMMAND_FLAG_GENERATED, NULL); } command_t *create_store_scene_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::StoreSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::StoreSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); } command_t *create_get_scene_membership_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::GetSceneMembershipResponse::Id, + return esp_matter::command::create(cluster, ScenesManagement::Commands::GetSceneMembershipResponse::Id, COMMAND_FLAG_GENERATED, NULL); } -command_t *create_enhanced_add_scene_response(cluster_t *cluster) -{ - return esp_matter::command::create(cluster, Scenes::Commands::EnhancedAddSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); -} - -command_t *create_enhanced_view_scene_response(cluster_t *cluster) -{ - return esp_matter::command::create(cluster, Scenes::Commands::EnhancedViewSceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); -} - command_t *create_copy_scene_response(cluster_t *cluster) { - return esp_matter::command::create(cluster, Scenes::Commands::CopySceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); + return esp_matter::command::create(cluster, ScenesManagement::Commands::CopySceneResponse::Id, COMMAND_FLAG_GENERATED, NULL); } } /* command */ -} /* scenes */ +} /* scenes_management */ namespace on_off { namespace command { diff --git a/components/esp_matter/esp_matter_command.h b/components/esp_matter/esp_matter_command.h index 17ad2b90d..6ae82d724 100644 --- a/components/esp_matter/esp_matter_command.h +++ b/components/esp_matter/esp_matter_command.h @@ -70,6 +70,8 @@ command_t *create_retrieve_logs_response(cluster_t *cluster); namespace general_diagnostics { namespace command { command_t *create_test_event_trigger(cluster_t *cluster); +command_t *create_time_snap_shot(cluster_t *cluster); +command_t *create_time_snap_shot_response(cluster_t *cluster); } /* command */ } /* general_diagnostics */ @@ -187,7 +189,7 @@ command_t *create_stay_active_request(cluster_t *cluster); } /* command */ } /* icd_management */ -namespace scenes { +namespace scenes_management { namespace command { command_t *create_add_scene(cluster_t *cluster); command_t *create_view_scene(cluster_t *cluster); @@ -196,8 +198,6 @@ command_t *create_remove_all_scenes(cluster_t *cluster); command_t *create_store_scene(cluster_t *cluster); command_t *create_recall_scene(cluster_t *cluster); command_t *create_get_scene_membership(cluster_t *cluster); -command_t *create_enhanced_add_scene(cluster_t *cluster); -command_t *create_enhanced_view_scene(cluster_t *cluster); command_t *create_copy_scene(cluster_t *cluster); command_t *create_add_scene_response(cluster_t *cluster); command_t *create_view_scene_response(cluster_t *cluster); @@ -205,11 +205,9 @@ command_t *create_remove_scene_response(cluster_t *cluster); command_t *create_remove_all_scenes_response(cluster_t *cluster); command_t *create_store_scene_response(cluster_t *cluster); command_t *create_get_scene_membership_response(cluster_t *cluster); -command_t *create_enhanced_add_scene_response(cluster_t *cluster); -command_t *create_enhanced_view_scene_response(cluster_t *cluster); command_t *create_copy_scene_response(cluster_t *cluster); } /* command */ -} /* scenes */ +} /* scenes_management */ namespace on_off { namespace command { diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index 0feb60908..8bf5375e5 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -567,7 +567,7 @@ esp_err_t enable(endpoint_t *endpoint) /* This is needed to avoid 'crosses initialization' errors because of goto */ esp_err_t err = ESP_OK; lock::status_t lock_status = lock::FAILED; - EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + CHIP_ERROR status = CHIP_NO_ERROR; EmberAfCluster *matter_clusters = NULL; _attribute_t *attribute = NULL; int attribute_count = 0; @@ -737,8 +737,8 @@ esp_err_t enable(endpoint_t *endpoint) endpoint_index = endpoint::get_next_index(); status = emberAfSetDynamicEndpoint(endpoint_index, current_endpoint->endpoint_id, endpoint_type, data_versions, device_types, current_endpoint->parent_endpoint_id); - if (status != EMBER_ZCL_STATUS_SUCCESS) { - ESP_LOGE(TAG, "Error adding dynamic endpoint %" PRIu16 ": 0x%x", current_endpoint->endpoint_id, status); + if (status != CHIP_NO_ERROR) { + ESP_LOGE(TAG, "Error adding dynamic endpoint %" PRIu16 ": %" CHIP_ERROR_FORMAT, current_endpoint->endpoint_id, status.Format()); err = ESP_FAIL; if (lock_status == lock::SUCCESS) { lock::chip_stack_unlock(); diff --git a/components/esp_matter/esp_matter_endpoint.cpp b/components/esp_matter/esp_matter_endpoint.cpp index 18ed30bfc..b82599185 100644 --- a/components/esp_matter/esp_matter_endpoint.cpp +++ b/components/esp_matter/esp_matter_endpoint.cpp @@ -58,7 +58,8 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) general_commissioning::create(endpoint, &(config->general_commissioning), CLUSTER_FLAG_SERVER); network_commissioning::create(endpoint, &(config->network_commissioning), CLUSTER_FLAG_SERVER); general_diagnostics::create(endpoint, &(config->general_diagnostics), CLUSTER_FLAG_SERVER); - administrator_commissioning::create(endpoint, &(config->administrator_commissioning), CLUSTER_FLAG_SERVER); + administrator_commissioning::create(endpoint, &(config->administrator_commissioning), CLUSTER_FLAG_SERVER, + administrator_commissioning::feature::basic::get_id()); operational_credentials::create(endpoint, &(config->operational_credentials), CLUSTER_FLAG_SERVER); group_key_management::create(endpoint, CLUSTER_FLAG_SERVER); @@ -155,7 +156,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); + scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); return ESP_OK; @@ -197,7 +198,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); + scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -240,7 +241,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); + scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -286,10 +287,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - cluster_t *scenes_cluster = scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); - scenes::command::create_enhanced_add_scene(scenes_cluster); - scenes::command::create_enhanced_view_scene(scenes_cluster); - scenes::command::create_copy_scene(scenes_cluster); + cluster_t *scenes_cluster = scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); + scenes_management::command::create_copy_scene(scenes_cluster); + scenes_management::command::create_copy_scene_response(scenes_cluster); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, @@ -494,7 +494,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); + scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); return ESP_OK; @@ -535,7 +535,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); + scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -720,7 +720,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) if (!endpoint) { ESP_LOGE(TAG, "Endpoint cannot be NULL"); return ESP_ERR_INVALID_ARG; - } + } esp_err_t err = add_device_type(endpoint, get_device_type_id(), get_device_type_version()); if (err != ESP_OK) { ESP_LOGE(TAG, "Failed to add device type id:%" PRIu32 ", err: %d", get_device_type_id(), err); @@ -758,7 +758,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) if (!endpoint) { ESP_LOGE(TAG, "Endpoint cannot be NULL"); return ESP_ERR_INVALID_ARG; - } + } esp_err_t err = add_device_type(endpoint, get_device_type_id(), get_device_type_version()); if (err != ESP_OK) { ESP_LOGE(TAG, "Failed to add device type id:%" PRIu32 ", err: %d", get_device_type_id(), err); @@ -832,7 +832,7 @@ esp_err_t add(endpoint_t * endpoint, config_t * config) if (!endpoint) { ESP_LOGE(TAG, "Endpoint cannot be NULL"); return ESP_ERR_INVALID_ARG; - } + } esp_err_t err = add_device_type(endpoint, get_device_type_id(), get_device_type_version()); if (err != ESP_OK) { ESP_LOGE(TAG, "Failed to add device type id:%" PRIu32 ", err: %d", get_device_type_id(), err); @@ -963,7 +963,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) descriptor::create(endpoint, &(config->descriptor), CLUSTER_FLAG_SERVER); identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes::create(endpoint, &(config->scenes), CLUSTER_FLAG_SERVER); + scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); window_covering::create(endpoint, &(config->window_covering), CLUSTER_FLAG_SERVER, ESP_MATTER_NONE_FEATURE_ID); return ESP_OK; @@ -1462,7 +1462,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) if (!endpoint) { ESP_LOGE(TAG, "Could not create endpoint"); return ESP_ERR_INVALID_ARG; - } + } esp_err_t err = add_device_type(endpoint, get_device_type_id(), get_device_type_version()); if (err != ESP_OK) { ESP_LOGE(TAG, "Failed to add device type id:%" PRIu32 ", err: %d", get_device_type_id(), err); diff --git a/components/esp_matter/esp_matter_endpoint.h b/components/esp_matter/esp_matter_endpoint.h index 740fbe86e..a29327a1e 100644 --- a/components/esp_matter/esp_matter_endpoint.h +++ b/components/esp_matter/esp_matter_endpoint.h @@ -149,7 +149,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; } config_t; @@ -164,7 +164,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; cluster::level_control::config_t level_control; } config_t; @@ -180,7 +180,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; cluster::level_control::config_t level_control; cluster::color_control::config_t color_control; @@ -197,7 +197,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; cluster::level_control::config_t level_control; cluster::color_control::config_t color_control; @@ -266,7 +266,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; } config_t; @@ -281,7 +281,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; cluster::level_control::config_t level_control; } config_t; @@ -310,7 +310,7 @@ namespace thermostat { typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::groups::config_t groups; cluster::thermostat::config_t thermostat; } config_t; @@ -424,7 +424,7 @@ typedef struct config { cluster::descriptor::config_t descriptor; cluster::identify::config_t identify; cluster::groups::config_t groups; - cluster::scenes::config_t scenes; + cluster::scenes_management::config_t scenes_management; cluster::window_covering::config_t window_covering; config(uint8_t end_product_type = 0) : window_covering(end_product_type) {} } config_t; diff --git a/components/esp_matter/esp_matter_feature.cpp b/components/esp_matter/esp_matter_feature.cpp index c05d6ba04..bc4b3b3bf 100644 --- a/components/esp_matter/esp_matter_feature.cpp +++ b/components/esp_matter/esp_matter_feature.cpp @@ -91,6 +91,35 @@ esp_err_t add(cluster_t *cluster) } } +namespace administrator_commissioning { + +namespace feature { + +namespace basic { + +uint32_t get_id() { + return (uint32_t)AdministratorCommissioning::Feature::kBasic; +} + +esp_err_t add(cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return ESP_ERR_INVALID_ARG; + } + update_feature_map(cluster, get_id()); + + /* Attributes managed internally */ + command::create_open_basic_commissioning_window(cluster); + + return ESP_OK; +} + +} /* basic */ + +} +} + namespace power_source { namespace feature { namespace wired { @@ -207,13 +236,13 @@ esp_err_t add(cluster_t *cluster, config_t *config) } /* feature */ } /* power_source */ -namespace scenes { +namespace scenes_management { namespace feature { namespace scene_names { uint32_t get_id() { - return (uint32_t)Scenes::Feature::kSceneNames; + return (uint32_t)ScenesManagement::Feature::kSceneNames; } esp_err_t add(cluster_t *cluster) @@ -228,69 +257,8 @@ esp_err_t add(cluster_t *cluster) } } /* scene_names */ - -namespace explicit_feature { - -uint32_t get_id() -{ - return (uint32_t)Scenes::Feature::kExplicit; -} - -esp_err_t add(cluster_t *cluster) -{ - if (!cluster) { - ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; - } - update_feature_map(cluster, get_id()); - - return ESP_OK; -} - -} /* explicit_feature */ - -namespace table_size { - -uint32_t get_id() -{ - return (uint32_t)Scenes::Feature::kTableSize; -} - -esp_err_t add(cluster_t *cluster) -{ - if (!cluster) { - ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; - } - update_feature_map(cluster, get_id()); - - return ESP_OK; -} - -} /* table_size */ - -namespace fabric_scenes { - -uint32_t get_id() -{ - return (uint32_t)Scenes::Feature::kFabricScenes; -} - -esp_err_t add(cluster_t *cluster) -{ - if (!cluster) { - ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; - } - update_feature_map(cluster, get_id()); - - return ESP_OK; -} - -} /* fabric_scenes*/ - } /* feature */ -} /* scenes */ +} /* scenes_management */ namespace icd_management { namespace feature { @@ -931,7 +899,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -987,7 +955,7 @@ esp_err_t add(cluster_t *cluster) if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); return ESP_ERR_INVALID_ARG; - } + } update_feature_map(cluster, get_id()); return ESP_OK; @@ -1011,7 +979,7 @@ esp_err_t add(cluster_t *cluster) update_feature_map(cluster, get_id()); return ESP_OK; -} +} } /* moderate */ @@ -1072,7 +1040,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1098,7 +1066,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1213,7 +1181,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1239,7 +1207,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1354,7 +1322,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1380,7 +1348,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1495,7 +1463,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1521,7 +1489,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1636,7 +1604,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1662,7 +1630,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1777,7 +1745,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1803,7 +1771,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1918,7 +1886,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -1944,7 +1912,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2059,7 +2027,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2085,7 +2053,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2200,7 +2168,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2226,7 +2194,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2341,7 +2309,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2367,7 +2335,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) { if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); - return ESP_ERR_INVALID_ARG; + return ESP_ERR_INVALID_ARG; } update_feature_map(cluster, get_id()); @@ -2483,7 +2451,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) if (!cluster) { ESP_LOGE(TAG, "Cluster cannot be NULL"); return ESP_ERR_INVALID_ARG; - } + } update_feature_map(cluster, get_id()); attribute::create_condition(cluster, config->condition); @@ -2626,7 +2594,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) ESP_LOGE(TAG, "Cluster cannot be NULL"); return ESP_ERR_INVALID_ARG; } - + update_feature_map(cluster, get_id()); attribute::create_spin_speed_current(cluster, config->spin_speed_current); @@ -2649,7 +2617,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) ESP_LOGE(TAG, "Cluster cannot be NULL"); return ESP_ERR_INVALID_ARG; } - + update_feature_map(cluster, get_id()); attribute::create_number_of_rinses(cluster, config->number_of_rinses); @@ -3173,7 +3141,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) ESP_LOGE(TAG, "Cluster shall support either TemperatureLevel or TemperatureNumber feature"); return ESP_ERR_NOT_SUPPORTED; } - + return ESP_OK; } } /* temperature_level */ @@ -3315,7 +3283,7 @@ esp_err_t add(cluster_t *cluster) update_feature_map(cluster, get_id()); command::create_step(cluster); - + return ESP_OK; } } /* step */ @@ -3336,7 +3304,7 @@ esp_err_t add(cluster_t *cluster, config_t *config) update_feature_map(cluster, get_id()); attribute::create_airflow_direction(cluster, config->airflow_direction); - + return ESP_OK; } } /* airflow_direction */ diff --git a/components/esp_matter/esp_matter_feature.h b/components/esp_matter/esp_matter_feature.h index ba153b5eb..a5806f66e 100644 --- a/components/esp_matter/esp_matter_feature.h +++ b/components/esp_matter/esp_matter_feature.h @@ -43,6 +43,20 @@ esp_err_t add(cluster_t *cluster); } /* feature */ } /* descriptor */ +namespace administrator_commissioning { + +namespace feature { + +namespace basic { + +uint32_t get_id(); +esp_err_t add(cluster_t *cluster); + +} /* basic */ + +} /* feature */ +} /* administrator_commissioning */ + namespace power_source { namespace feature { namespace wired { @@ -100,7 +114,7 @@ esp_err_t add(cluster_t *cluster, config_t *config); } /* feature */ } /* power_source */ -namespace scenes { +namespace scenes_management { namespace feature { namespace scene_names { @@ -131,7 +145,7 @@ esp_err_t add(cluster_t *cluster); } /* fabric_scenes*/ } /* feature */ -} /* scenes */ +} /* scenes_management */ namespace icd_management { namespace feature { namespace check_in_protocol_support { @@ -438,7 +452,7 @@ namespace feature { namespace heating { typedef struct config { - int16_t occupied_heating_setpoint; + int16_t occupied_heating_setpoint; config (): occupied_heating_setpoint(2000) {} } config_t; @@ -450,7 +464,7 @@ esp_err_t add(cluster_t *cluster, config_t *config); namespace cooling { typedef struct config { - int16_t occupied_cooling_setpoint; + int16_t occupied_cooling_setpoint; config (): occupied_cooling_setpoint(2600) {} } config_t; @@ -464,12 +478,12 @@ esp_err_t add(cluster_t *cluster, config_t *config); namespace occupancy { typedef struct config { - uint8_t occupancy; + uint8_t occupancy; int16_t unoccupied_cooling_setpoint; int16_t unoccupied_heating_setpoint; - nullable unoccupied_setback; - nullable unoccupied_setback_min; - nullable unoccupied_setback_max; + nullable unoccupied_setback; + nullable unoccupied_setback_min; + nullable unoccupied_setback_max; config (): occupancy(1), unoccupied_cooling_setpoint(2600), unoccupied_heating_setpoint(2000), unoccupied_setback(), unoccupied_setback_min(), unoccupied_setback_max() {} } config_t; @@ -481,9 +495,9 @@ esp_err_t add(cluster_t *cluster, config_t *config); namespace schedule_configuration { typedef struct config { - uint8_t start_of_week; - uint8_t number_of_weekly_transitions; - uint8_t number_of_daily_transitions; + uint8_t start_of_week; + uint8_t number_of_weekly_transitions; + uint8_t number_of_daily_transitions; config (): start_of_week(0), number_of_weekly_transitions(0), number_of_daily_transitions(0) {} } config_t; @@ -495,9 +509,9 @@ esp_err_t add(cluster_t *cluster, config_t *config); namespace setback { typedef struct config { - nullable occupied_setback; - nullable occupied_setback_min; - nullable occupied_setback_max; + nullable occupied_setback; + nullable occupied_setback_min; + nullable occupied_setback_max; config (): occupied_setback(), occupied_setback_min(), occupied_setback_max() {} } config_t; @@ -512,7 +526,7 @@ esp_err_t add(cluster_t *cluster, config_t *config); namespace auto_mode { typedef struct config { - int8_t min_setpoint_dead_band; + int8_t min_setpoint_dead_band; config (): min_setpoint_dead_band(25) {} } config_t; diff --git a/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h b/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h index f7e4fbe7a..6b712d586 100644 --- a/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h +++ b/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h @@ -95,7 +95,7 @@ void MatterRelativeHumidityMeasurementPluginServerInitCallback(); void MatterRvcCleanModePluginServerInitCallback(); void MatterRvcOperationalStatePluginServerInitCallback(); void MatterRvcRunModePluginServerInitCallback(); -void MatterScenesPluginServerInitCallback(); +void MatterScenesManagementPluginServerInitCallback(); void MatterSmokeCoAlarmPluginServerInitCallback(); void MatterSoftwareDiagnosticsPluginServerInitCallback(); void MatterSwitchPluginServerInitCallback(); diff --git a/components/esp_matter/zap_common/app/callback-stub.cpp b/components/esp_matter/zap_common/app/callback-stub.cpp index e5e975047..8afaa1a65 100644 --- a/components/esp_matter/zap_common/app/callback-stub.cpp +++ b/components/esp_matter/zap_common/app/callback-stub.cpp @@ -241,8 +241,8 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::RvcRunMode::Id: emberAfRvcRunModeClusterInitCallback(endpoint); break; - case app::Clusters::Scenes::Id: - emberAfScenesClusterInitCallback(endpoint); + case app::Clusters::ScenesManagement::Id: + emberAfScenesManagementClusterInitCallback(endpoint); break; case app::Clusters::SmokeCoAlarm::Id: emberAfSmokeCoAlarmClusterInitCallback(endpoint); @@ -688,7 +688,7 @@ void __attribute__((weak)) emberAfRvcRunModeClusterInitCallback(EndpointId endpo // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfScenesClusterInitCallback(EndpointId endpoint) +void __attribute__((weak)) emberAfScenesManagementClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; diff --git a/components/esp_matter/zap_common/zap-generated/gen_config.h b/components/esp_matter/zap_common/zap-generated/gen_config.h index b3d1876f8..b5ee24308 100644 --- a/components/esp_matter/zap_common/zap-generated/gen_config.h +++ b/components/esp_matter/zap_common/zap-generated/gen_config.h @@ -151,57 +151,60 @@ /* Cluster specific macros which are generic */ -#define EMBER_AF_PLUGIN_ON_OFF // used in level control +#define MATTER_DM_PLUGIN_ON_OFF // used in level control -#define EMBER_AF_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL 254 // used in level control -#define EMBER_AF_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 // used in level control -#define EMBER_AF_PLUGIN_LEVEL_CONTROL_RATE 0 // used in level control +#define MATTER_DM_PLUGIN_LEVEL_CONTROL_MAXIMUM_LEVEL 254 // used in level control +#define MATTER_DM_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 // used in level control +#define MATTER_DM_PLUGIN_LEVEL_CONTROL_RATE 0 // used in level control -#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY // used in color control -#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP // used in color control -#define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV // used in color control +#define MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_XY // used in color control +#define MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_TEMP // used in color control +#define MATTER_DM_PLUGIN_COLOR_CONTROL_SERVER_HSV // used in color control -#define EMBER_AF_PLUGIN_GROUPS_SERVER // used in scenes, util +#define MATTER_DM_PLUGIN_GROUPS_SERVER // used in scenes, util -#define EMBER_AF_PLUGIN_SCENES // used in groups, level control, on off +#define MATTER_DM_PLUGIN_SCENES // used in groups, level control, on off -#define EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE 541 // used in ias zone server +#define MATTER_DM_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE 541 // used in ias zone server // THIS PART IS NOT GENERATED BY ZAP /* Other cluster specific macros which are made generic */ -#define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in account login -#define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in application basic -#define EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in application launcher -#define EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in audio output -#define EMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in channel -#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in color control -#define EMBER_AF_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in content app observer -#define EMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in content launch -#define EMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in content control -#define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in identify -#define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in keypad input -#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in level control -#define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in low power -#define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in media input -#define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in media playback -#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in on off -#define EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in ota -#define EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in power source -#define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in target navigator -#define EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in wake on lan -#define EMBER_AF_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in window covering -#define EMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in door lock -#define EMBER_AF_FAN_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in fan control -#define EMBER_AF_DISHWASHER_ALARM_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in dishwasher -#define EMBER_AF_LAUNDRY_WASHER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in washer control -#define EMBER_AF_LAUNDRY_DRYER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT //used in dryer control -#define EMBER_AF_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in sample-mei -#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in scenes -#define EMBER_AF_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in electrical energy measuremnet +#define MATTER_DM_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in account login +#define MATTER_DM_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in application basic +#define MATTER_DM_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in application launcher +#define MATTER_DM_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in audio output +#define MATTER_DM_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in channel +#define MATTER_DM_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in color control +#define MATTER_DM_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in content app observer +#define MATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in content launch +#define MATTER_DM_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in content control +#define MATTER_DM_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in identify +#define MATTER_DM_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in keypad input +#define MATTER_DM_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in level control +#define MATTER_DM_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in low power +#define MATTER_DM_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in media input +#define MATTER_DM_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in media playback +#define MATTER_DM_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in on off +#define MATTER_DM_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in ota +#define MATTER_DM_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in power source +#define MATTER_DM_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in target navigator +#define MATTER_DM_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in wake on lan +#define MATTER_DM_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in window covering +#define MATTER_DM_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in door lock +#define MATTER_DM_FAN_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in fan control +#define MATTER_DM_DISHWASHER_ALARM_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in dishwasher +#define MATTER_DM_LAUNDRY_WASHER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in washer control +#define MATTER_DM_LAUNDRY_DRYER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT //used in dryer control +#define MATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in sample-mei +#define MATTER_DM_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in scenes +#define MATTER_DM_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in electrical energy measuremnet +#define MATTER_DM_BOOLEAN_STATE_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in boolean state configuration +#define MATTER_DM_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in valve configuration and control +#define MATTER_DM_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in message -#define EMBER_AF_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT CONFIG_ESP_MATTER_MODE_SELECT_CLUSTER_ENDPOINT_COUNT // used in mode select -#define EMBER_AF_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT CONFIG_ESP_MATTER_TEMPERATURE_CONTROL_CLUSTER_ENDPOINT_COUNT // used in temperature control +#define MATTER_DM_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT CONFIG_ESP_MATTER_MODE_SELECT_CLUSTER_ENDPOINT_COUNT // used in mode select +#define MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT CONFIG_ESP_MATTER_TEMPERATURE_CONTROL_CLUSTER_ENDPOINT_COUNT // used in temperature control #define MATTER_SCENES_TABLE_SIZE CONFIG_ESP_MATTER_SCENES_TABLE_SIZE // used in scenes // TODO: check this again diff --git a/components/esp_matter_controller/esp_matter_controller_cluster_command.cpp b/components/esp_matter_controller/esp_matter_controller_cluster_command.cpp index 2d8fca932..200adf157 100644 --- a/components/esp_matter_controller/esp_matter_controller_cluster_command.cpp +++ b/components/esp_matter_controller/esp_matter_controller_cluster_command.cpp @@ -85,28 +85,28 @@ void decode_response(const ConcreteCommandPath &command_path, TLVReader *reader) } // namespace command } // namespace groups -namespace scenes { +namespace scenes_management { namespace command { void decode_response(const ConcreteCommandPath &command_path, TLVReader *reader) { - if (command_path.mCommandId == Scenes::Commands::AddSceneResponse::Id) { - decode_command_response(command_path, reader); - } else if (command_path.mCommandId == Scenes::Commands::ViewSceneResponse::Id) { - decode_command_response(command_path, reader); - } else if (command_path.mCommandId == Scenes::Commands::RemoveSceneResponse::Id) { - decode_command_response(command_path, reader); - } else if (command_path.mCommandId == Scenes::Commands::RemoveAllScenesResponse::Id) { - decode_command_response(command_path, reader); - } else if (command_path.mCommandId == Scenes::Commands::StoreSceneResponse::Id) { - decode_command_response(command_path, reader); - } else if (command_path.mCommandId == Scenes::Commands::GetSceneMembershipResponse::Id) { - decode_command_response(command_path, reader); + if (command_path.mCommandId == ScenesManagement::Commands::AddSceneResponse::Id) { + decode_command_response(command_path, reader); + } else if (command_path.mCommandId == ScenesManagement::Commands::ViewSceneResponse::Id) { + decode_command_response(command_path, reader); + } else if (command_path.mCommandId == ScenesManagement::Commands::RemoveSceneResponse::Id) { + decode_command_response(command_path, reader); + } else if (command_path.mCommandId == ScenesManagement::Commands::RemoveAllScenesResponse::Id) { + decode_command_response(command_path, reader); + } else if (command_path.mCommandId == ScenesManagement::Commands::StoreSceneResponse::Id) { + decode_command_response(command_path, reader); + } else if (command_path.mCommandId == ScenesManagement::Commands::GetSceneMembershipResponse::Id) { + decode_command_response(command_path, reader); } } } // namespace command -} // namespace scenes +} // namespace scenes_management namespace thermostat { namespace command { @@ -185,8 +185,8 @@ void cluster_command::default_success_fcn(void *ctx, const ConcreteCommandPath & case Groups::Id: cluster::groups::command::decode_response(command_path, response_data); break; - case Scenes::Id: - cluster::scenes::command::decode_response(command_path, response_data); + case ScenesManagement::Id: + cluster::scenes_management::command::decode_response(command_path, response_data); break; case Thermostat::Id: cluster::thermostat::command::decode_response(command_path, response_data); diff --git a/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp b/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp index b455ed7a7..411fdb86c 100644 --- a/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp +++ b/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp @@ -188,7 +188,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value) + const chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -213,7 +213,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & value) + const chip::app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -238,41 +238,9 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::SceneInfoStruct::DecodableType & value) + const chip::app::Clusters::ScenesManagement::Structs::SceneInfoStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("SceneCount", indent + 1, value.sceneCount); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SceneCount'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("CurrentScene", indent + 1, value.currentScene); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CurrentScene'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("CurrentGroup", indent + 1, value.currentGroup); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CurrentGroup'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("SceneValid", indent + 1, value.sceneValid); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SceneValid'"); - return err; - } - } { CHIP_ERROR err = LogValue("RemainingCapacity", indent + 1, value.remainingCapacity); if (err != CHIP_NO_ERROR) @@ -6589,7 +6557,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::AddSceneResponse::DecodableType & value) + const ScenesManagement::Commands::AddSceneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6599,7 +6567,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::ViewSceneResponse::DecodableType & value) + const ScenesManagement::Commands::ViewSceneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6612,7 +6580,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::RemoveSceneResponse::DecodableType & value) + const ScenesManagement::Commands::RemoveSceneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6622,7 +6590,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::RemoveAllScenesResponse::DecodableType & value) + const ScenesManagement::Commands::RemoveAllScenesResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6631,7 +6599,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::StoreSceneResponse::DecodableType & value) + const ScenesManagement::Commands::StoreSceneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6641,7 +6609,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::GetSceneMembershipResponse::DecodableType & value) + const ScenesManagement::Commands::GetSceneMembershipResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6652,30 +6620,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::EnhancedAddSceneResponse::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); - ReturnErrorOnFailure(DataModelLogger::LogValue("sceneID", indent + 1, value.sceneID)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::EnhancedViewSceneResponse::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("groupID", indent + 1, value.groupID)); - ReturnErrorOnFailure(DataModelLogger::LogValue("sceneID", indent + 1, value.sceneID)); - ReturnErrorOnFailure(DataModelLogger::LogValue("transitionTime", indent + 1, value.transitionTime)); - ReturnErrorOnFailure(DataModelLogger::LogValue("sceneName", indent + 1, value.sceneName)); - ReturnErrorOnFailure(DataModelLogger::LogValue("extensionFieldSets", indent + 1, value.extensionFieldSets)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const Scenes::Commands::CopySceneResponse::DecodableType & value) + const ScenesManagement::Commands::CopySceneResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); @@ -6956,8 +6901,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const EnergyEvse::Commands::GetTargetsResponse::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("dayOfWeekforSequence", indent + 1, value.dayOfWeekforSequence)); - ReturnErrorOnFailure(DataModelLogger::LogValue("chargingTargets", indent + 1, value.chargingTargets)); DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } @@ -7406,75 +7349,50 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case Scenes::Id: { + case ScenesManagement::Id: { switch (path.mAttributeId) { - case Scenes::Attributes::SceneCount::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SceneCount", 1, value); - } - case Scenes::Attributes::CurrentScene::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentScene", 1, value); - } - case Scenes::Attributes::CurrentGroup::Id: { - chip::GroupId value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("CurrentGroup", 1, value); - } - case Scenes::Attributes::SceneValid::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("SceneValid", 1, value); - } - case Scenes::Attributes::NameSupport::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NameSupport", 1, value); - } - case Scenes::Attributes::LastConfiguredBy::Id: { + case ScenesManagement::Attributes::LastConfiguredBy::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LastConfiguredBy", 1, value); } - case Scenes::Attributes::SceneTableSize::Id: { + case ScenesManagement::Attributes::SceneTableSize::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SceneTableSize", 1, value); } - case Scenes::Attributes::FabricSceneInfo::Id: { - chip::app::DataModel::DecodableList value; + case ScenesManagement::Attributes::FabricSceneInfo::Id: { + chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FabricSceneInfo", 1, value); } - case Scenes::Attributes::GeneratedCommandList::Id: { + case ScenesManagement::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GeneratedCommandList", 1, value); } - case Scenes::Attributes::AcceptedCommandList::Id: { + case ScenesManagement::Attributes::AcceptedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AcceptedCommandList", 1, value); } - case Scenes::Attributes::EventList::Id: { + case ScenesManagement::Attributes::EventList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("EventList", 1, value); } - case Scenes::Attributes::AttributeList::Id: { + case ScenesManagement::Attributes::AttributeList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AttributeList", 1, value); } - case Scenes::Attributes::FeatureMap::Id: { + case ScenesManagement::Attributes::FeatureMap::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("FeatureMap", 1, value); } - case Scenes::Attributes::ClusterRevision::Id: { + case ScenesManagement::Attributes::ClusterRevision::Id: { uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); @@ -10750,11 +10668,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RvcRunMode::Attributes::OnMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnMode", 1, value); - } case RvcRunMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -10801,11 +10714,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case RvcCleanMode::Attributes::OnMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnMode", 1, value); - } case RvcCleanMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -12036,16 +11944,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RandomizationDelayWindow", 1, value); } - case EnergyEvse::Attributes::NumberOfWeeklyTargets::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfWeeklyTargets", 1, value); - } - case EnergyEvse::Attributes::NumberOfDailyTargets::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("NumberOfDailyTargets", 1, value); - } case EnergyEvse::Attributes::NextChargeStartTime::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -16910,51 +16808,41 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case Scenes::Id: { + case ScenesManagement::Id: { switch (path.mCommandId) { - case Scenes::Commands::AddSceneResponse::Id: { - Scenes::Commands::AddSceneResponse::DecodableType value; + case ScenesManagement::Commands::AddSceneResponse::Id: { + ScenesManagement::Commands::AddSceneResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AddSceneResponse", 1, value); } - case Scenes::Commands::ViewSceneResponse::Id: { - Scenes::Commands::ViewSceneResponse::DecodableType value; + case ScenesManagement::Commands::ViewSceneResponse::Id: { + ScenesManagement::Commands::ViewSceneResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ViewSceneResponse", 1, value); } - case Scenes::Commands::RemoveSceneResponse::Id: { - Scenes::Commands::RemoveSceneResponse::DecodableType value; + case ScenesManagement::Commands::RemoveSceneResponse::Id: { + ScenesManagement::Commands::RemoveSceneResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RemoveSceneResponse", 1, value); } - case Scenes::Commands::RemoveAllScenesResponse::Id: { - Scenes::Commands::RemoveAllScenesResponse::DecodableType value; + case ScenesManagement::Commands::RemoveAllScenesResponse::Id: { + ScenesManagement::Commands::RemoveAllScenesResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RemoveAllScenesResponse", 1, value); } - case Scenes::Commands::StoreSceneResponse::Id: { - Scenes::Commands::StoreSceneResponse::DecodableType value; + case ScenesManagement::Commands::StoreSceneResponse::Id: { + ScenesManagement::Commands::StoreSceneResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StoreSceneResponse", 1, value); } - case Scenes::Commands::GetSceneMembershipResponse::Id: { - Scenes::Commands::GetSceneMembershipResponse::DecodableType value; + case ScenesManagement::Commands::GetSceneMembershipResponse::Id: { + ScenesManagement::Commands::GetSceneMembershipResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GetSceneMembershipResponse", 1, value); } - case Scenes::Commands::EnhancedAddSceneResponse::Id: { - Scenes::Commands::EnhancedAddSceneResponse::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EnhancedAddSceneResponse", 1, value); - } - case Scenes::Commands::EnhancedViewSceneResponse::Id: { - Scenes::Commands::EnhancedViewSceneResponse::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EnhancedViewSceneResponse", 1, value); - } - case Scenes::Commands::CopySceneResponse::Id: { - Scenes::Commands::CopySceneResponse::DecodableType value; + case ScenesManagement::Commands::CopySceneResponse::Id: { + ScenesManagement::Commands::CopySceneResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CopySceneResponse", 1, value); } diff --git a/components/esp_matter_controller/logger/zap-generated/DataModelLogger.h b/components/esp_matter_controller/logger/zap-generated/DataModelLogger.h index 8828a1149..d4819d3c4 100644 --- a/components/esp_matter_controller/logger/zap-generated/DataModelLogger.h +++ b/components/esp_matter_controller/logger/zap-generated/DataModelLogger.h @@ -39,13 +39,13 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Structs::AttributeValuePair::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::ExtensionFieldSet::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Structs::ExtensionFieldSet::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Structs::SceneInfoStruct::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Structs::SceneInfoStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Descriptor::Structs::DeviceTypeStruct::DecodableType & value); @@ -580,23 +580,19 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::AddSceneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::ViewSceneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::RemoveSceneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::RemoveAllScenesResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::StoreSceneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::GetSceneMembershipResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType & value); + const chip::app::Clusters::ScenesManagement::Commands::CopySceneResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & value); diff --git a/examples/zap_light/CMakeLists.txt b/examples/zap_light/CMakeLists.txt index 7c68f8fc7..9157024cc 100644 --- a/examples/zap_light/CMakeLists.txt +++ b/examples/zap_light/CMakeLists.txt @@ -54,26 +54,29 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-secur # The zap generated files don't define these ENDPOINT_COUNTs # Set these COUNTs 1 to avoid compilation errors -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_FAN_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_DISHWASHER_ALARM_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_LAUNDRY_WASHER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) -idf_build_set_property(CXX_COMPILE_OPTIONS "-DEMBER_AF_LAUNDRY_DRYER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_CONTENT_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_FAN_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_DISHWASHER_ALARM_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_LAUNDRY_WASHER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_CONTENT_APP_OBSERVER_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_CONTENT_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_LAUNDRY_DRYER_CONTROLS_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_BOOLEAN_STATE_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-DMATTER_DM_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT=1" APPEND) From f9b4844735f4ce43e12156583be4726d4aedf403 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Fri, 23 Feb 2024 17:09:48 +0800 Subject: [PATCH 3/8] Add check for CHIP_CONFIG_ENABLE_ICD_CIP when adding CIP feature for ICD management cluster --- components/esp_matter/esp_matter_cluster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index 6cb9323fa..c2e4f51c5 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -998,10 +998,12 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_ } } +#if CHIP_CONFIG_ENABLE_ICD_CIP if (features & feature::check_in_protocol_support::get_id()) { feature::check_in_protocol_support::config_t cip_config; feature::check_in_protocol_support::add(cluster, &cip_config); } +#endif // CHIP_CONFIG_ENABLE_ICD_CIP #endif // CONFIG_ENABLE_ICD_SERVER return cluster; } From 96abd8f8a4e97e37ecbf57e8f5701ee4ee69b62c Mon Sep 17 00:00:00 2001 From: liyashuai Date: Mon, 26 Feb 2024 10:32:59 +0800 Subject: [PATCH 4/8] fix build error --- components/esp_matter/CMakeLists.txt | 5 +++++ examples/refrigerator/main/CMakeLists.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/components/esp_matter/CMakeLists.txt b/components/esp_matter/CMakeLists.txt index 15124df66..dc958a9c0 100644 --- a/components/esp_matter/CMakeLists.txt +++ b/components/esp_matter/CMakeLists.txt @@ -55,6 +55,11 @@ endif() target_compile_options(${COMPONENT_LIB} PUBLIC "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=") +# TODO: remove this option after https://github.com/project-chip/connectedhomeip/pull/32287 merged +if (${IDF_VERSION_MAJOR} LESS 5) +idf_build_set_property(COMPILE_OPTIONS "-Wno-error=conversion;-Wno-conversion" APPEND) +endif() + # Time sync client feature depends on read client, disable it when read client is disabled. if (CONFIG_DISABLE_READ_CLIENT) target_compile_options(${COMPONENT_LIB} PUBLIC "-DTIME_SYNC_ENABLE_TSC_FEATURE=0") diff --git a/examples/refrigerator/main/CMakeLists.txt b/examples/refrigerator/main/CMakeLists.txt index 4de6b9521..989672e07 100644 --- a/examples/refrigerator/main/CMakeLists.txt +++ b/examples/refrigerator/main/CMakeLists.txt @@ -13,6 +13,8 @@ set(exclude_srcs_list "${MATTER_SDK_PATH}/examples/all-clusters-app/all-cluste "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp" "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp" "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp" + "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp" + "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp" ) idf_component_register(SRC_DIRS ${SRC_DIRS_LIST} From d7a5642451a1ffeabb8e186c42def8e3d444a1b0 Mon Sep 17 00:00:00 2001 From: liyashuai Date: Tue, 27 Feb 2024 16:56:25 +0800 Subject: [PATCH 5/8] use SRCS instead of SRC_DIRS in refrigerator example CMakeLists --- examples/refrigerator/main/CMakeLists.txt | 24 ++++++----------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/examples/refrigerator/main/CMakeLists.txt b/examples/refrigerator/main/CMakeLists.txt index 989672e07..a27fc417c 100644 --- a/examples/refrigerator/main/CMakeLists.txt +++ b/examples/refrigerator/main/CMakeLists.txt @@ -1,25 +1,13 @@ -set(SRC_DIRS_LIST "." - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src" +set(SRC_LIST app_driver.cpp + app_main.cpp + ${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp + ${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/tcc-mode.cpp ) set(INCLUDE_DIRS_LIST "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/include") -set(exclude_srcs_list "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegates.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp" - "${MATTER_SDK_PATH}/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp" - ) - -idf_component_register(SRC_DIRS ${SRC_DIRS_LIST} - EXCLUDE_SRCS ${exclude_srcs_list} - INCLUDE_DIRS ${INCLUDE_DIRS_LIST} +idf_component_register(SRCS ${SRC_LIST} + INCLUDE_DIRS ${INCLUDE_DIRS_LIST} PRIV_INCLUDE_DIRS "." "${ESP_MATTER_PATH}/examples/common/utils") set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) From 9998ef3cb6f8cb127f6700f29a59a69ec3e3df32 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Wed, 28 Feb 2024 14:06:39 +0530 Subject: [PATCH 6/8] Support diagnostic logs cluster in light example --- .../zap_common/zap-generated/gen_config.h | 1 + examples/light/main/CMakeLists.txt | 14 ++++++++++++-- examples/light/main/app_main.cpp | 15 +++++++++++++++ examples/light/partitions.csv | 1 + examples/light/sdkconfig.defaults | 7 +++++++ 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/components/esp_matter/zap_common/zap-generated/gen_config.h b/components/esp_matter/zap_common/zap-generated/gen_config.h index b5ee24308..900e4a387 100644 --- a/components/esp_matter/zap_common/zap-generated/gen_config.h +++ b/components/esp_matter/zap_common/zap-generated/gen_config.h @@ -203,6 +203,7 @@ #define MATTER_DM_BOOLEAN_STATE_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in boolean state configuration #define MATTER_DM_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in valve configuration and control #define MATTER_DM_MESSAGES_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in message +#define MATTER_DM_DIAGNOSTIC_LOGS_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in diagnostic logs cluster #define MATTER_DM_MODE_SELECT_CLUSTER_SERVER_ENDPOINT_COUNT CONFIG_ESP_MATTER_MODE_SELECT_CLUSTER_ENDPOINT_COUNT // used in mode select #define MATTER_DM_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT CONFIG_ESP_MATTER_TEMPERATURE_CONTROL_CLUSTER_ENDPOINT_COUNT // used in temperature control diff --git a/examples/light/main/CMakeLists.txt b/examples/light/main/CMakeLists.txt index 43626a795..8335e2403 100644 --- a/examples/light/main/CMakeLists.txt +++ b/examples/light/main/CMakeLists.txt @@ -1,5 +1,15 @@ -idf_component_register(SRC_DIRS "." - PRIV_INCLUDE_DIRS "." "${ESP_MATTER_PATH}/examples/common/utils") +idf_component_register(SRCS + "app_driver.cpp" + "app_main.cpp" + "${MATTER_SDK_PATH}/examples/temperature-measurement-app/esp32/main/diagnostic-logs-provider-delegate-impl.cpp" + PRIV_INCLUDE_DIRS + "." + "${ESP_MATTER_PATH}/examples/common/utils" + "${MATTER_SDK_PATH}/examples/temperature-measurement-app/esp32/main/include" + EMBED_FILES + "${MATTER_SDK_PATH}/examples/temperature-measurement-app/esp32/main/diagnostic_logs/end_user_support.log" + "${MATTER_SDK_PATH}/examples/temperature-measurement-app/esp32/main/diagnostic_logs/network_diag.log" + "${MATTER_SDK_PATH}/examples/temperature-measurement-app/esp32/main/diagnostic_logs/crash.log") set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/light/main/app_main.cpp b/examples/light/main/app_main.cpp index 1d61acb2b..245fa09e2 100644 --- a/examples/light/main/app_main.cpp +++ b/examples/light/main/app_main.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -22,6 +23,8 @@ #endif #include +#include +#include #include static const char *TAG = "app_main"; @@ -162,6 +165,11 @@ extern "C" void app_main() node_t *node = node::create(&node_config, app_attribute_update_cb, app_identification_cb); ABORT_APP_ON_FAILURE(node != nullptr, ESP_LOGE(TAG, "Failed to create Matter node")); + // add diagnostic logs cluster on root endpoint + cluster::diagnostic_logs::config_t diag_logs_config; + endpoint_t *root_ep = endpoint::get(node, 0); // get the root node ep + cluster::diagnostic_logs::create(root_ep, &diag_logs_config, CLUSTER_FLAG_SERVER); + extended_color_light::config_t light_config; light_config.on_off.on_off = DEFAULT_POWER; light_config.on_off.lighting.start_up_on_off = nullptr; @@ -222,3 +230,10 @@ extern "C" void app_main() esp_matter::console::init(); #endif } + +using namespace chip::app::Clusters::DiagnosticLogs; +void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint) +{ + auto & logProvider = LogProvider::GetInstance(); + DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider); +} diff --git a/examples/light/partitions.csv b/examples/light/partitions.csv index ffe5f242e..428705154 100644 --- a/examples/light/partitions.csv +++ b/examples/light/partitions.csv @@ -8,3 +8,4 @@ phy_init, data, phy, , 0x1000, ota_0, app, ota_0, 0x20000, 0x1E0000, ota_1, app, ota_1, 0x200000, 0x1E0000, fctry, data, nvs, 0x3E0000, 0x6000 +coredump, data, coredump,, 64K diff --git a/examples/light/sdkconfig.defaults b/examples/light/sdkconfig.defaults index 4dd60fc42..9b6905016 100644 --- a/examples/light/sdkconfig.defaults +++ b/examples/light/sdkconfig.defaults @@ -56,3 +56,10 @@ CONFIG_BSP_BUTTON_1_GPIO=0 CONFIG_BSP_BUTTON_1_LEVEL=0 # LEDs CONFIG_BSP_LEDS_NUM=0 + +# configurations required for diagnostic logs cluster +# Enable the diagnostic logs transfer over BDX protocol +CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER=y + +CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y +CONFIG_ESP32_COREDUMP_DATA_FORMAT_ELF=y From bc55974f346a98010640328f046021ccb2d24ed2 Mon Sep 17 00:00:00 2001 From: liyashuai Date: Wed, 28 Feb 2024 17:18:46 +0800 Subject: [PATCH 7/8] resolve some comment --- components/esp_matter/esp_matter_attribute.cpp | 10 +++++----- components/esp_matter/esp_matter_attribute.h | 4 ++-- components/esp_matter/esp_matter_cluster.cpp | 9 ++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp index cd3ca5f03..f682c87a7 100644 --- a/components/esp_matter/esp_matter_attribute.cpp +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -283,7 +283,7 @@ attribute_t *create_specification_version(cluster_t *cluster, uint32_t value) esp_matter_uint32(value)); } -attribute_t *create_max_path_per_invoke_version(cluster_t *cluster, uint16_t value) +attribute_t *create_max_paths_per_invoke(cluster_t *cluster, uint16_t value) { return esp_matter::attribute::create(cluster, BasicInformation::Attributes::MaxPathsPerInvoke::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); @@ -1067,22 +1067,22 @@ attribute_t *create_group_name_support(cluster_t *cluster, uint8_t value) namespace scenes_management { namespace attribute { -attribute_t *create_last_configure_by(cluster_t *cluster, uint64_t value) +attribute_t *create_last_configured_by(cluster_t *cluster, uint64_t value) { return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::LastConfiguredBy::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_uint64(value)); + esp_matter_uint64(value)); } attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value) { return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::SceneTableSize::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_uint16(value)); + esp_matter_uint16(value)); } attribute_t *create_fabric_scene_info(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count) { return esp_matter::attribute::create(cluster, ScenesManagement::Attributes::FabricSceneInfo::Id, ATTRIBUTE_FLAG_NONE, - esp_matter_array((uint8_t*)value, length, count)); + esp_matter_array((uint8_t*)value, length, count)); } } /* attribute */ diff --git a/components/esp_matter/esp_matter_attribute.h b/components/esp_matter/esp_matter_attribute.h index 4eb311642..deaaf8f68 100644 --- a/components/esp_matter/esp_matter_attribute.h +++ b/components/esp_matter/esp_matter_attribute.h @@ -92,7 +92,7 @@ attribute_t *create_reachable(cluster_t *cluster, bool value); attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length); attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count); attribute_t *create_specification_version(cluster_t *cluster, uint32_t value); -attribute_t *create_max_path_per_invoke_version(cluster_t *cluster, uint16_t value); +attribute_t *create_max_paths_per_invoke(cluster_t *cluster, uint16_t value); } /* attribute */ } /* basic_information */ @@ -303,7 +303,7 @@ attribute_t *create_group_name_support(cluster_t *cluster, uint8_t value); namespace scenes_management { namespace attribute { -attribute_t *create_last_configure_by(cluster_t *cluster, uint64_t value); +attribute_t *create_last_configured_by(cluster_t *cluster, uint64_t value); attribute_t *create_scene_table_size(cluster_t *cluster, uint16_t value); attribute_t *create_fabric_scene_info(cluster_t *cluster, const uint8_t * value, uint16_t length, uint16_t count); } /* attribute */ diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index c2e4f51c5..e3e374c38 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -241,7 +241,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) attribute::create_software_version_string(cluster, NULL, 0); attribute::create_capability_minima(cluster, NULL, 0, 0); attribute::create_specification_version(cluster, 0); - //attribute::create_max_path_per_invoke_version(cluster, 0); + attribute::create_max_paths_per_invoke(cluster, 0); /* Attributes not managed internally */ if (config) { @@ -594,7 +594,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_ /* Commands */ command::create_open_commissioning_window(cluster); - //command::create_open_basic_commissioning_window(cluster); command::create_revoke_commissioning(cluster); return cluster; @@ -998,12 +997,12 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_ } } -#if CHIP_CONFIG_ENABLE_ICD_CIP +#if defined(CHIP_CONFIG_ENABLE_ICD_CIP) && CHIP_CONFIG_ENABLE_ICD_CIP if (features & feature::check_in_protocol_support::get_id()) { feature::check_in_protocol_support::config_t cip_config; feature::check_in_protocol_support::add(cluster, &cip_config); } -#endif // CHIP_CONFIG_ENABLE_ICD_CIP +#endif // defined(CHIP_CONFIG_ENABLE_ICD_CIP) && CHIP_CONFIG_ENABLE_ICD_CIP #endif // CONFIG_ENABLE_ICD_SERVER return cluster; } @@ -1215,7 +1214,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); - attribute::create_last_configure_by(cluster, 0); + attribute::create_last_configured_by(cluster, 0); attribute::create_scene_table_size(cluster, config->scene_table_size); attribute::create_fabric_scene_info(cluster, NULL, 0, 0); } else { From 4409873a87358200745c86b806e75e3661aeaaf7 Mon Sep 17 00:00:00 2001 From: liyashuai Date: Fri, 1 Mar 2024 11:30:14 +0800 Subject: [PATCH 8/8] remove administrator_commissioning basic feature from default root node --- components/esp_matter/esp_matter_endpoint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_matter/esp_matter_endpoint.cpp b/components/esp_matter/esp_matter_endpoint.cpp index b82599185..3ae70db3f 100644 --- a/components/esp_matter/esp_matter_endpoint.cpp +++ b/components/esp_matter/esp_matter_endpoint.cpp @@ -59,7 +59,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) network_commissioning::create(endpoint, &(config->network_commissioning), CLUSTER_FLAG_SERVER); general_diagnostics::create(endpoint, &(config->general_diagnostics), CLUSTER_FLAG_SERVER); administrator_commissioning::create(endpoint, &(config->administrator_commissioning), CLUSTER_FLAG_SERVER, - administrator_commissioning::feature::basic::get_id()); + ESP_MATTER_NONE_FEATURE_ID); operational_credentials::create(endpoint, &(config->operational_credentials), CLUSTER_FLAG_SERVER); group_key_management::create(endpoint, CLUSTER_FLAG_SERVER);