Skip to content

Commit 22f0648

Browse files
committed
esp-matter: update connectedhomeip submodule to 9b8fffe0bb
1 parent 05831a3 commit 22f0648

20 files changed

+376
-171
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ variables:
2525
IDF_CHECKOUT_REF: "v5.2.3"
2626
# This variable represents the short hash of the connectedhomeip submodule.
2727
# Note: Do change this short hash on submodule update MRs.
28-
CHIP_SHORT_HASH: "43aa98c2d3"
28+
CHIP_SHORT_HASH: "9b8fffe0bb"
2929
DOCKER_IMAGE_NAME: "espressif/chip-idf"
3030

3131
.add_gitlab_ssh_key: &add_gitlab_ssh_key |

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ section in the ESP-Matter Programming Guide.
2828

2929
## Supported ESP-IDF and connectedhomeip versions
3030

31-
- This SDK currently works with commit [43aa98c2d3](https://github.com/project-chip/connectedhomeip/tree/43aa98c2d3) of connectedhomeip.
31+
- This SDK currently works with commit [9b8fffe0bb](https://github.com/project-chip/connectedhomeip/tree/9b8fffe0bb) of connectedhomeip.
3232
- For Matter projects development with this SDK, it is recommended to utilize ESP-IDF [v5.2.3](https://github.com/espressif/esp-idf/tree/v5.2.3).
3333

3434
## Documentation

components/esp_matter/CMakeLists.txt

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ set(SRC_DIRS_LIST "."
44
"${MATTER_SDK_PATH}/zzz_generated/app-common/app-common/zap-generated/attributes"
55
"${MATTER_SDK_PATH}/src/app/server"
66
"${MATTER_SDK_PATH}/src/app/util"
7+
"${MATTER_SDK_PATH}/src/app/util/persistence"
78
"${MATTER_SDK_PATH}/src/app/reporting"
9+
# TODO Use esp-matter data model and remove ember codes
10+
"${MATTER_SDK_PATH}/src/data-model-providers/codegen"
811
)
912

1013
set(INCLUDE_DIRS_LIST "."
@@ -48,10 +51,13 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-error=uninitialized;-Wno-error=mayb
4851
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=array-bounds" APPEND)
4952

5053
if (NOT CONFIG_ESP_MATTER_ENABLE_DATA_MODEL)
51-
target_include_directories(${COMPONENT_LIB} PUBLIC "${CMAKE_BINARY_DIR}/gen/app-codegen/cpp-app"
52-
"${CMAKE_BINARY_DIR}/gen/app-zapgen/zapgen/app-templates")
54+
target_include_directories(${COMPONENT_LIB} PUBLIC "${CMAKE_BINARY_DIR}/gen/__idf_main-codegen/cpp-app"
55+
"${CMAKE_BINARY_DIR}/gen/__idf_main-zapgen/zapgen/app-templates")
5356
endif()
5457

58+
target_sources(${COMPONENT_LIB} PRIVATE ${MATTER_SDK_PATH}/src/app/StorageDelegateWrapper.cpp
59+
${MATTER_SDK_PATH}/src/app/SafeAttributePersistenceProvider.cpp)
60+
5561
# For Xtensa chips, uint32_t was defined as 'unsigned' before v5.0, and after IDF v5.0 it is defined
5662
# as 'unsigned long', same as RISC-V. add this compile option to avoid format errors.
5763
# https://github.com/espressif/esp-idf/issues/6906#issuecomment-1207373706
@@ -61,11 +67,6 @@ endif()
6167
target_compile_options(${COMPONENT_LIB} PUBLIC
6268
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>")
6369

64-
# TODO: remove this option after https://github.com/project-chip/connectedhomeip/pull/32287 merged
65-
if (${IDF_VERSION_MAJOR} LESS 5)
66-
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=conversion;-Wno-conversion" APPEND)
67-
endif()
68-
6970
# Time sync client feature depends on read client, disable it when read client is disabled.
7071
if (CONFIG_DISABLE_READ_CLIENT)
7172
target_compile_options(${COMPONENT_LIB} PUBLIC "-DTIME_SYNC_ENABLE_TSC_FEATURE=0")

components/esp_matter/esp_matter_command.cpp

+7-56
Original file line numberDiff line numberDiff line change
@@ -135,53 +135,6 @@ static esp_err_t esp_matter_command_callback_key_set_read_all_indices(const Conc
135135
return ESP_OK;
136136
}
137137

138-
static esp_err_t esp_matter_command_callback_arm_fail_safe(const ConcreteCommandPath &command_path, TLVReader &tlv_data,
139-
void *opaque_ptr)
140-
{
141-
chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafe::DecodableType command_data;
142-
CHIP_ERROR error = Decode(tlv_data, command_data);
143-
if (error == CHIP_NO_ERROR) {
144-
emberAfGeneralCommissioningClusterArmFailSafeCallback((CommandHandler *)opaque_ptr, command_path, command_data);
145-
}
146-
return ESP_OK;
147-
}
148-
149-
static esp_err_t esp_matter_command_callback_set_regulatory_config(const ConcreteCommandPath &command_path,
150-
TLVReader &tlv_data, void *opaque_ptr)
151-
{
152-
chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfig::DecodableType command_data;
153-
CHIP_ERROR error = Decode(tlv_data, command_data);
154-
if (error == CHIP_NO_ERROR) {
155-
emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback((CommandHandler *)opaque_ptr, command_path,
156-
command_data);
157-
}
158-
return ESP_OK;
159-
}
160-
161-
static esp_err_t esp_matter_command_callback_commissioning_complete(const ConcreteCommandPath &command_path,
162-
TLVReader &tlv_data, void *opaque_ptr)
163-
{
164-
chip::app::Clusters::GeneralCommissioning::Commands::CommissioningComplete::DecodableType command_data;
165-
CHIP_ERROR error = Decode(tlv_data, command_data);
166-
if (error == CHIP_NO_ERROR) {
167-
emberAfGeneralCommissioningClusterCommissioningCompleteCallback((CommandHandler *)opaque_ptr, command_path,
168-
command_data);
169-
}
170-
return ESP_OK;
171-
}
172-
173-
static esp_err_t esp_matter_command_callback_set_tc_acknowledgements(const ConcreteCommandPath &command_path,
174-
TLVReader &tlv_data, void *opaque_ptr)
175-
{
176-
chip::app::Clusters::GeneralCommissioning::Commands::SetTCAcknowledgements::DecodableType command_data;
177-
CHIP_ERROR error = Decode(tlv_data, command_data);
178-
if (error == CHIP_NO_ERROR) {
179-
emberAfGeneralCommissioningClusterSetTCAcknowledgementsCallback((CommandHandler *)opaque_ptr, command_path,
180-
command_data);
181-
}
182-
return ESP_OK;
183-
}
184-
185138
static esp_err_t esp_matter_command_callback_open_commissioning_window(const ConcreteCommandPath &command_path,
186139
TLVReader &tlv_data, void *opaque_ptr)
187140
{
@@ -1893,11 +1846,9 @@ namespace general_commissioning {
18931846
namespace command {
18941847

18951848
constexpr const command_entry_t accepted_command_list[] = {
1896-
{GeneralCommissioning::Commands::ArmFailSafe::Id, COMMAND_FLAG_ACCEPTED, esp_matter_command_callback_arm_fail_safe},
1897-
{GeneralCommissioning::Commands::SetRegulatoryConfig::Id, COMMAND_FLAG_ACCEPTED,
1898-
esp_matter_command_callback_set_regulatory_config},
1899-
{GeneralCommissioning::Commands::CommissioningComplete::Id, COMMAND_FLAG_ACCEPTED,
1900-
esp_matter_command_callback_commissioning_complete},
1849+
{GeneralCommissioning::Commands::ArmFailSafe::Id, COMMAND_FLAG_ACCEPTED, nullptr},
1850+
{GeneralCommissioning::Commands::SetRegulatoryConfig::Id, COMMAND_FLAG_ACCEPTED, nullptr},
1851+
{GeneralCommissioning::Commands::CommissioningComplete::Id, COMMAND_FLAG_ACCEPTED, nullptr},
19011852
};
19021853

19031854
constexpr const command_entry_t generated_command_list[] = {
@@ -1909,19 +1860,19 @@ constexpr const command_entry_t generated_command_list[] = {
19091860
command_t *create_arm_fail_safe(cluster_t *cluster)
19101861
{
19111862
return esp_matter::command::create(cluster, GeneralCommissioning::Commands::ArmFailSafe::Id, COMMAND_FLAG_ACCEPTED,
1912-
esp_matter_command_callback_arm_fail_safe);
1863+
nullptr);
19131864
}
19141865

19151866
command_t *create_set_regulatory_config(cluster_t *cluster)
19161867
{
19171868
return esp_matter::command::create(cluster, GeneralCommissioning::Commands::SetRegulatoryConfig::Id,
1918-
COMMAND_FLAG_ACCEPTED, esp_matter_command_callback_set_regulatory_config);
1869+
COMMAND_FLAG_ACCEPTED, nullptr);
19191870
}
19201871

19211872
command_t *create_commissioning_complete(cluster_t *cluster)
19221873
{
19231874
return esp_matter::command::create(cluster, GeneralCommissioning::Commands::CommissioningComplete::Id,
1924-
COMMAND_FLAG_ACCEPTED, esp_matter_command_callback_commissioning_complete);
1875+
COMMAND_FLAG_ACCEPTED, nullptr);
19251876
}
19261877

19271878
command_t *create_arm_fail_safe_response(cluster_t *cluster)
@@ -1945,7 +1896,7 @@ command_t *create_commissioning_complete_response(cluster_t *cluster)
19451896
command_t *create_set_tc_acknowledgements(cluster_t *cluster)
19461897
{
19471898
return esp_matter::command::create(cluster, GeneralCommissioning::Commands::SetTCAcknowledgements::Id,
1948-
COMMAND_FLAG_ACCEPTED, esp_matter_command_callback_set_tc_acknowledgements);
1899+
COMMAND_FLAG_ACCEPTED, nullptr);
19491900
}
19501901

19511902
command_t *create_set_tc_acknowledgements_response(cluster_t *cluster)

components/esp_matter/esp_matter_core.cpp

+14-16
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <credentials/DeviceAttestationCredsProvider.h>
2828
#include <credentials/FabricTable.h>
2929
#include <credentials/GroupDataProviderImpl.h>
30+
#include <data-model-providers/codegen/Instance.h>
3031
#include <lib/core/DataModelTypes.h>
3132
#include <platform/CHIPDeviceLayer.h>
3233
#include <platform/DeviceInfoProvider.h>
@@ -719,6 +720,7 @@ static void esp_matter_chip_init_task(intptr_t context)
719720

720721
initParams.InitializeStaticResourcesBeforeServerInit();
721722
initParams.appDelegate = &s_app_delegate;
723+
initParams.dataModelProvider = chip::app::CodegenDataModelProviderInstance(initParams.persistentStorageDelegate);
722724

723725
#ifdef CONFIG_ESP_MATTER_ENABLE_DATA_MODEL
724726
// Group data provider injection for dynamic data model
@@ -742,13 +744,24 @@ static void esp_matter_chip_init_task(intptr_t context)
742744
ESP_LOGE(TAG, "Failed to add fabric delegate, err:%" CHIP_ERROR_FORMAT, ret.Format());
743745
}
744746
chip::Server::GetInstance().Init(initParams);
745-
746747
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
748+
#ifdef CONFIG_ESP_MATTER_ENABLE_OPENTHREAD
749+
VerifyOrReturn(ThreadStackMgr().InitThreadStack() == CHIP_NO_ERROR, ESP_LOGE(TAG, "Failed to initialize Thread stack"));
750+
#if CHIP_CONFIG_ENABLE_ICD_SERVER
751+
VerifyOrReturn(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice) == CHIP_NO_ERROR, ESP_LOGE(TAG, "Failed to set the Thread device type"));
752+
753+
#elif CHIP_DEVICE_CONFIG_THREAD_FTD
754+
VerifyOrReturn(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router) == CHIP_NO_ERROR, ESP_LOGE(TAG, "Failed to set the Thread device type"));
755+
#else
756+
VerifyOrReturn(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice) == CHIP_NO_ERROR, ESP_LOGE(TAG, "Failed to set the Thread device type"));
757+
#endif
758+
VerifyOrReturn(ThreadStackMgr().StartThreadTask() == CHIP_NO_ERROR, ESP_LOGE(TAG, "Failed to launch Thread task"));
747759
// If Thread is Provisioned, publish the dns service
748760
if (chip::DeviceLayer::ConnectivityMgr().IsThreadProvisioned() &&
749761
(chip::Server::GetInstance().GetFabricTable().FabricCount() != 0)) {
750762
chip::app::DnssdServer::Instance().StartServer();
751763
}
764+
#endif // CONFIG_ESP_MATTER_ENABLE_OPENTHREAD
752765
#endif
753766
if (endpoint::enable_all() != ESP_OK) {
754767
ESP_LOGE(TAG, "Enable all endpoints failure");
@@ -816,21 +829,6 @@ static esp_err_t chip_init(event_callback_t callback, intptr_t callback_arg)
816829
if(callback) {
817830
PlatformMgr().AddEventHandler(callback, callback_arg);
818831
}
819-
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
820-
#ifdef CONFIG_ESP_MATTER_ENABLE_OPENTHREAD
821-
VerifyOrReturnError(ThreadStackMgr().InitThreadStack() == CHIP_NO_ERROR, ESP_FAIL, ESP_LOGE(TAG, "Failed to initialize Thread stack"));
822-
#if CHIP_CONFIG_ENABLE_ICD_SERVER
823-
VerifyOrReturnError(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice) == CHIP_NO_ERROR, ESP_FAIL, ESP_LOGE(TAG, "Failed to set the Thread device type"));
824-
825-
#elif CHIP_DEVICE_CONFIG_THREAD_FTD
826-
VerifyOrReturnError(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router) == CHIP_NO_ERROR, ESP_FAIL, ESP_LOGE(TAG, "Failed to set the Thread device type"));
827-
#else
828-
VerifyOrReturnError(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice) == CHIP_NO_ERROR, ESP_FAIL, ESP_LOGE(TAG, "Failed to set the Thread device type"));
829-
#endif
830-
VerifyOrReturnError(ThreadStackMgr().StartThreadTask() == CHIP_NO_ERROR, ESP_FAIL, ESP_LOGE(TAG, "Failed to launch Thread task"));
831-
#endif // CONFIG_ESP_MATTER_ENABLE_OPENTHREAD
832-
#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD
833-
834832
#if CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER
835833
// Add bounds to all attributes
836834
esp_matter::cluster::add_bounds_callback_common();

