From 7e8075881724f1631215b13ba928d4ffedf39c19 Mon Sep 17 00:00:00 2001 From: Rohit Jadhav Date: Tue, 13 Aug 2024 19:49:57 +0800 Subject: [PATCH] CHIP-submodule: Update connectedhomeip submodule to commit 0460715589413cb32e32f1626e43ad8000b84f2d --- .gitlab-ci.yml | 3 +- README.md | 2 +- .../esp_matter/esp_matter_attribute_utils.cpp | 1 + components/esp_matter/esp_matter_command.cpp | 1 - components/esp_matter/esp_matter_core.cpp | 1 + .../app/PluginApplicationCallbacks.h | 4 ++ .../zap_common/app/callback-stub.cpp | 20 +++++++ .../zap_common/app/cluster-init-callback.cpp | 12 ++++ .../zap_common/generate_zap_common_files.py | 2 +- .../zap_common/zap-generated/access.h | 33 +++++++++++ ...controller_commissioning_window_opener.cpp | 2 +- .../esp_matter_controller_pairing_command.cpp | 14 ++--- .../esp_matter_controller_pairing_command.h | 3 +- .../core/esp_matter_controller_client.h | 2 +- .../core/esp_matter_controller_console.cpp | 5 +- .../logger/zap-generated/DataModelLogger.cpp | 6 +- .../esp_matter_thread_br_cluster.cpp | 4 +- connectedhomeip/connectedhomeip | 2 +- .../ESP32_custom/nimble/BLEManagerImpl.cpp | 55 +++---------------- .../cmake_common/components_include.cmake | 5 ++ examples/light/sdkconfig.defaults.shell.v4.4 | 1 + tools/docker/chip_idf/Dockerfile | 4 ++ tools/docker/chip_idf/entrypoint.sh | 6 ++ 23 files changed, 121 insertions(+), 67 deletions(-) create mode 100644 examples/light/sdkconfig.defaults.shell.v4.4 create mode 100755 tools/docker/chip_idf/entrypoint.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f043cb0ec..523f0b27f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ variables: IDF_CHECKOUT_REF: "v5.2.1" # This variable represents the short hash of the connectedhomeip submodule. # Note: Do change this short hash on submodule update MRs. - CHIP_SHORT_HASH: "d83caf7fef" + CHIP_SHORT_HASH: "0460715589" DOCKER_IMAGE_NAME: "espressif/chip-idf" .add_gitlab_ssh_key: &add_gitlab_ssh_key | @@ -62,6 +62,7 @@ variables: .setup_ot_br: &setup_ot_br - cd ${CI_PROJECT_DIR} + - apt-get install -y openssh-client - git clone ${ESP_THREAD_BR_REPO_URL} - cd ${BR_PATH}/examples/basic_thread_border_router - git checkout v1.0 diff --git a/README.md b/README.md index 15ae0d366..1514f6e47 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ section in the ESP-Matter Programming Guide. ## Supported ESP-IDF and connectedhomeip versions -- This SDK currently works with commit [d83caf7fef](https://github.com/project-chip/connectedhomeip/tree/d83caf7fef) of connectedhomeip. +- This SDK currently works with commit [0460715589](https://github.com/project-chip/connectedhomeip/tree/0460715589) of connectedhomeip. - For Matter projects development with this SDK, it is recommended to utilize ESP-IDF [v5.2.1](https://github.com/espressif/esp-idf/tree/v5.2.1). diff --git a/components/esp_matter/esp_matter_attribute_utils.cpp b/components/esp_matter/esp_matter_attribute_utils.cpp index 91fc70c3c..3ca0b92f5 100644 --- a/components/esp_matter/esp_matter_attribute_utils.cpp +++ b/components/esp_matter/esp_matter_attribute_utils.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/components/esp_matter/esp_matter_command.cpp b/components/esp_matter/esp_matter_command.cpp index 9d3a34571..ba8fe2f5d 100644 --- a/components/esp_matter/esp_matter_command.cpp +++ b/components/esp_matter/esp_matter_command.cpp @@ -19,7 +19,6 @@ #include #include -#include #include using namespace chip::app::Clusters; diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index 1db7b107b..7147beae9 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h b/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h index 471ba0530..94a0f0a81 100644 --- a/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h +++ b/components/esp_matter/zap_common/app/PluginApplicationCallbacks.h @@ -92,6 +92,7 @@ void MatterRvcOperationalStatePluginServerInitCallback(); void MatterRvcRunModePluginServerInitCallback(); void MatterSampleMeiPluginServerInitCallback(); void MatterScenesManagementPluginServerInitCallback(); +void MatterServiceAreaPluginServerInitCallback(); void MatterSmokeCoAlarmPluginServerInitCallback(); void MatterSoftwareDiagnosticsPluginServerInitCallback(); void MatterSwitchPluginServerInitCallback(); @@ -100,7 +101,9 @@ void MatterTemperatureControlPluginServerInitCallback(); void MatterTemperatureMeasurementPluginServerInitCallback(); void MatterThermostatPluginServerInitCallback(); void MatterThermostatUserInterfaceConfigurationPluginServerInitCallback(); +void MatterThreadBorderRouterManagementPluginServerInitCallback(); void MatterThreadNetworkDiagnosticsPluginServerInitCallback(); +void MatterThreadNetworkDirectoryPluginServerInitCallback(); void MatterTimeFormatLocalizationPluginServerInitCallback(); void MatterTimeSynchronizationPluginServerInitCallback(); void MatterTotalVolatileOrganicCompoundsConcentrationMeasurementPluginServerInitCallback(); @@ -110,6 +113,7 @@ void MatterUserLabelPluginServerInitCallback(); void MatterValveConfigurationAndControlPluginServerInitCallback(); void MatterWakeOnLanPluginServerInitCallback(); void MatterWiFiNetworkDiagnosticsPluginServerInitCallback(); +void MatterWiFiNetworkManagementPluginServerInitCallback(); void MatterWindowCoveringPluginServerInitCallback(); #include diff --git a/components/esp_matter/zap_common/app/callback-stub.cpp b/components/esp_matter/zap_common/app/callback-stub.cpp index 0a82e13ca..19d9c0ea1 100644 --- a/components/esp_matter/zap_common/app/callback-stub.cpp +++ b/components/esp_matter/zap_common/app/callback-stub.cpp @@ -466,6 +466,11 @@ void __attribute__((weak)) emberAfScenesManagementClusterInitCallback(EndpointId // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfServiceAreaClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfSmokeCoAlarmClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -506,11 +511,21 @@ void __attribute__((weak)) emberAfThermostatUserInterfaceConfigurationClusterIni // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfThreadBorderRouterManagementClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThreadNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfThreadNetworkDirectoryClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfTimeFormatLocalizationClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -556,6 +571,11 @@ void __attribute__((weak)) emberAfWiFiNetworkDiagnosticsClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfWiFiNetworkManagementClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfWindowCoveringClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/components/esp_matter/zap_common/app/cluster-init-callback.cpp b/components/esp_matter/zap_common/app/cluster-init-callback.cpp index 9bc0b906e..ec7e0dac6 100644 --- a/components/esp_matter/zap_common/app/cluster-init-callback.cpp +++ b/components/esp_matter/zap_common/app/cluster-init-callback.cpp @@ -289,6 +289,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::ScenesManagement::Id: emberAfScenesManagementClusterInitCallback(endpoint); break; + case app::Clusters::ServiceArea::Id: + emberAfServiceAreaClusterInitCallback(endpoint); + break; case app::Clusters::SmokeCoAlarm::Id: emberAfSmokeCoAlarmClusterInitCallback(endpoint); break; @@ -313,9 +316,15 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::ThermostatUserInterfaceConfiguration::Id: emberAfThermostatUserInterfaceConfigurationClusterInitCallback(endpoint); break; + case app::Clusters::ThreadBorderRouterManagement::Id: + emberAfThreadBorderRouterManagementClusterInitCallback(endpoint); + break; case app::Clusters::ThreadNetworkDiagnostics::Id: emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); break; + case app::Clusters::ThreadNetworkDirectory::Id: + emberAfThreadNetworkDirectoryClusterInitCallback(endpoint); + break; case app::Clusters::TimeFormatLocalization::Id: emberAfTimeFormatLocalizationClusterInitCallback(endpoint); break; @@ -343,6 +352,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::WiFiNetworkDiagnostics::Id: emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); break; + case app::Clusters::WiFiNetworkManagement::Id: + emberAfWiFiNetworkManagementClusterInitCallback(endpoint); + break; case app::Clusters::WindowCovering::Id: emberAfWindowCoveringClusterInitCallback(endpoint); break; diff --git a/components/esp_matter/zap_common/generate_zap_common_files.py b/components/esp_matter/zap_common/generate_zap_common_files.py index fb6c65654..d196b5c51 100755 --- a/components/esp_matter/zap_common/generate_zap_common_files.py +++ b/components/esp_matter/zap_common/generate_zap_common_files.py @@ -95,7 +95,7 @@ def word_format(word): def format_cluster_name(cluster_name): - words = re.split(r'[ /]', cluster_name) + words = re.split(r'[ /-]', cluster_name) capitalized_words = [word_format(word) for word in words] return ''.join(capitalized_words) diff --git a/components/esp_matter/zap_common/zap-generated/access.h b/components/esp_matter/zap_common/zap-generated/access.h index 397a2d802..9c8aab4e1 100644 --- a/components/esp_matter/zap_common/zap-generated/access.h +++ b/components/esp_matter/zap_common/zap-generated/access.h @@ -26,6 +26,8 @@ 0x00000101, /* Cluster: Door Lock, Attribute: AliroGroupResolvingKey, Privilege: administer */ \ 0x00000101, /* Cluster: Door Lock, Attribute: AliroSupportedBLEUWBProtocolVersions, Privilege: administer */ \ 0x00000101, /* Cluster: Door Lock, Attribute: AliroBLEAdvertisingVersion, Privilege: administer */ \ + 0x00000453, /* Cluster: Thread Network Directory, Attribute: PreferredExtendedPanID, Privilege: manage */ \ + 0x00000453, /* Cluster: Thread Network Directory, Attribute: ThreadNetworks, Privilege: operate */ \ 0x0000050D, /* Cluster: Application Basic, Attribute: AllowedVendorList, Privilege: administer */ \ } @@ -48,6 +50,8 @@ 0x00000084, /* Cluster: Door Lock, Attribute: AliroGroupResolvingKey, Privilege: administer */ \ 0x00000085, /* Cluster: Door Lock, Attribute: AliroSupportedBLEUWBProtocolVersions, Privilege: administer */ \ 0x00000086, /* Cluster: Door Lock, Attribute: AliroBLEAdvertisingVersion, Privilege: administer */ \ + 0x00000000, /* Cluster: Thread Network Directory, Attribute: PreferredExtendedPanID, Privilege: manage */ \ + 0x00000001, /* Cluster: Thread Network Directory, Attribute: ThreadNetworks, Privilege: operate */ \ 0x00000007, /* Cluster: Application Basic, Attribute: AllowedVendorList, Privilege: administer */ \ } @@ -70,6 +74,8 @@ chip::Access::Privilege::kAdminister, /* Cluster: Door Lock, Attribute: AliroGroupResolvingKey, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Door Lock, Attribute: AliroSupportedBLEUWBProtocolVersions, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Door Lock, Attribute: AliroBLEAdvertisingVersion, Privilege: administer */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Network Directory, Attribute: PreferredExtendedPanID, Privilege: manage */ \ + chip::Access::Privilege::kOperate, /* Cluster: Thread Network Directory, Attribute: ThreadNetworks, Privilege: operate */ \ chip::Access::Privilege::kAdminister, /* Cluster: Application Basic, Attribute: AllowedVendorList, Privilege: administer */ \ } @@ -179,6 +185,7 @@ 0x00000406, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactOccupiedToUnoccupiedDelay, Privilege: manage */ \ 0x00000406, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactUnoccupiedToOccupiedDelay, Privilege: manage */ \ 0x00000406, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactUnoccupiedToOccupiedThreshold, Privilege: manage */ \ + 0x00000453, /* Cluster: Thread Network Directory, Attribute: PreferredExtendedPanID, Privilege: manage */ \ } // Parallel array data (cluster, *attribute*, privilege) for write attribute @@ -285,6 +292,7 @@ 0x00000030, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactOccupiedToUnoccupiedDelay, Privilege: manage */ \ 0x00000031, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactUnoccupiedToOccupiedDelay, Privilege: manage */ \ 0x00000032, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactUnoccupiedToOccupiedThreshold, Privilege: manage */ \ + 0x00000000, /* Cluster: Thread Network Directory, Attribute: PreferredExtendedPanID, Privilege: manage */ \ } // Parallel array data (cluster, attribute, *privilege*) for write attribute @@ -391,6 +399,7 @@ chip::Access::Privilege::kManage, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactOccupiedToUnoccupiedDelay, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactUnoccupiedToOccupiedDelay, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Occupancy Sensing, Attribute: PhysicalContactUnoccupiedToOccupiedThreshold, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Network Directory, Attribute: PreferredExtendedPanID, Privilege: manage */ \ } //////////////////////////////////////////////////////////////////////////////// @@ -467,6 +476,13 @@ 0x00000201, /* Cluster: Thermostat, Command: CancelPresetsSchedulesEditRequest, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Command: CommitPresetsSchedulesRequest, Privilege: manage */ \ 0x00000201, /* Cluster: Thermostat, Command: CancelSetActivePresetRequest, Privilege: manage */ \ + 0x00000451, /* Cluster: Wi-Fi Network Management, Command: NetworkPassphraseRequest, Privilege: administer */ \ + 0x00000452, /* Cluster: Thread Border Router Management, Command: GetActiveDatasetRequest, Privilege: manage */ \ + 0x00000452, /* Cluster: Thread Border Router Management, Command: GetPendingDatasetRequest, Privilege: manage */ \ + 0x00000452, /* Cluster: Thread Border Router Management, Command: SetActiveDatasetRequest, Privilege: manage */ \ + 0x00000452, /* Cluster: Thread Border Router Management, Command: SetPendingDatasetRequest, Privilege: manage */ \ + 0x00000453, /* Cluster: Thread Network Directory, Command: AddNetwork, Privilege: manage */ \ + 0x00000453, /* Cluster: Thread Network Directory, Command: RemoveNetwork, Privilege: manage */ \ 0x00000507, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \ 0x0000050B, /* Cluster: Audio Output, Command: RenameOutput, Privilege: manage */ \ 0x0000050E, /* Cluster: Account Login, Command: GetSetupPIN, Privilege: administer */ \ @@ -547,6 +563,13 @@ 0x00000008, /* Cluster: Thermostat, Command: CancelPresetsSchedulesEditRequest, Privilege: manage */ \ 0x00000009, /* Cluster: Thermostat, Command: CommitPresetsSchedulesRequest, Privilege: manage */ \ 0x0000000A, /* Cluster: Thermostat, Command: CancelSetActivePresetRequest, Privilege: manage */ \ + 0x00000000, /* Cluster: Wi-Fi Network Management, Command: NetworkPassphraseRequest, Privilege: administer */ \ + 0x00000000, /* Cluster: Thread Border Router Management, Command: GetActiveDatasetRequest, Privilege: manage */ \ + 0x00000001, /* Cluster: Thread Border Router Management, Command: GetPendingDatasetRequest, Privilege: manage */ \ + 0x00000004, /* Cluster: Thread Border Router Management, Command: SetActiveDatasetRequest, Privilege: manage */ \ + 0x00000005, /* Cluster: Thread Border Router Management, Command: SetPendingDatasetRequest, Privilege: manage */ \ + 0x00000000, /* Cluster: Thread Network Directory, Command: AddNetwork, Privilege: manage */ \ + 0x00000001, /* Cluster: Thread Network Directory, Command: RemoveNetwork, Privilege: manage */ \ 0x00000003, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \ 0x00000001, /* Cluster: Audio Output, Command: RenameOutput, Privilege: manage */ \ 0x00000000, /* Cluster: Account Login, Command: GetSetupPIN, Privilege: administer */ \ @@ -627,6 +650,13 @@ chip::Access::Privilege::kManage, /* Cluster: Thermostat, Command: CancelPresetsSchedulesEditRequest, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Thermostat, Command: CommitPresetsSchedulesRequest, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Thermostat, Command: CancelSetActivePresetRequest, Privilege: manage */ \ + chip::Access::Privilege::kAdminister, /* Cluster: Wi-Fi Network Management, Command: NetworkPassphraseRequest, Privilege: administer */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Border Router Management, Command: GetActiveDatasetRequest, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Border Router Management, Command: GetPendingDatasetRequest, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Border Router Management, Command: SetActiveDatasetRequest, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Border Router Management, Command: SetPendingDatasetRequest, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Network Directory, Command: AddNetwork, Privilege: manage */ \ + chip::Access::Privilege::kManage, /* Cluster: Thread Network Directory, Command: RemoveNetwork, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Media Input, Command: RenameInput, Privilege: manage */ \ chip::Access::Privilege::kManage, /* Cluster: Audio Output, Command: RenameOutput, Privilege: manage */ \ chip::Access::Privilege::kAdminister, /* Cluster: Account Login, Command: GetSetupPIN, Privilege: administer */ \ @@ -641,18 +671,21 @@ #define GENERATED_ACCESS_READ_EVENT__CLUSTER { \ 0x0000001F, /* Cluster: Access Control, Event: AccessControlEntryChanged, Privilege: administer */ \ 0x0000001F, /* Cluster: Access Control, Event: AccessControlExtensionChanged, Privilege: administer */ \ + 0x00000453, /* Cluster: Thread Network Directory, Event: NetworkChanged, Privilege: operate */ \ } // Parallel array data (cluster, *event*, privilege) for read event #define GENERATED_ACCESS_READ_EVENT__EVENT { \ 0x00000000, /* Cluster: Access Control, Event: AccessControlEntryChanged, Privilege: administer */ \ 0x00000001, /* Cluster: Access Control, Event: AccessControlExtensionChanged, Privilege: administer */ \ + 0x00000000, /* Cluster: Thread Network Directory, Event: NetworkChanged, Privilege: operate */ \ } // Parallel array data (cluster, event, *privilege*) for read event #define GENERATED_ACCESS_READ_EVENT__PRIVILEGE { \ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Event: AccessControlEntryChanged, Privilege: administer */ \ chip::Access::Privilege::kAdminister, /* Cluster: Access Control, Event: AccessControlExtensionChanged, Privilege: administer */ \ + chip::Access::Privilege::kOperate, /* Cluster: Thread Network Directory, Event: NetworkChanged, Privilege: operate */ \ } //////////////////////////////////////////////////////////////////////////////// diff --git a/components/esp_matter_controller/commands/esp_matter_controller_commissioning_window_opener.cpp b/components/esp_matter_controller/commands/esp_matter_controller_commissioning_window_opener.cpp index a9680fae2..6d2a9b711 100644 --- a/components/esp_matter_controller/commands/esp_matter_controller_commissioning_window_opener.cpp +++ b/components/esp_matter_controller/commands/esp_matter_controller_commissioning_window_opener.cpp @@ -118,7 +118,7 @@ void commissioning_window_opener::on_device_connected_fcn(void *context, Exchang if (generate_pase_verifier(window_opener->m_iteration, window_opener->m_pincode, salt, verifier) != ESP_OK) { return; } - chip::Spake2pVerifierSerialized serialized_verifier; + chip::Crypto::Spake2pVerifierSerialized serialized_verifier; chip::MutableByteSpan serialized_verifier_span(serialized_verifier); if (verifier.Serialize(serialized_verifier_span) != CHIP_NO_ERROR) { ESP_LOGE(TAG, "Failed to serialize the verifier"); diff --git a/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.cpp b/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.cpp index e4465d161..27fd8f6a7 100644 --- a/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.cpp +++ b/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.cpp @@ -91,23 +91,23 @@ CommissioningParameters pairing_command::get_commissioning_params() return CommissioningParameters(); } -void pairing_command::OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData &nodeData) +void pairing_command::OnDiscoveredDevice(const chip::Dnssd::CommissionNodeData &nodeData) { auto &controller_instance = esp_matter::controller::matter_controller_client::get_instance(); // Ignore nodes with closed comissioning window - VerifyOrReturn(nodeData.commissionData.commissioningMode != 0); - const uint16_t port = nodeData.resolutionData.port; + VerifyOrReturn(nodeData.commissioningMode != 0); + const uint16_t port = nodeData.port; char buf[chip::Inet::IPAddress::kMaxStringLength]; - nodeData.resolutionData.ipAddress[0].ToString(buf); + nodeData.ipAddress[0].ToString(buf); ESP_LOGI(TAG, "Discovered Device: %s:%u", buf, port); // Stop Mdns discovery. TODO: Check whether it is a right method controller_instance.get_commissioner()->RegisterDeviceDiscoveryDelegate(nullptr); - Inet::InterfaceId interfaceId = nodeData.resolutionData.ipAddress[0].IsIPv6LinkLocal() - ? nodeData.resolutionData.interfaceId + Inet::InterfaceId interfaceId = nodeData.ipAddress[0].IsIPv6LinkLocal() + ? nodeData.interfaceId : Inet::InterfaceId::Null(); - PeerAddress peerAddress = PeerAddress::UDP(nodeData.resolutionData.ipAddress[0], port, interfaceId); + PeerAddress peerAddress = PeerAddress::UDP(nodeData.ipAddress[0], port, interfaceId); RendezvousParameters params = RendezvousParameters().SetSetupPINCode(m_setup_pincode).SetPeerAddress(peerAddress); CommissioningParameters commissioning_params = get_commissioning_params(); controller_instance.get_commissioner()->PairDevice(m_remote_node_id, params, commissioning_params); diff --git a/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.h b/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.h index eaaf9335d..e653dea5f 100644 --- a/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.h +++ b/components/esp_matter_controller/commands/esp_matter_controller_pairing_command.h @@ -16,6 +16,7 @@ #include #include +#include "dnssd/Types.h" using chip::NodeId; using chip::ScopedNodeId; @@ -53,7 +54,7 @@ public: void OnCommissioningComplete(NodeId deviceId, CHIP_ERROR error) override; /****************** DeviceDiscoveryDelegate Interface ***************/ - void OnDiscoveredDevice(const chip::Dnssd::DiscoveredNodeData &nodeData) override; + void OnDiscoveredDevice(const chip::Dnssd::CommissionNodeData &nodeData) override; static pairing_command &get_instance() { diff --git a/components/esp_matter_controller/core/esp_matter_controller_client.h b/components/esp_matter_controller/core/esp_matter_controller_client.h index c005e445a..f19d4559d 100644 --- a/components/esp_matter_controller/core/esp_matter_controller_client.h +++ b/components/esp_matter_controller/core/esp_matter_controller_client.h @@ -138,7 +138,7 @@ class ESPCommissionerCallback : public CommissionerCallback { chip::RendezvousParameters params = chip::RendezvousParameters() .SetSetupPINCode(pincode).SetDiscriminator(longDiscriminator).SetPeerAddress(peerAddress); do { - chip::DRBG_get_bytes(reinterpret_cast(&gRemoteId), sizeof(gRemoteId)); + chip::Crypto::DRBG_get_bytes(reinterpret_cast(&gRemoteId), sizeof(gRemoteId)); } while (!chip::IsOperationalNodeId(gRemoteId)); matter_controller_client::get_instance().get_commissioner()->PairDevice(gRemoteId, params); } diff --git a/components/esp_matter_controller/core/esp_matter_controller_console.cpp b/components/esp_matter_controller/core/esp_matter_controller_console.cpp index c7c65f859..4faf79922 100644 --- a/components/esp_matter_controller/core/esp_matter_controller_console.cpp +++ b/components/esp_matter_controller/core/esp_matter_controller_console.cpp @@ -36,6 +36,7 @@ #include #include #include +#include using chip::NodeId; using chip::Inet::IPAddress; @@ -261,7 +262,7 @@ static esp_err_t controller_udc_handler(int argc, char **argv) UDCClientState *state = instance.get_commissioner()->GetUserDirectedCommissioningServer()->GetUDCClients().GetUDCClientState(index); ESP_RETURN_ON_FALSE(state != nullptr, ESP_FAIL, TAG, "UDC client not found"); - state->SetUDCClientProcessingState(chip::Controller::UDCClientProcessingState::kCommissioningNode); + state->SetUDCClientProcessingState(chip::Protocols::UserDirectedCommissioning::UDCClientProcessingState::kCommissioningNode); chip::NodeId gRemoteId = chip::kTestDeviceNodeId; chip::RendezvousParameters params = chip::RendezvousParameters() @@ -269,7 +270,7 @@ static esp_err_t controller_udc_handler(int argc, char **argv) .SetDiscriminator(state->GetLongDiscriminator()) .SetPeerAddress(state->GetPeerAddress()); do { - chip::DRBG_get_bytes(reinterpret_cast(&gRemoteId), sizeof(gRemoteId)); + chip::Crypto::DRBG_get_bytes(reinterpret_cast(&gRemoteId), sizeof(gRemoteId)); } while (!chip::IsOperationalNodeId(gRemoteId)); ESP_RETURN_ON_FALSE(instance.get_commissioner()->PairDevice(gRemoteId, params) == CHIP_NO_ERROR, ESP_FAIL, TAG, diff --git a/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp b/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp index 411fdb86c..9dc1b490c 100644 --- a/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp +++ b/components/esp_matter_controller/logger/zap-generated/DataModelLogger.cpp @@ -2517,7 +2517,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("SlotIsPauseable", indent + 1, value.slotIsPauseable); + CHIP_ERROR err = LogValue("SlotIsPauseable", indent + 1, value.slotIsPausable); if (err != CHIP_NO_ERROR) { DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'SlotIsPauseable'"); @@ -2631,7 +2631,7 @@ DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("ForecastId", indent + 1, value.forecastId); + CHIP_ERROR err = LogValue("ForecastId", indent + 1, value.forecastID); if (err != CHIP_NO_ERROR) { DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ForecastId'"); @@ -2679,7 +2679,7 @@ DataModelLogger::LogValue(const char * label, size_t indent, } } { - CHIP_ERROR err = LogValue("IsPauseable", indent + 1, value.isPauseable); + CHIP_ERROR err = LogValue("IsPauseable", indent + 1, value.isPausable); if (err != CHIP_NO_ERROR) { DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'IsPauseable'"); diff --git a/components/esp_matter_thread_br/esp_matter_thread_br_cluster.cpp b/components/esp_matter_thread_br/esp_matter_thread_br_cluster.cpp index 77f24d695..76254ccc2 100644 --- a/components/esp_matter_thread_br/esp_matter_thread_br_cluster.cpp +++ b/components/esp_matter_thread_br/esp_matter_thread_br_cluster.cpp @@ -18,6 +18,9 @@ #include #include +#include +#include +#include #define TAG "thread_br_custom_cluster" @@ -80,7 +83,6 @@ namespace command { static esp_err_t configure_dataset_tlvs_command_callback(const ConcreteCommandPath &command_path, TLVReader &tlv_data, void *opaque_ptr) { - uint16_t endpoint_id = command_path.mEndpointId; uint32_t cluster_id = command_path.mClusterId; uint32_t command_id = command_path.mCommandId; diff --git a/connectedhomeip/connectedhomeip b/connectedhomeip/connectedhomeip index d83caf7fe..046071558 160000 --- a/connectedhomeip/connectedhomeip +++ b/connectedhomeip/connectedhomeip @@ -1 +1 @@ -Subproject commit d83caf7fefeaa91ebc549863552050311abe46ae +Subproject commit 0460715589413cb32e32f1626e43ad8000b84f2d diff --git a/examples/common/blemesh_platform/platform/ESP32_custom/nimble/BLEManagerImpl.cpp b/examples/common/blemesh_platform/platform/ESP32_custom/nimble/BLEManagerImpl.cpp index 675cbb8af..b8bf038c9 100644 --- a/examples/common/blemesh_platform/platform/ESP32_custom/nimble/BLEManagerImpl.cpp +++ b/examples/common/blemesh_platform/platform/ESP32_custom/nimble/BLEManagerImpl.cpp @@ -92,7 +92,6 @@ namespace Internal { namespace { -TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. #if CONFIG_ENABLE_ESP32_BLE_CONTROLLER static constexpr uint16_t kNewConnectionScanTimeout = 60; static constexpr uint16_t kConnectTimeout = 20; @@ -228,16 +227,6 @@ CHIP_ERROR BLEManagerImpl::_Init() { CHIP_ERROR err; - // Create FreeRTOS sw timer for BLE timeouts and interval change. - sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer", // Just a text name, not used by the RTOS kernel - 1, // == default timer period - false, // no timer reload (==one-shot) - (void *) this, // init timer id = ble obj context - BleAdvTimeoutHandler // timer callback handler - ); - - VerifyOrReturnError(sbleAdvTimeoutTimer != nullptr, CHIP_ERROR_NO_MEMORY); - // Initialize the Chip BleLayer. #if CONFIG_ENABLE_ESP32_BLE_CONTROLLER err = BleLayer::Init(this, this, this, &DeviceLayer::SystemLayer()); @@ -273,9 +262,7 @@ exit: void BLEManagerImpl::_Shutdown() { - VerifyOrReturn(sbleAdvTimeoutTimer != nullptr); - xTimerDelete(sbleAdvTimeoutTimer, portMAX_DELAY); - sbleAdvTimeoutTimer = nullptr; + CancelBleAdvTimeoutTimer(); BleLayer::Shutdown(); @@ -310,7 +297,7 @@ exit: return err; } -void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer) +void BLEManagerImpl::BleAdvTimeoutHandler(System::Layer *, void *) { if (BLEMgrImpl().mFlags.Has(Flags::kFastAdvertisingEnabled)) { @@ -322,7 +309,6 @@ void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer) BLEMgrImpl().mFlags.Clear(Flags::kExtAdvertisingEnabled); BLEMgrImpl().StartBleAdvTimeoutTimer(CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING_INTERVAL_CHANGE_TIME_MS); #endif - PlatformMgr().ScheduleWork(DriveBLEState, 0); } #if CHIP_DEVICE_CONFIG_BLE_EXT_ADVERTISING else @@ -332,9 +318,9 @@ void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer) BLEMgrImpl().mFlags.Set(Flags::kExtAdvertisingEnabled); BLEMgr().SetAdvertisingMode(BLEAdvertisingMode::kSlowAdvertising); BLEMgrImpl().mFlags.Set(Flags::kAdvertisingRefreshNeeded, 1); - PlatformMgr().ScheduleWork(DriveBLEState, 0); } #endif + PlatformMgr().ScheduleWork(DriveBLEState, 0); } CHIP_ERROR BLEManagerImpl::_SetAdvertisingMode(BLEAdvertisingMode mode) @@ -628,7 +614,7 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU ESP_LOGD(TAG, "Sending indication for CHIPoBLE TX characteristic (con %u, len %u)", conId, data->DataLength()); - om = ble_hs_mbuf_from_flat(data->Start(), data->DataLength()); + om = ble_hs_mbuf_from_flat(data->Start(), static_cast(data->DataLength())); if (om == NULL) { ChipLogError(DeviceLayer, "ble_hs_mbuf_from_flat failed:"); @@ -698,20 +684,6 @@ bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBle #endif } -bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, - chip::System::PacketBufferHandle pBuf) -{ - ChipLogError(DeviceLayer, "BLEManagerImpl::SendReadRequest() not supported"); - return false; -} - -bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, - const ChipBleUUID * svcId, const ChipBleUUID * charId) -{ - ChipLogError(DeviceLayer, "BLEManagerImpl::SendReadResponse() not supported"); - return false; -} - void BLEManagerImpl::NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) {} CHIP_ERROR BLEManagerImpl::MapBLEError(int bleErr) @@ -745,26 +717,17 @@ CHIP_ERROR BLEManagerImpl::MapBLEError(int bleErr) } void BLEManagerImpl::CancelBleAdvTimeoutTimer(void) { - VerifyOrReturn(sbleAdvTimeoutTimer != nullptr); - - if (xTimerStop(sbleAdvTimeoutTimer, pdMS_TO_TICKS(0)) == pdFAIL) + if (SystemLayer().IsTimerActive(BleAdvTimeoutHandler, nullptr)) { - ChipLogError(DeviceLayer, "Failed to stop BledAdv timeout timer"); + SystemLayer().CancelTimer(BleAdvTimeoutHandler, nullptr); } } void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs) { - VerifyOrReturn(sbleAdvTimeoutTimer != nullptr); + CancelBleAdvTimeoutTimer(); - if (xTimerIsTimerActive(sbleAdvTimeoutTimer)) - { - CancelBleAdvTimeoutTimer(); - } - - // timer is not active, change its period to required value (== restart). - // FreeRTOS- Block for a maximum of 100 ticks if the change period command - // cannot immediately be sent to the timer command queue. - if (xTimerChangePeriod(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), pdMS_TO_TICKS(100)) != pdPASS) + CHIP_ERROR err = SystemLayer().StartTimer(System::Clock::Milliseconds32(aTimeoutInMs), BleAdvTimeoutHandler, nullptr); + if ((err != CHIP_NO_ERROR)) { ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer"); } diff --git a/examples/common/cmake_common/components_include.cmake b/examples/common/cmake_common/components_include.cmake index eb8593ad6..9c86ddd6e 100644 --- a/examples/common/cmake_common/components_include.cmake +++ b/examples/common/cmake_common/components_include.cmake @@ -24,6 +24,11 @@ if(IDF_TARGET STREQUAL "esp32c2") endif() endif() +get_filename_component(SDKCONFIG_SHELL_IDF_VER "${SDKCONFIG_COMMON_DIR}.shell.v4.4" ABSOLUTE) +if(EXISTS ${SDKCONFIG_SHELL_IDF_VER} AND ${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} STRLESS "5.0.0") + list(APPEND SDKCONFIG_FILES "${SDKCONFIG_SHELL_IDF_VER}") +endif() + # setting the final sdkconfig path message(SDKCONFIG_PATH ": ${SDKCONFIG_FILES}") list(APPEND SDKCONFIG_DEFAULTS ${SDKCONFIG_FILES}) diff --git a/examples/light/sdkconfig.defaults.shell.v4.4 b/examples/light/sdkconfig.defaults.shell.v4.4 new file mode 100644 index 000000000..e54ac03b6 --- /dev/null +++ b/examples/light/sdkconfig.defaults.shell.v4.4 @@ -0,0 +1 @@ +CONFIG_ENABLE_CHIP_SHELL=n diff --git a/tools/docker/chip_idf/Dockerfile b/tools/docker/chip_idf/Dockerfile index e1a98ad50..371d658ec 100644 --- a/tools/docker/chip_idf/Dockerfile +++ b/tools/docker/chip_idf/Dockerfile @@ -53,3 +53,7 @@ RUN set -x \ && bash -c "source scripts/bootstrap.sh" \ && ./scripts/examples/gn_build_example.sh examples/chip-tool out/host \ && : # last line + +COPY entrypoint.sh /opt/espressif//entrypoint.sh +ENTRYPOINT [ "/opt/espressif/entrypoint.sh" ] +CMD [ "/bin/bash" ] diff --git a/tools/docker/chip_idf/entrypoint.sh b/tools/docker/chip_idf/entrypoint.sh new file mode 100755 index 000000000..8a7ac8e1f --- /dev/null +++ b/tools/docker/chip_idf/entrypoint.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e + +source $IDF_PATH/export.sh + +exec "$@"