components/esp_matter/esp_matter_delegate_callbacks.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,10 @@ void CommissionerControlDelegateInitCB(void *delegate, uint16_t endpoint_id)
355355
return;
356356
}
357357
CommissionerControl::Delegate *commissioner_control_delegate = static_cast<CommissionerControl::Delegate*>(delegate);
358-
CommissionerControl::CommissionerControlServer::Instance().Init(*commissioner_control_delegate);
358+
CommissionerControl::CommissionerControlServer *commissioner_control_instance = nullptr;
359+
commissioner_control_instance =
360+
new CommissionerControl::CommissionerControlServer(commissioner_control_delegate, endpoint_id, CommissionerControl::Id);
361+
commissioner_control_instance->Init();
359362
}
360363

361364
} // namespace delegate_cb

components/esp_matter/zap_common/app/PluginApplicationCallbacks.h

+8
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ void MatterBindingPluginServerInitCallback();
1414
void MatterBooleanStatePluginServerInitCallback();
1515
void MatterBooleanStateConfigurationPluginServerInitCallback();
1616
void MatterBridgedDeviceBasicInformationPluginServerInitCallback();
17+
void MatterCameraAvSettingsUserLevelManagementPluginServerInitCallback();
18+
void MatterCameraAvStreamManagementPluginServerInitCallback();
1719
void MatterCarbonDioxideConcentrationMeasurementPluginServerInitCallback();
1820
void MatterCarbonMonoxideConcentrationMeasurementPluginServerInitCallback();
1921
void MatterChannelPluginServerInitCallback();
22+
void MatterChimePluginServerInitCallback();
2023
void MatterColorControlPluginServerInitCallback();
2124
void MatterCommissionerControlPluginServerInitCallback();
2225
void MatterContentAppObserverPluginServerInitCallback();
@@ -85,6 +88,7 @@ void MatterProxyDiscoveryPluginServerInitCallback();
8588
void MatterProxyValidPluginServerInitCallback();
8689
void MatterPulseWidthModulationPluginServerInitCallback();
8790
void MatterPumpConfigurationAndControlPluginServerInitCallback();
91+
void MatterPushAvStreamTransportPluginServerInitCallback();
8892
void MatterRadonConcentrationMeasurementPluginServerInitCallback();
8993
void MatterRefrigeratorAlarmPluginServerInitCallback();
9094
void MatterRefrigeratorAndTemperatureControlledCabinetModePluginServerInitCallback();
@@ -108,6 +112,7 @@ void MatterThreadNetworkDiagnosticsPluginServerInitCallback();
108112
void MatterThreadNetworkDirectoryPluginServerInitCallback();
109113
void MatterTimeFormatLocalizationPluginServerInitCallback();
110114
void MatterTimeSynchronizationPluginServerInitCallback();
115+
void MatterTlsCertificateManagementPluginServerInitCallback();
111116
void MatterTotalVolatileOrganicCompoundsConcentrationMeasurementPluginServerInitCallback();
112117
void MatterUnitLocalizationPluginServerInitCallback();
113118
void MatterUnitTestingPluginServerInitCallback();
@@ -116,9 +121,12 @@ void MatterValveConfigurationAndControlPluginServerInitCallback();
116121
void MatterWakeOnLanPluginServerInitCallback();
117122
void MatterWaterHeaterManagementPluginServerInitCallback();
118123
void MatterWaterHeaterModePluginServerInitCallback();
124+
void MatterWebRTCTransportProviderPluginServerInitCallback();
125+
void MatterWebRTCTransportRequestorPluginServerInitCallback();
119126
void MatterWiFiNetworkDiagnosticsPluginServerInitCallback();
120127
void MatterWiFiNetworkManagementPluginServerInitCallback();
121128
void MatterWindowCoveringPluginServerInitCallback();
129+
void MatterZoneManagementPluginServerInitCallback();
122130

123131
#include <esp_matter_cluster.h>
124132

components/esp_matter/zap_common/app/callback-stub.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ void __attribute__((weak)) emberAfBridgedDeviceBasicInformationClusterInitCallba
7676
// To prevent warning
7777
(void) endpoint;
7878
}
79+
void __attribute__((weak)) emberAfCameraAvSettingsUserLevelManagementClusterInitCallback(EndpointId endpoint)
80+
{
81+
// To prevent warning
82+
(void) endpoint;
83+
}
84+
void __attribute__((weak)) emberAfCameraAvStreamManagementClusterInitCallback(EndpointId endpoint)
85+
{
86+
// To prevent warning
87+
(void) endpoint;
88+
}
7989
void __attribute__((weak)) emberAfCarbonDioxideConcentrationMeasurementClusterInitCallback(EndpointId endpoint)
8090
{
8191
// To prevent warning
@@ -91,6 +101,11 @@ void __attribute__((weak)) emberAfChannelClusterInitCallback(EndpointId endpoint
91101
// To prevent warning
92102
(void) endpoint;
93103
}
104+
void __attribute__((weak)) emberAfChimeClusterInitCallback(EndpointId endpoint)
105+
{
106+
// To prevent warning
107+
(void) endpoint;
108+
}
94109
void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint)
95110
{
96111
// To prevent warning
@@ -431,6 +446,11 @@ void __attribute__((weak)) emberAfPumpConfigurationAndControlClusterInitCallback
431446
// To prevent warning
432447
(void) endpoint;
433448
}
449+
void __attribute__((weak)) emberAfPushAvStreamTransportClusterInitCallback(EndpointId endpoint)
450+
{
451+
// To prevent warning
452+
(void) endpoint;
453+
}
434454
void __attribute__((weak)) emberAfRadonConcentrationMeasurementClusterInitCallback(EndpointId endpoint)
435455
{
436456
// To prevent warning
@@ -546,6 +566,11 @@ void __attribute__((weak)) emberAfTimeSynchronizationClusterInitCallback(Endpoin
546566
// To prevent warning
547567
(void) endpoint;
548568
}
569+
void __attribute__((weak)) emberAfTlsCertificateManagementClusterInitCallback(EndpointId endpoint)
570+
{
571+
// To prevent warning
572+
(void) endpoint;
573+
}
549574
void __attribute__((weak)) emberAfTotalVolatileOrganicCompoundsConcentrationMeasurementClusterInitCallback(EndpointId endpoint)
550575
{
551576
// To prevent warning
@@ -586,6 +611,16 @@ void __attribute__((weak)) emberAfWaterHeaterModeClusterInitCallback(EndpointId
586611
// To prevent warning
587612
(void) endpoint;
588613
}
614+
void __attribute__((weak)) emberAfWebRTCTransportProviderClusterInitCallback(EndpointId endpoint)
615+
{
616+
// To prevent warning
617+
(void) endpoint;
618+
}
619+
void __attribute__((weak)) emberAfWebRTCTransportRequestorClusterInitCallback(EndpointId endpoint)
620+
{
621+
// To prevent warning
622+
(void) endpoint;
623+
}
589624
void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(EndpointId endpoint)
590625
{
591626
// To prevent warning
@@ -601,3 +636,8 @@ void __attribute__((weak)) emberAfWindowCoveringClusterInitCallback(EndpointId e
601636
// To prevent warning
602637
(void) endpoint;
603638
}
639+
void __attribute__((weak)) emberAfZoneManagementClusterInitCallback(EndpointId endpoint)
640+
{
641+
// To prevent warning
642+
(void) endpoint;
643+
}

0 commit comments

Comments
 (0)