From b46af33aafcbcf851fe14ae138148a09be1aa591 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 00:33:16 -0500 Subject: [PATCH 01/30] Replace legacy cluster id constants with namespaced ones. (#23833) Large parts of this were generated by running: perl -pi -e 'BEGIN { sub recombine { my ($str) = @_; my @split = split /_/,$str; return join("", map { ucfirst lc $_ } @split); } } s/ZCL_([A-Z_]*)_CLUSTER_ID/"app::Clusters::".recombine($1)."::Id"/e' on various files. --- .../ameba/main/DeviceCallbacks.cpp | 6 +- .../cc13x2x7_26x2x7/main/ClusterManager.cpp | 1 - .../cc13x2x7_26x2x7/main/ZclCallbacks.cpp | 1 - .../esp32/main/DeviceCallbacks.cpp | 6 +- .../esp32/main/DeviceWithDisplay.cpp | 3 +- .../esp32/main/include/DeviceWithDisplay.h | 1 - .../infineon/psoc6/src/AppTask.cpp | 4 +- .../infineon/psoc6/src/ClusterManager.cpp | 1 - .../infineon/psoc6/src/ZclCallbacks.cpp | 1 - .../nrfconnect/main/AppTask.cpp | 1 - examples/all-clusters-app/nxp/mw320/main.cpp | 20 +- .../all-clusters-app/telink/src/AppTask.cpp | 1 - .../ameba/main/DeviceCallbacks.cpp | 6 +- .../cc13x2x7_26x2x7/main/ClusterManager.cpp | 1 - .../cc13x2x7_26x2x7/main/ZclCallbacks.cpp | 1 - .../esp32/main/DeviceCallbacks.cpp | 6 +- .../esp32/main/DeviceWithDisplay.cpp | 3 +- .../esp32/main/include/DeviceWithDisplay.h | 1 - .../infineon/psoc6/src/AppTask.cpp | 4 +- .../infineon/psoc6/src/ClusterManager.cpp | 1 - .../infineon/psoc6/src/ZclCallbacks.cpp | 1 - .../nrfconnect/main/AppTask.cpp | 1 - .../telink/src/AppTask.cpp | 1 - examples/bridge-app/esp32/main/main.cpp | 15 +- examples/bridge-app/linux/main.cpp | 33 ++- examples/chef/ameba/main/DeviceCallbacks.cpp | 6 +- examples/chef/common/stubs.cpp | 1 - examples/chef/efr32/src/AppTask.cpp | 1 - examples/chef/esp32/main/main.cpp | 1 - .../common/pigweed/rpc_services/Attributes.h | 1 - .../common/pigweed/rpc_services/Lighting.h | 20 +- .../nxp/k32w/k32w0/main/AppTask.cpp | 7 +- .../linux/DynamicDevice.cpp | 4 +- .../dynamic-bridge-app/linux/bridge_service.h | 1 - examples/dynamic-bridge-app/linux/main.cpp | 1 - .../ameba/main/DeviceCallbacks.cpp | 1 - .../light-switch-app/efr32/src/AppTask.cpp | 1 - .../light-switch-app/genio/src/AppTask.cpp | 1 - .../light-switch-app/telink/src/AppTask.cpp | 1 - .../ameba/main/CHIPDeviceManager.cpp | 18 +- .../ameba/main/DeviceCallbacks.cpp | 4 +- .../beken/main/DeviceCallbacks.cpp | 6 +- .../bouffalolab/common/AppTask.cpp | 29 ++- examples/lighting-app/esp32/main/AppTask.cpp | 1 - examples/lighting-app/genio/src/AppTask.cpp | 1 - .../infineon/cyw30739/src/LightingManager.cpp | 1 - .../infineon/psoc6/src/AppTask.cpp | 6 +- examples/lighting-app/mbed/main/AppTask.cpp | 6 +- .../lighting-app/nrfconnect/main/AppTask.cpp | 1 - .../nxp/k32w/k32w0/main/AppTask.cpp | 8 +- examples/lighting-app/qpg/src/AppTask.cpp | 1 - .../silabs/SiWx917/src/AppTask.cpp | 1 - .../lighting-app/silabs/efr32/src/AppTask.cpp | 1 - examples/lighting-app/telink/src/AppTask.cpp | 1 - examples/lock-app/cc32xx/main/AppTask.cpp | 4 +- examples/lock-app/efr32/src/AppTask.cpp | 1 - examples/lock-app/esp32/main/AppTask.cpp | 6 +- .../lock-app/esp32/main/DeviceCallbacks.cpp | 4 +- examples/lock-app/genio/src/AppTask.cpp | 1 - .../lock-app/infineon/psoc6/src/AppTask.cpp | 1 - examples/lock-app/mbed/main/AppTask.cpp | 4 +- examples/lock-app/nrfconnect/main/AppTask.cpp | 1 - .../lock-app/nxp/k32w/k32w0/main/AppTask.cpp | 6 +- examples/lock-app/qpg/src/AppTask.cpp | 1 - .../ameba/main/DeviceCallbacks.cpp | 6 +- .../ota-requestor-app/telink/src/AppTask.cpp | 1 - .../beken/common/CommonDeviceCallbacks.cpp | 1 - .../esp32/common/CommonDeviceCallbacks.cpp | 1 - .../silabs/SiWx917/BaseApplication.cpp | 1 - .../platform/silabs/efr32/BaseApplication.cpp | 1 - .../cc13x2x7_26x2x7/main/DeviceCallbacks.cpp | 1 - examples/pump-app/nrfconnect/main/AppTask.cpp | 1 - .../nrfconnect/main/AppTask.cpp | 1 - .../shell/nxp/k32w/k32w0/main/AppTask.cpp | 1 - examples/thermostat/efr32/src/AppTask.cpp | 1 - examples/thermostat/genio/src/AppTask.cpp | 1 - examples/thermostat/telink/src/AppTask.cpp | 1 - .../tv-app/android/include/cluster-init.cpp | 1 - examples/tv-app/android/java/AppImpl.cpp | 19 +- .../tv-app/android/java/DeviceCallbacks.cpp | 1 - examples/tv-app/linux/AppImpl.cpp | 19 +- .../tv-app/linux/include/cluster-init.cpp | 1 - .../include/level-control/LevelControl.cpp | 6 +- .../window-app/nrfconnect/main/AppTask.cpp | 1 - .../bridge/BridgeClustersGlobalStructs.jinja | 1 - .../bridge/BridgeClustersHeader.jinja | 1 - .../cpp/application/CallbackStubSource.jinja | 4 +- .../bridge/BridgeGlobalStructs.h | 1 - .../bridge/BridgeGlobalStructs.h | 1 - .../cpp-app/callback-stub.cpp | 130 +++++----- .../cpp-app/callback-stub.cpp | 56 ++--- .../bridge/BridgeGlobalStructs.h | 1 - .../cpp-app/callback-stub.cpp | 8 +- .../bridge/BridgeGlobalStructs.h | 1 - src/app/app-platform/ContentApp.cpp | 2 - src/app/app-platform/ContentAppPlatform.cpp | 2 - .../diagnostic-logs-server.cpp | 1 - .../diagnostic-logs-server.h | 1 - .../door-lock-server-callback.cpp | 1 - .../door-lock-server/door-lock-server.cpp | 2 +- .../group-key-mgmt-server.cpp | 1 - .../clusters/groups-server/groups-server.cpp | 2 +- .../ias-zone-client/ias-zone-client.cpp | 15 +- .../ias-zone-server/ias-zone-server.cpp | 39 ++- .../identify-server/identify-server.cpp | 1 - src/app/clusters/scenes/scenes.cpp | 204 ++++++++------- .../thermostat-server/thermostat-server.cpp | 1 - ...at-user-interface-configuration-server.cpp | 1 - .../window-covering-server.cpp | 1 - src/app/common/templates/templates.json | 5 - src/app/util/generic-callback-stubs.cpp | 2 +- src/app/util/util.cpp | 12 +- src/app/util/util.h | 2 - .../templates/app/print-cluster.zapt | 4 +- .../app-common/zap-generated/cluster-id.h | 236 ------------------ .../app-common/zap-generated/print-cluster.h | 150 +++++------ 116 files changed, 459 insertions(+), 777 deletions(-) delete mode 100644 zzz_generated/app-common/app-common/zap-generated/cluster-id.h diff --git a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp index 028dc7ca2a6370..4817cfb5f99e03 100644 --- a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp @@ -26,7 +26,7 @@ #include "DeviceCallbacks.h" #include "CHIPDeviceManager.h" #include -#include +#include #include #include #include @@ -91,11 +91,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { switch (clusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp index 40661af8cd7c7d..1a07e18c72c3de 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ClusterManager.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index 0524dc7578fd23..4d14d56f8f0d6f 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -28,7 +28,6 @@ #include "ClusterManager.h" #include -#include #include #include #include diff --git a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp index 52d632f7fa5afa..82917c28ef26b5 100644 --- a/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp @@ -37,7 +37,7 @@ #include #if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM -#include +#include #endif static const char * TAG = "app-devicecallbacks"; @@ -165,13 +165,13 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { hue = *value; - emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &saturation, sizeof(uint8_t)); } else { saturation = *value; - emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, + emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, sizeof(uint8_t)); } statusLED1.SetColor(hue, saturation); diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp index d413072f671db1..967431efa8fc5f 100644 --- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp @@ -18,6 +18,7 @@ #include "DeviceWithDisplay.h" #include +#include #include #if CONFIG_HAVE_DISPLAY @@ -322,7 +323,7 @@ class EditAttributeListModel : public TouchesMatterStackModel { value = (value == "On") ? "Off" : "On"; uint8_t attributeValue = (value == "On") ? 1 : 0; - emberAfWriteServerAttribute(endpointIndex + 1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, + emberAfWriteServerAttribute(endpointIndex + 1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &attributeValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } diff --git a/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h b/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h index 99e53e9be9dc4f..7a283fe7546ef5 100644 --- a/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h +++ b/examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp index 54cc0a74a29635..4c871b546bacd5 100644 --- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -409,7 +409,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context) // write the new on/off value EmberAfStatus status = - emberAfWriteServerAttribute(2, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + emberAfWriteServerAttribute(2, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { diff --git a/examples/all-clusters-app/infineon/psoc6/src/ClusterManager.cpp b/examples/all-clusters-app/infineon/psoc6/src/ClusterManager.cpp index 4d550f8c4fdaf8..a3ae6a44190c75 100644 --- a/examples/all-clusters-app/infineon/psoc6/src/ClusterManager.cpp +++ b/examples/all-clusters-app/infineon/psoc6/src/ClusterManager.cpp @@ -26,7 +26,6 @@ #include "LEDWidget.h" #include #include -#include #include #include #include diff --git a/examples/all-clusters-app/infineon/psoc6/src/ZclCallbacks.cpp b/examples/all-clusters-app/infineon/psoc6/src/ZclCallbacks.cpp index 32ba951b52cfc6..f3fd7cf6689a70 100644 --- a/examples/all-clusters-app/infineon/psoc6/src/ZclCallbacks.cpp +++ b/examples/all-clusters-app/infineon/psoc6/src/ZclCallbacks.cpp @@ -27,7 +27,6 @@ #include "ClusterManager.h" #include -#include #include #include #include diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index f8646a19f7bd94..b42b7b41ccd8ad 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/examples/all-clusters-app/nxp/mw320/main.cpp b/examples/all-clusters-app/nxp/mw320/main.cpp index 6f865b9c4fb75e..a7f6478b1af9f7 100644 --- a/examples/all-clusters-app/nxp/mw320/main.cpp +++ b/examples/all-clusters-app/nxp/mw320/main.cpp @@ -30,7 +30,7 @@ //#include //==> rm from TE7.5 #include -#include +#include #include #include #include @@ -288,7 +288,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI { PRINTF("====> emberAfExternalAttributeReadCallback\r\n"); - if(clusterId == ZCL_SWITCH_CLUSTER_ID) { + if(clusterId == Clusters::Switch::Id) { *buffer = g_ButtonPress; } return EMBER_ZCL_STATUS_SUCCESS; @@ -1144,12 +1144,12 @@ void task_test_main(void * param) value = (uint16_t) is_on; // sync-up the switch attribute: PRINTF("--> update ZCL_CURRENT_POSITION_ATTRIBUTE_ID [%d] \r\n", value); - emAfWriteAttribute(1, ZCL_SWITCH_CLUSTER_ID, ZCL_CURRENT_POSITION_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, + emAfWriteAttribute(1, Clusters::Switch::Id, ZCL_CURRENT_POSITION_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false); #ifdef SUPPORT_MANUAL_CTRL // sync-up the Light attribute (for test event, OO.M.ManuallyControlled) - PRINTF("--> update [ZCL_ON_OFF_CLUSTER_ID]: ZCL_ON_OFF_ATTRIBUTE_ID [%d] \r\n", value); - emAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false); + PRINTF("--> update [Clusters::Switch::Id]: ZCL_ON_OFF_ATTRIBUTE_ID [%d] \r\n", value); + emAfWriteAttribute(1, Clusters::Switch::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false); #endif // SUPPORT_MANUAL_CTRL need2sync_sw_attr = false; @@ -1529,7 +1529,7 @@ static void OnSwitchAttributeChangeCallback(EndpointId endpointId, AttributeId a } } if (do_sendrpt == true) { - ConcreteEventPath event_path(endpointId, ZCL_SWITCH_CLUSTER_ID, 0); + ConcreteEventPath event_path(endpointId, Clusters::Switch::Id, 0); pimEngine->GetReportingEngine().ScheduleEventDelivery(event_path, chip::app::EventOptions::Type::kUrgent, sizeof(uint16_t)); } @@ -1554,7 +1554,7 @@ void IdentifyTimerHandler(System::Layer * systemLayer, void * appState) if (pidt->identifyTimerCount) { pidt->identifyTimerCount--; - emAfWriteAttribute(pidt->ep, ZCL_IDENTIFY_CLUSTER_ID, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &pidt->identifyTimerCount, + emAfWriteAttribute(pidt->ep, Clusters::Identify::Id, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &pidt->identifyTimerCount, sizeof(identifyTimerCount), true, false); DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), IdentifyTimerHandler, pidt); } @@ -1587,16 +1587,16 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & // path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value switch (path.mClusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value); break; - case ZCL_SWITCH_CLUSTER_ID: + case Clusters::Switch::Id: OnSwitchAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value); // SwitchToggleOnOff(); // Trigger to send on/off/toggle command to the bound devices chip::BindingManager::GetInstance().NotifyBoundClusterChanged(1, chip::app::Clusters::OnOff::Id, nullptr); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value); break; default: diff --git a/examples/all-clusters-app/telink/src/AppTask.cpp b/examples/all-clusters-app/telink/src/AppTask.cpp index f0daf281889d5f..f00236e08ff707 100644 --- a/examples/all-clusters-app/telink/src/AppTask.cpp +++ b/examples/all-clusters-app/telink/src/AppTask.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include diff --git a/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp index 502057c88ae215..f4a7ab2d076c2f 100644 --- a/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp @@ -26,7 +26,7 @@ #include "CHIPDeviceManager.h" #include -#include +#include #include #include #include @@ -79,11 +79,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { switch (clusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ClusterManager.cpp b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ClusterManager.cpp index 40661af8cd7c7d..1a07e18c72c3de 100644 --- a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ClusterManager.cpp +++ b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ClusterManager.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp index 0524dc7578fd23..4d14d56f8f0d6f 100644 --- a/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp +++ b/examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp @@ -28,7 +28,6 @@ #include "ClusterManager.h" #include -#include #include #include #include diff --git a/examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp index 52d632f7fa5afa..82917c28ef26b5 100644 --- a/examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/DeviceCallbacks.cpp @@ -37,7 +37,7 @@ #include #if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM -#include +#include #endif static const char * TAG = "app-devicecallbacks"; @@ -165,13 +165,13 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { hue = *value; - emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &saturation, sizeof(uint8_t)); } else { saturation = *value; - emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, + emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, sizeof(uint8_t)); } statusLED1.SetColor(hue, saturation); diff --git a/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp index 9557c97851d08e..9146fe465e12e9 100644 --- a/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp @@ -17,6 +17,7 @@ */ #include "DeviceWithDisplay.h" +#include #include #if CONFIG_HAVE_DISPLAY @@ -232,7 +233,7 @@ class EditAttributeListModel : public TouchesMatterStackModel { value = (value == "On") ? "Off" : "On"; uint8_t attributeValue = (value == "On") ? 1 : 0; - emberAfWriteServerAttribute(endpointIndex + 1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, + emberAfWriteServerAttribute(endpointIndex + 1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &attributeValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } diff --git a/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h b/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h index 99e53e9be9dc4f..7a283fe7546ef5 100644 --- a/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h +++ b/examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp index a6d17539331230..35af6870006185 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -409,7 +409,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context) // write the new on/off value EmberAfStatus status = - emberAfWriteServerAttribute(2, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + emberAfWriteServerAttribute(2, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/ClusterManager.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/ClusterManager.cpp index 4d550f8c4fdaf8..a3ae6a44190c75 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/src/ClusterManager.cpp +++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/ClusterManager.cpp @@ -26,7 +26,6 @@ #include "LEDWidget.h" #include #include -#include #include #include #include diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/ZclCallbacks.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/ZclCallbacks.cpp index 32ba951b52cfc6..f3fd7cf6689a70 100644 --- a/examples/all-clusters-minimal-app/infineon/psoc6/src/ZclCallbacks.cpp +++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/ZclCallbacks.cpp @@ -27,7 +27,6 @@ #include "ClusterManager.h" #include -#include #include #include #include diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp index 25c4190544a18a..a2a149a9e01d50 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/examples/all-clusters-minimal-app/telink/src/AppTask.cpp b/examples/all-clusters-minimal-app/telink/src/AppTask.cpp index a08d81bf5b1a39..e6c684c5ff85b1 100644 --- a/examples/all-clusters-minimal-app/telink/src/AppTask.cpp +++ b/examples/all-clusters-minimal-app/telink/src/AppTask.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp index fe3cb2e9da11fc..dd06b095a17cf7 100644 --- a/examples/bridge-app/esp32/main/main.cpp +++ b/examples/bridge-app/esp32/main/main.cpp @@ -21,7 +21,7 @@ #include "nvs_flash.h" #include #include -#include +#include #include #include #include @@ -136,10 +136,9 @@ constexpr CommandId onOffIncomingCommands[] = { }; DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedLightClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_ON_OFF_CLUSTER_ID, onOffAttrs, onOffIncomingCommands, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr, - nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END; +DECLARE_DYNAMIC_CLUSTER(OnOff::Id, onOffAttrs, onOffIncomingCommands, nullptr), + DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END; // Declare Bridged Light endpoint DECLARE_DYNAMIC_ENDPOINT(bridgedLightEndpoint, bridgedLightClusters); @@ -278,11 +277,11 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI { Device * dev = gDevices[endpointIndex]; - if (clusterId == ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID) + if (clusterId == BridgedDeviceBasic::Id) { return HandleReadBridgedDeviceBasicAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength); } - else if (clusterId == ZCL_ON_OFF_CLUSTER_ID) + else if (clusterId == OnOff::Id) { return HandleReadOnOffAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength); } @@ -300,7 +299,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster { Device * dev = gDevices[endpointIndex]; - if ((dev->IsReachable()) && (clusterId == ZCL_ON_OFF_CLUSTER_ID)) + if ((dev->IsReachable()) && (clusterId == OnOff::Id)) { return HandleWriteOnOffAttribute(dev, attributeMetadata->attributeId, buffer); } diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index a1b54c5101f73f..22dbeb1ac9f522 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include @@ -142,10 +142,9 @@ constexpr CommandId onOffIncomingCommands[] = { }; DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedLightClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_ON_OFF_CLUSTER_ID, onOffAttrs, onOffIncomingCommands, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr, - nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END; +DECLARE_DYNAMIC_CLUSTER(OnOff::Id, onOffAttrs, onOffIncomingCommands, nullptr), + DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END; // Declare Bridged Light endpoint DECLARE_DYNAMIC_ENDPOINT(bridgedLightEndpoint, bridgedLightClusters); @@ -196,9 +195,9 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_POWER_SOURCE_BAT_CHARGE_LEVEL_ATTRIBUTE_ID, ENUM8, DECLARE_DYNAMIC_ATTRIBUTE(ZCL_POWER_SOURCE_DESCRIPTION_ATTRIBUTE_ID, CHAR_STRING, 32, 0), DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedPowerSourceClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_POWER_SOURCE_CLUSTER_ID, powerSourceAttrs, nullptr, nullptr), DECLARE_DYNAMIC_CLUSTER_LIST_END; +DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(PowerSource::Id, powerSourceAttrs, nullptr, nullptr), DECLARE_DYNAMIC_CLUSTER_LIST_END; DECLARE_DYNAMIC_ENDPOINT(bridgedPowerSourceEndpoint, bridgedPowerSourceClusters); @@ -216,10 +215,9 @@ DECLARE_DYNAMIC_ATTRIBUTE(ZCL_TEMP_MEASURED_VALUE_ATTRIBUTE_ID, INT16S, 2, 0), // - Descriptor // - Bridged Device Basic DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedTempSensorClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_TEMPERATURE_MEASUREMENT_CLUSTER_ID, tempSensorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER_LIST_END; +DECLARE_DYNAMIC_CLUSTER(TemperatureMeasurement::Id, tempSensorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr), DECLARE_DYNAMIC_CLUSTER_LIST_END; // Declare Bridged Light endpoint DECLARE_DYNAMIC_ENDPOINT(bridgedTempSensorEndpoint, bridgedTempSensorClusters); @@ -234,9 +232,8 @@ DataVersion gTempSensor2DataVersions[ArraySize(bridgedTempSensorClusters)]; // Composed Device Configuration DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedComposedDeviceClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER_LIST_END; +DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr), DECLARE_DYNAMIC_CLUSTER_LIST_END; DECLARE_DYNAMIC_ENDPOINT(bridgedComposedDeviceEndpoint, bridgedComposedDeviceClusters); DataVersion gComposedDeviceDataVersions[ArraySize(bridgedComposedDeviceClusters)]; @@ -602,11 +599,11 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI { Device * dev = gDevices[endpointIndex]; - if (clusterId == ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID) + if (clusterId == BridgedDeviceBasic::Id) { ret = HandleReadBridgedDeviceBasicAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength); } - else if (clusterId == ZCL_ON_OFF_CLUSTER_ID) + else if (clusterId == OnOff::Id) { ret = HandleReadOnOffAttribute(static_cast(dev), attributeMetadata->attributeId, buffer, maxReadLength); } @@ -638,7 +635,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster { Device * dev = gDevices[endpointIndex]; - if ((dev->IsReachable()) && (clusterId == ZCL_ON_OFF_CLUSTER_ID)) + if ((dev->IsReachable()) && (clusterId == OnOff::Id)) { ret = HandleWriteOnOffAttribute(static_cast(dev), attributeMetadata->attributeId, buffer); } diff --git a/examples/chef/ameba/main/DeviceCallbacks.cpp b/examples/chef/ameba/main/DeviceCallbacks.cpp index 259ff3d726f529..8e6b1192b96dd8 100644 --- a/examples/chef/ameba/main/DeviceCallbacks.cpp +++ b/examples/chef/ameba/main/DeviceCallbacks.cpp @@ -26,7 +26,7 @@ #include "CHIPDeviceManager.h" #include -#include +#include #include #include #include @@ -90,11 +90,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { switch (clusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index 7672a41ea9904d..f170d306ff9ff3 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include // Include door lock callbacks only when the server is enabled diff --git a/examples/chef/efr32/src/AppTask.cpp b/examples/chef/efr32/src/AppTask.cpp index 0eb2b9ec492268..3de9bff17a49f9 100644 --- a/examples/chef/efr32/src/AppTask.cpp +++ b/examples/chef/efr32/src/AppTask.cpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/examples/chef/esp32/main/main.cpp b/examples/chef/esp32/main/main.cpp index e5db9238832af0..225815f8043b70 100644 --- a/examples/chef/esp32/main/main.cpp +++ b/examples/chef/esp32/main/main.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/common/pigweed/rpc_services/Attributes.h b/examples/common/pigweed/rpc_services/Attributes.h index 298df264a682ec..abc9dd1268b6fa 100644 --- a/examples/common/pigweed/rpc_services/Attributes.h +++ b/examples/common/pigweed/rpc_services/Attributes.h @@ -23,7 +23,6 @@ #include "pigweed/rpc_services/internal/StatusUtils.h" #include #include -#include #include #include #include diff --git a/examples/common/pigweed/rpc_services/Lighting.h b/examples/common/pigweed/rpc_services/Lighting.h index e8a96c6f4bdec3..533267a54c59bd 100644 --- a/examples/common/pigweed/rpc_services/Lighting.h +++ b/examples/common/pigweed/rpc_services/Lighting.h @@ -23,7 +23,7 @@ #include "pigweed/rpc_services/internal/StatusUtils.h" #include #include -#include +#include #include namespace chip { @@ -42,12 +42,12 @@ class Lighting : public pw_rpc::nanopb::Lighting::Service uint8_t on = request.on; RETURN_STATUS_IF_NOT_OK( - emberAfWriteServerAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &on, ZCL_BOOLEAN_ATTRIBUTE_ID)); + emberAfWriteServerAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &on, ZCL_BOOLEAN_ATTRIBUTE_ID)); if (mSupportLevel && request.has_level) { // Clip level to max uint8_t level = std::min(request.level, static_cast(std::numeric_limits::max())); - RETURN_STATUS_IF_NOT_OK(emberAfWriteServerAttribute(kEndpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, + RETURN_STATUS_IF_NOT_OK(emberAfWriteServerAttribute(kEndpoint, app::Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, &level, ZCL_INT8U_ATTRIBUTE_TYPE)); } @@ -58,8 +58,8 @@ class Lighting : public pw_rpc::nanopb::Lighting::Service uint8_t hue = std::min(request.color.hue, kColorMax); uint8_t saturation = std::min(request.color.saturation, kColorMax); RETURN_STATUS_IF_NOT_OK(emberAfWriteServerAttribute( - 1, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, ZCL_INT8U_ATTRIBUTE_TYPE)); - RETURN_STATUS_IF_NOT_OK(emberAfWriteServerAttribute(kEndpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, + 1, app::Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, ZCL_INT8U_ATTRIBUTE_TYPE)); + RETURN_STATUS_IF_NOT_OK(emberAfWriteServerAttribute(kEndpoint, app::Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &saturation, ZCL_INT8U_ATTRIBUTE_TYPE)); } @@ -74,22 +74,22 @@ class Lighting : public pw_rpc::nanopb::Lighting::Service uint8_t level; uint8_t hue; uint8_t saturation; - RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &on, sizeof(on))); + RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &on, sizeof(on))); response.on = on; if (mSupportLevel) { - RETURN_STATUS_IF_NOT_OK( - emberAfReadServerAttribute(1, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, &level, sizeof(level))); + RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(1, app::Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, + &level, sizeof(level))); response.level = level; response.has_level = true; } if (mSupportColor) { - RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(kEndpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, + RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(kEndpoint, app::Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, sizeof(hue))); - RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(kEndpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, + RETURN_STATUS_IF_NOT_OK(emberAfReadServerAttribute(kEndpoint, app::Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &saturation, sizeof(saturation))); response.color.hue = hue; diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp index 437573fc215cf1..ef070c33c64273 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include /* OTA related includes */ @@ -854,7 +854,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) uint8_t newValue = ContactSensorMgr().IsContactClosed(); // write the new on/off value - EmberAfStatus status = emberAfWriteAttribute(1, ZCL_BOOLEAN_STATE_CLUSTER_ID, ZCL_STATE_VALUE_ATTRIBUTE_ID, + EmberAfStatus status = emberAfWriteAttribute(1, app::Clusters::BooleanState::Id, ZCL_STATE_VALUE_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { @@ -873,7 +873,8 @@ void AppTask::UpdateDeviceStateInternal(intptr_t arg) bool stateValueAttrValue = 0; /* get onoff attribute value */ - (void) emberAfReadAttribute(1, ZCL_BOOLEAN_STATE_CLUSTER_ID, ZCL_STATE_VALUE_ATTRIBUTE_ID, (uint8_t *) &stateValueAttrValue, 1); + (void) emberAfReadAttribute(1, app::Clusters::BooleanState::Id, ZCL_STATE_VALUE_ATTRIBUTE_ID, (uint8_t *) &stateValueAttrValue, + 1); #if !cPWR_UsePowerDownMode /* set the device state */ sContactSensorLED.Set(stateValueAttrValue); diff --git a/examples/dynamic-bridge-app/linux/DynamicDevice.cpp b/examples/dynamic-bridge-app/linux/DynamicDevice.cpp index 9f0ca3951e8ce0..e9b99c94b0537a 100644 --- a/examples/dynamic-bridge-app/linux/DynamicDevice.cpp +++ b/examples/dynamic-bridge-app/linux/DynamicDevice.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include "DynamicDevice.h" @@ -55,7 +55,7 @@ Device DynamicDevice::CreateDevice() // Force a default descriptor cluster to be present. mClusterDecls.emplace_back( - EmberAfCluster DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr)); + EmberAfCluster DECLARE_DYNAMIC_CLUSTER(chip::app::Clusters::Descriptor::Id, descriptorAttrs, nullptr, nullptr)); return Device(chip::Span(mVersions.data(), mVersions.size()), chip::Span(mClusterDecls.data(), mClusterDecls.size()), diff --git a/examples/dynamic-bridge-app/linux/bridge_service.h b/examples/dynamic-bridge-app/linux/bridge_service.h index d2e05416a0a74f..faa744e7fba228 100644 --- a/examples/dynamic-bridge-app/linux/bridge_service.h +++ b/examples/dynamic-bridge-app/linux/bridge_service.h @@ -23,7 +23,6 @@ #include "pigweed/rpc_services/internal/StatusUtils.h" #include #include -#include #include namespace chip { diff --git a/examples/dynamic-bridge-app/linux/main.cpp b/examples/dynamic-bridge-app/linux/main.cpp index efb339582e3085..1c6ed2300771c7 100644 --- a/examples/dynamic-bridge-app/linux/main.cpp +++ b/examples/dynamic-bridge-app/linux/main.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp index f1776a46a71426..679faf925f5873 100644 --- a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp @@ -26,7 +26,6 @@ #include "CHIPDeviceManager.h" #include -#include #include #include #include diff --git a/examples/light-switch-app/efr32/src/AppTask.cpp b/examples/light-switch-app/efr32/src/AppTask.cpp index 3a3b2434b416dd..e1bbc8d782c888 100644 --- a/examples/light-switch-app/efr32/src/AppTask.cpp +++ b/examples/light-switch-app/efr32/src/AppTask.cpp @@ -40,7 +40,6 @@ #include #include -#include #include #include #include diff --git a/examples/light-switch-app/genio/src/AppTask.cpp b/examples/light-switch-app/genio/src/AppTask.cpp index 9f12f221846739..4fd88497239959 100644 --- a/examples/light-switch-app/genio/src/AppTask.cpp +++ b/examples/light-switch-app/genio/src/AppTask.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include diff --git a/examples/light-switch-app/telink/src/AppTask.cpp b/examples/light-switch-app/telink/src/AppTask.cpp index 7e1c792018b885..2bbd510217b7c3 100644 --- a/examples/light-switch-app/telink/src/AppTask.cpp +++ b/examples/light-switch-app/telink/src/AppTask.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp b/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp index c164e20609c497..951b4033e33077 100644 --- a/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp +++ b/examples/lighting-app/ameba/main/CHIPDeviceManager.cpp @@ -35,8 +35,8 @@ #include #include -#include #include +#include #include #include #include @@ -96,7 +96,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & ClusterId clusterId = attributePath.mClusterId; AttributeId attributeId = attributePath.mAttributeId; - if (clusterId == ZCL_ON_OFF_CLUSTER_ID) + if (clusterId == app::Clusters::OnOff::Id) { if (attributeId != ZCL_ON_OFF_ATTRIBUTE_ID) { @@ -106,7 +106,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & statusLED1.Set(*value); } - else if (clusterId == ZCL_LEVEL_CONTROL_CLUSTER_ID) + else if (clusterId == app::Clusters::LevelControl::Id) { if (attributeId != ZCL_CURRENT_LEVEL_ATTRIBUTE_ID) { @@ -122,7 +122,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & ChipLogError(Zcl, "wrong length for level: %d\n", size); } } - else if (clusterId == ZCL_COLOR_CONTROL_CLUSTER_ID) + else if (clusterId == app::Clusters::ColorControl::Id) { uint8_t hue, saturation; @@ -136,18 +136,18 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID) { hue = *value; - emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, - &saturation, sizeof(uint8_t)); + emberAfReadServerAttribute(endpointId, app::Clusters::ColorControl::Id, + ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &saturation, sizeof(uint8_t)); } if (attributeId == ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID) { saturation = *value; - emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, - sizeof(uint8_t)); + emberAfReadServerAttribute(endpointId, app::Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, + &hue, sizeof(uint8_t)); } ChipLogProgress(Zcl, "New hue: %d, New saturation: %d ", hue, saturation); } - else if (clusterId == ZCL_IDENTIFY_CLUSTER_ID) + else if (clusterId == app::Clusters::Identify::Id) { if (attributeId == ZCL_IDENTIFY_TIME_ATTRIBUTE_ID) { diff --git a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp index 5cf63d6ba41faa..d2f99168e97515 100644 --- a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp @@ -26,7 +26,7 @@ #include "CHIPDeviceManager.h" #include -#include +#include #include #include #include @@ -123,7 +123,7 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { switch (clusterId) { - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/lighting-app/beken/main/DeviceCallbacks.cpp b/examples/lighting-app/beken/main/DeviceCallbacks.cpp index ff9362486a08c0..52da67d1253ecf 100644 --- a/examples/lighting-app/beken/main/DeviceCallbacks.cpp +++ b/examples/lighting-app/beken/main/DeviceCallbacks.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -56,11 +56,11 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus { switch (clusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/lighting-app/bouffalolab/common/AppTask.cpp b/examples/lighting-app/bouffalolab/common/AppTask.cpp index d0e2e582c187ba..cae6be58e7dd75 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/common/AppTask.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -469,26 +469,25 @@ void AppTask::LightingUpdate(app_event_t event) do { if (EMBER_ZCL_STATUS_SUCCESS != - emberAfReadAttribute(endpoint, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, sizeof(onoff))) + emberAfReadAttribute(endpoint, Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, sizeof(onoff))) { break; } if (EMBER_ZCL_STATUS_SUCCESS != - emberAfReadAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, &v, sizeof(v))) + emberAfReadAttribute(endpoint, Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, &v, sizeof(v))) { break; } if (EMBER_ZCL_STATUS_SUCCESS != - emberAfReadAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, - sizeof(v))) + emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue, sizeof(v))) { break; } if (EMBER_ZCL_STATUS_SUCCESS != - emberAfReadAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &sat, + emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, &sat, sizeof(v))) { break; @@ -516,10 +515,10 @@ void AppTask::LightingSetOnoff(uint8_t bonoff) EndpointId endpoint = GetAppTask().GetEndpointId(); // write the new on/off value - emberAfWriteAttribute(endpoint, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, + emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); newValue = 254; - emberAfWriteAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, (uint8_t *) &newValue, + emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -531,20 +530,20 @@ void AppTask::LightingSetStatus(app_event_t status) if (APP_EVENT_SYS_LIGHT_TOGGLE == status) { - emberAfReadAttribute(endpoint, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &onoff, + emberAfReadAttribute(endpoint, Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); onoff = 1 - onoff; } else if (APP_EVENT_SYS_BLE_ADV == status) { hue = 35; - emberAfWriteAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, (uint8_t *) &hue, + emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, (uint8_t *) &hue, ZCL_INT8U_ATTRIBUTE_TYPE); sat = 254; - emberAfWriteAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, (uint8_t *) &sat, ZCL_INT8U_ATTRIBUTE_TYPE); level = 254; - emberAfWriteAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, (uint8_t *) &level, + emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, (uint8_t *) &level, ZCL_INT8U_ATTRIBUTE_TYPE); isProvisioned = false; @@ -557,14 +556,14 @@ void AppTask::LightingSetStatus(app_event_t status) } isProvisioned = true; sat = 0; - emberAfWriteAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + emberAfWriteAttribute(endpoint, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, (uint8_t *) &sat, ZCL_INT8U_ATTRIBUTE_TYPE); level = 254; - emberAfWriteAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, (uint8_t *) &level, + emberAfWriteAttribute(endpoint, Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, (uint8_t *) &level, ZCL_INT8U_ATTRIBUTE_TYPE); } - emberAfWriteAttribute(endpoint, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + emberAfWriteAttribute(endpoint, Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } bool AppTask::StartTimer(void) diff --git a/examples/lighting-app/esp32/main/AppTask.cpp b/examples/lighting-app/esp32/main/AppTask.cpp index 1af833792d0f71..434d98396efc64 100644 --- a/examples/lighting-app/esp32/main/AppTask.cpp +++ b/examples/lighting-app/esp32/main/AppTask.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #define APP_TASK_NAME "APP" #define APP_EVENT_QUEUE_SIZE 10 diff --git a/examples/lighting-app/genio/src/AppTask.cpp b/examples/lighting-app/genio/src/AppTask.cpp index e681d28a22169a..3542e1adca1381 100644 --- a/examples/lighting-app/genio/src/AppTask.cpp +++ b/examples/lighting-app/genio/src/AppTask.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp index dc11429fc65cd0..f8719aa64850ec 100644 --- a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp +++ b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp index 89605fc8a9c6e6..6bbc62708117cf 100644 --- a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp @@ -24,7 +24,7 @@ #include "LEDWidget.h" #include #include -#include +#include #include #include #include @@ -554,8 +554,8 @@ void AppTask::UpdateClusterState(intptr_t context) uint8_t newValue = LightMgr().IsLightOn(); // write the new on/off value - EmberAfStatus status = - emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + EmberAfStatus status = emberAfWriteAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { P6_LOG("ERR: updating on/off %x", status); diff --git a/examples/lighting-app/mbed/main/AppTask.cpp b/examples/lighting-app/mbed/main/AppTask.cpp index 78ec859903b205..3cdf03a03edcec 100644 --- a/examples/lighting-app/mbed/main/AppTask.cpp +++ b/examples/lighting-app/mbed/main/AppTask.cpp @@ -35,7 +35,7 @@ // ZAP -- ZCL Advanced Platform #include #include -#include +#include #include #ifdef CAPSENSE_ENABLED @@ -464,7 +464,7 @@ void AppTask::UpdateClusterState() // write the new on/off value EmberAfStatus status = - emberAfWriteServerAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + emberAfWriteServerAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", status); @@ -472,7 +472,7 @@ void AppTask::UpdateClusterState() uint8_t level = LightingMgr().GetLevel(); - status = emberAfWriteServerAttribute(1, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, &level, + status = emberAfWriteServerAttribute(1, app::Clusters::LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, &level, ZCL_INT8U_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index 15ab885139e20b..26a90b858eaf64 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp index ab05f79d417c4e..4e45106161348e 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include @@ -922,8 +922,8 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) uint8_t newValue = !LightingMgr().IsTurnedOff(); // write the new on/off value - EmberAfStatus status = - emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + EmberAfStatus status = emberAfWriteAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogError(NotSpecified, "ERR: updating on/off %x", status); @@ -940,7 +940,7 @@ void AppTask::UpdateDeviceStateInternal(intptr_t arg) bool onoffAttrValue = 0; /* get onoff attribute value */ - (void) emberAfReadAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &onoffAttrValue, 1); + (void) emberAfReadAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &onoffAttrValue, 1); /* set the device state */ sLightLED.Set(onoffAttrValue); diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index d7dd3c282791f6..145bee65d6c6be 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp index 850649df25e27d..9abc9e17750f52 100644 --- a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp +++ b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/examples/lighting-app/silabs/efr32/src/AppTask.cpp b/examples/lighting-app/silabs/efr32/src/AppTask.cpp index 850649df25e27d..9abc9e17750f52 100644 --- a/examples/lighting-app/silabs/efr32/src/AppTask.cpp +++ b/examples/lighting-app/silabs/efr32/src/AppTask.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include #include diff --git a/examples/lighting-app/telink/src/AppTask.cpp b/examples/lighting-app/telink/src/AppTask.cpp index a310bdb1907560..a90dc1f89a3156 100644 --- a/examples/lighting-app/telink/src/AppTask.cpp +++ b/examples/lighting-app/telink/src/AppTask.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lock-app/cc32xx/main/AppTask.cpp b/examples/lock-app/cc32xx/main/AppTask.cpp index 79da0749349665..cff1e73bf8d0cf 100644 --- a/examples/lock-app/cc32xx/main/AppTask.cpp +++ b/examples/lock-app/cc32xx/main/AppTask.cpp @@ -21,7 +21,7 @@ #include "AppConfig.h" #include "AppEvent.h" #include -#include +#include #include #include @@ -263,7 +263,7 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) LED_setOff(gLedRedHandle); state = 0; } - emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &state, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + emberAfWriteAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &state, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } void AppTask::DispatchEvent(AppEvent * aEvent) diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp index 55003936dc515e..89f033a10231c6 100644 --- a/examples/lock-app/efr32/src/AppTask.cpp +++ b/examples/lock-app/efr32/src/AppTask.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff --git a/examples/lock-app/esp32/main/AppTask.cpp b/examples/lock-app/esp32/main/AppTask.cpp index bedaf75b6946e2..c7ebacf0f334f5 100644 --- a/examples/lock-app/esp32/main/AppTask.cpp +++ b/examples/lock-app/esp32/main/AppTask.cpp @@ -23,7 +23,7 @@ #include "esp_log.h" #include #include -#include +#include #include #include #include @@ -467,8 +467,8 @@ void AppTask::UpdateClusterState(chip::System::Layer *, void * context) uint8_t newValue = !BoltLockMgr().IsUnlocked(); // write the new on/off value - EmberAfStatus status = - emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + EmberAfStatus status = emberAfWriteAttribute(1, chip::app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { ESP_LOGI(TAG, "ERR: updating on/off %x", status); diff --git a/examples/lock-app/esp32/main/DeviceCallbacks.cpp b/examples/lock-app/esp32/main/DeviceCallbacks.cpp index a7e12754e7cb4d..7a073be32e1e53 100644 --- a/examples/lock-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/lock-app/esp32/main/DeviceCallbacks.cpp @@ -28,7 +28,7 @@ #include "BoltLockManager.h" #include -#include +#include static const char * TAG = "lock-devicecallbacks"; @@ -45,7 +45,7 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus switch (clusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/lock-app/genio/src/AppTask.cpp b/examples/lock-app/genio/src/AppTask.cpp index 6c3e284991a9f2..05455f579ad1d3 100644 --- a/examples/lock-app/genio/src/AppTask.cpp +++ b/examples/lock-app/genio/src/AppTask.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lock-app/infineon/psoc6/src/AppTask.cpp b/examples/lock-app/infineon/psoc6/src/AppTask.cpp index d9d46398ee8afa..db2725170740f8 100644 --- a/examples/lock-app/infineon/psoc6/src/AppTask.cpp +++ b/examples/lock-app/infineon/psoc6/src/AppTask.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/examples/lock-app/mbed/main/AppTask.cpp b/examples/lock-app/mbed/main/AppTask.cpp index d9fc7e6dab8a13..8e2b98dac5b3f2 100644 --- a/examples/lock-app/mbed/main/AppTask.cpp +++ b/examples/lock-app/mbed/main/AppTask.cpp @@ -35,7 +35,7 @@ // ZAP -- ZCL Advanced Platform #include #include -#include +#include #include #ifdef CAPSENSE_ENABLED @@ -463,7 +463,7 @@ void AppTask::UpdateClusterState() // write the new on/off value EmberAfStatus status = - emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + emberAfWriteAttribute(1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogError(NotSpecified, "ZCL update failed: %lx", status); diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 4f5c18d869a73e..f767e5d52c6615 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index cb78aef83ee0cd..deba6a5c63772d 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include "Keyboard.h" @@ -763,8 +763,8 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg) uint8_t newValue = !BoltLockMgr().IsUnlocked(); // write the new on/off value - EmberAfStatus status = - emberAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + EmberAfStatus status = emberAfWriteAttribute(1, chip::app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &newValue, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { ChipLogError(NotSpecified, "ERR: updating on/off %x", status); diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index bc24d7fbbe8b46..3306379bbe41da 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp b/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp index 259ff3d726f529..8e6b1192b96dd8 100644 --- a/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp @@ -26,7 +26,7 @@ #include "CHIPDeviceManager.h" #include -#include +#include #include #include #include @@ -90,11 +90,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { switch (clusterId) { - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; diff --git a/examples/ota-requestor-app/telink/src/AppTask.cpp b/examples/ota-requestor-app/telink/src/AppTask.cpp index 314e228772899b..9c8bb471a4317b 100644 --- a/examples/ota-requestor-app/telink/src/AppTask.cpp +++ b/examples/ota-requestor-app/telink/src/AppTask.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include diff --git a/examples/platform/beken/common/CommonDeviceCallbacks.cpp b/examples/platform/beken/common/CommonDeviceCallbacks.cpp index 23677ad7342406..990c381cfe2df6 100644 --- a/examples/platform/beken/common/CommonDeviceCallbacks.cpp +++ b/examples/platform/beken/common/CommonDeviceCallbacks.cpp @@ -18,7 +18,6 @@ #include "CommonDeviceCallbacks.h" #include -#include #include #include #include diff --git a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp index 081c591fb4e670..929fc26052f801 100644 --- a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp +++ b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp @@ -32,7 +32,6 @@ #include "esp_log.h" #include "route_hook/esp_route_hook.h" #include -#include #include #include #include diff --git a/examples/platform/silabs/SiWx917/BaseApplication.cpp b/examples/platform/silabs/SiWx917/BaseApplication.cpp index 85748b35359d3f..a9ecfc63bb0c60 100644 --- a/examples/platform/silabs/SiWx917/BaseApplication.cpp +++ b/examples/platform/silabs/SiWx917/BaseApplication.cpp @@ -40,7 +40,6 @@ #include "EFR32DeviceDataProvider.h" #include #include -#include #include #include #include diff --git a/examples/platform/silabs/efr32/BaseApplication.cpp b/examples/platform/silabs/efr32/BaseApplication.cpp index 85748b35359d3f..a9ecfc63bb0c60 100644 --- a/examples/platform/silabs/efr32/BaseApplication.cpp +++ b/examples/platform/silabs/efr32/BaseApplication.cpp @@ -40,7 +40,6 @@ #include "EFR32DeviceDataProvider.h" #include #include -#include #include #include #include diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/DeviceCallbacks.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/DeviceCallbacks.cpp index 5fc2be33ce6910..73c9e1621b46f0 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/DeviceCallbacks.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/DeviceCallbacks.cpp @@ -28,7 +28,6 @@ #include "PumpManager.h" #include -#include #include #include #include diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index 209eaa0805b666..14ea81f628e2d6 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp index 248b39255cbd51..1e59d9bd6affbe 100644 --- a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp b/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp index 0ceec53420993b..47c5f4d62b44b8 100644 --- a/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include "Keyboard.h" diff --git a/examples/thermostat/efr32/src/AppTask.cpp b/examples/thermostat/efr32/src/AppTask.cpp index 073a52ba392001..40418341d8b697 100644 --- a/examples/thermostat/efr32/src/AppTask.cpp +++ b/examples/thermostat/efr32/src/AppTask.cpp @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/thermostat/genio/src/AppTask.cpp b/examples/thermostat/genio/src/AppTask.cpp index bc948d6a947743..8630aad9fbf2ba 100644 --- a/examples/thermostat/genio/src/AppTask.cpp +++ b/examples/thermostat/genio/src/AppTask.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/examples/thermostat/telink/src/AppTask.cpp b/examples/thermostat/telink/src/AppTask.cpp index 40d78abb7ed402..df25ef8cfb4c19 100644 --- a/examples/thermostat/telink/src/AppTask.cpp +++ b/examples/thermostat/telink/src/AppTask.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/tv-app/android/include/cluster-init.cpp b/examples/tv-app/android/include/cluster-init.cpp index 3c83bef42afd9c..45bc21a45f4ee8 100644 --- a/examples/tv-app/android/include/cluster-init.cpp +++ b/examples/tv-app/android/include/cluster-init.cpp @@ -22,7 +22,6 @@ #include "target-navigator/TargetNavigatorManager.h" #include -#include #include #include #include diff --git a/examples/tv-app/android/java/AppImpl.cpp b/examples/tv-app/android/java/AppImpl.cpp index d03ebc2c908e52..90fc6b5d50d991 100644 --- a/examples/tv-app/android/java/AppImpl.cpp +++ b/examples/tv-app/android/java/AppImpl.cpp @@ -24,7 +24,6 @@ #include "ContentAppAttributeDelegate.h" #include "ContentAppCommandDelegate.h" #include -#include #include #include #include @@ -227,21 +226,21 @@ constexpr CommandId channelOutgoingCommands[] = { }; // Declare Cluster List for Content App endpoint DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(contentAppClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_APPLICATION_BASIC_CLUSTER_ID, applicationBasicAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_KEYPAD_INPUT_CLUSTER_ID, keypadInputAttrs, keypadInputIncomingCommands, +DECLARE_DYNAMIC_CLUSTER(app::Clusters::Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(app::Clusters::ApplicationBasic::Id, applicationBasicAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(app::Clusters::KeypadInput::Id, keypadInputAttrs, keypadInputIncomingCommands, keypadInputOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_APPLICATION_LAUNCHER_CLUSTER_ID, applicationLauncherAttrs, applicationLauncherIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::ApplicationLauncher::Id, applicationLauncherAttrs, applicationLauncherIncomingCommands, applicationLauncherOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_ACCOUNT_LOGIN_CLUSTER_ID, accountLoginAttrs, accountLoginIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::AccountLogin::Id, accountLoginAttrs, accountLoginIncomingCommands, accountLoginOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_CONTENT_LAUNCHER_CLUSTER_ID, contentLauncherAttrs, contentLauncherIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::ContentLauncher::Id, contentLauncherAttrs, contentLauncherIncomingCommands, contentLauncherOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_MEDIA_PLAYBACK_CLUSTER_ID, mediaPlaybackAttrs, mediaPlaybackIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::MediaPlayback::Id, mediaPlaybackAttrs, mediaPlaybackIncomingCommands, mediaPlaybackOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_TARGET_NAVIGATOR_CLUSTER_ID, targetNavigatorAttrs, targetNavigatorIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::TargetNavigator::Id, targetNavigatorAttrs, targetNavigatorIncomingCommands, targetNavigatorOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_CHANNEL_CLUSTER_ID, channelAttrs, channelIncomingCommands, channelOutgoingCommands), + DECLARE_DYNAMIC_CLUSTER(app::Clusters::Channel::Id, channelAttrs, channelIncomingCommands, channelOutgoingCommands), DECLARE_DYNAMIC_CLUSTER_LIST_END; // Declare Content App endpoint diff --git a/examples/tv-app/android/java/DeviceCallbacks.cpp b/examples/tv-app/android/java/DeviceCallbacks.cpp index 07673ffae1acfa..cf61e191385317 100644 --- a/examples/tv-app/android/java/DeviceCallbacks.cpp +++ b/examples/tv-app/android/java/DeviceCallbacks.cpp @@ -25,7 +25,6 @@ #include "DeviceCallbacks.h" #include -#include #include #include #include diff --git a/examples/tv-app/linux/AppImpl.cpp b/examples/tv-app/linux/AppImpl.cpp index 544dbb8509e8f6..d6496acdb1ad9e 100644 --- a/examples/tv-app/linux/AppImpl.cpp +++ b/examples/tv-app/linux/AppImpl.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -386,21 +385,21 @@ constexpr CommandId channelOutgoingCommands[] = { }; // Declare Cluster List for Content App endpoint DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(contentAppClusters) -DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_APPLICATION_BASIC_CLUSTER_ID, applicationBasicAttrs, nullptr, nullptr), - DECLARE_DYNAMIC_CLUSTER(ZCL_KEYPAD_INPUT_CLUSTER_ID, keypadInputAttrs, keypadInputIncomingCommands, +DECLARE_DYNAMIC_CLUSTER(app::Clusters::Descriptor::Id, descriptorAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(app::Clusters::ApplicationBasic::Id, applicationBasicAttrs, nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(app::Clusters::KeypadInput::Id, keypadInputAttrs, keypadInputIncomingCommands, keypadInputOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_APPLICATION_LAUNCHER_CLUSTER_ID, applicationLauncherAttrs, applicationLauncherIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::ApplicationLauncher::Id, applicationLauncherAttrs, applicationLauncherIncomingCommands, applicationLauncherOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_ACCOUNT_LOGIN_CLUSTER_ID, accountLoginAttrs, accountLoginIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::AccountLogin::Id, accountLoginAttrs, accountLoginIncomingCommands, accountLoginOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_CONTENT_LAUNCHER_CLUSTER_ID, contentLauncherAttrs, contentLauncherIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::ContentLauncher::Id, contentLauncherAttrs, contentLauncherIncomingCommands, contentLauncherOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_MEDIA_PLAYBACK_CLUSTER_ID, mediaPlaybackAttrs, mediaPlaybackIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::MediaPlayback::Id, mediaPlaybackAttrs, mediaPlaybackIncomingCommands, mediaPlaybackOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_TARGET_NAVIGATOR_CLUSTER_ID, targetNavigatorAttrs, targetNavigatorIncomingCommands, + DECLARE_DYNAMIC_CLUSTER(app::Clusters::TargetNavigator::Id, targetNavigatorAttrs, targetNavigatorIncomingCommands, targetNavigatorOutgoingCommands), - DECLARE_DYNAMIC_CLUSTER(ZCL_CHANNEL_CLUSTER_ID, channelAttrs, channelIncomingCommands, channelOutgoingCommands), + DECLARE_DYNAMIC_CLUSTER(app::Clusters::Channel::Id, channelAttrs, channelIncomingCommands, channelOutgoingCommands), DECLARE_DYNAMIC_CLUSTER_LIST_END; // Declare Content App endpoint diff --git a/examples/tv-app/linux/include/cluster-init.cpp b/examples/tv-app/linux/include/cluster-init.cpp index bbb889d264404d..ea56403a7df4c6 100644 --- a/examples/tv-app/linux/include/cluster-init.cpp +++ b/examples/tv-app/linux/include/cluster-init.cpp @@ -26,7 +26,6 @@ #include "wake-on-lan/WakeOnLanManager.h" #include -#include #include #include #include diff --git a/examples/tv-app/linux/include/level-control/LevelControl.cpp b/examples/tv-app/linux/include/level-control/LevelControl.cpp index 278c42f8737ed1..6390707e97418e 100644 --- a/examples/tv-app/linux/include/level-control/LevelControl.cpp +++ b/examples/tv-app/linux/include/level-control/LevelControl.cpp @@ -21,8 +21,8 @@ #include #include #include -#include #include +#include using namespace chip; using namespace chip::app::Clusters; @@ -40,7 +40,7 @@ static EmberAfLevelControlState stateTable[EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER static EmberAfLevelControlState * getState(EndpointId endpoint) { - uint8_t ep = emberAfFindClusterServerEndpointIndex(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID); + uint8_t ep = emberAfFindClusterServerEndpointIndex(endpoint, LevelControl::Id); return (ep == 0xFF ? NULL : &stateTable[ep]); } @@ -118,7 +118,7 @@ static void stepHandler(CommandId commandId, uint8_t stepMode, uint8_t stepSize, } send_default_response: - if (emberAfCurrentCommand()->apsFrame->clusterId == ZCL_LEVEL_CONTROL_CLUSTER_ID) + if (emberAfCurrentCommand()->apsFrame->clusterId == LevelControl::Id) { emberAfSendImmediateDefaultResponse(status); } diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index 311640093e35c0..212a3c8ce3e302 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/scripts/idl/generators/bridge/BridgeClustersGlobalStructs.jinja b/scripts/idl/generators/bridge/BridgeClustersGlobalStructs.jinja index 26a8dfa2ec4d81..0fcee9b1efe45d 100644 --- a/scripts/idl/generators/bridge/BridgeClustersGlobalStructs.jinja +++ b/scripts/idl/generators/bridge/BridgeClustersGlobalStructs.jinja @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/scripts/idl/generators/bridge/BridgeClustersHeader.jinja b/scripts/idl/generators/bridge/BridgeClustersHeader.jinja index 3ad37a63ed5821..66aebf7d9d02cd 100644 --- a/scripts/idl/generators/bridge/BridgeClustersHeader.jinja +++ b/scripts/idl/generators/bridge/BridgeClustersHeader.jinja @@ -1,4 +1,3 @@ -#include #include #include diff --git a/scripts/idl/generators/cpp/application/CallbackStubSource.jinja b/scripts/idl/generators/cpp/application/CallbackStubSource.jinja index e17cb3b6fca286..cd800400dc4d10 100644 --- a/scripts/idl/generators/cpp/application/CallbackStubSource.jinja +++ b/scripts/idl/generators/cpp/application/CallbackStubSource.jinja @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -11,7 +11,7 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) switch (clusterId) { {%- for name in clusters | sort(attribute='name') | map(attribute='name') | unique %} - case ZCL_{{name | normalize_acronyms | constcase}}_CLUSTER_ID: + case app::Clusters::{{name}}::Id: emberAf{{name}}ClusterInitCallback(endpoint); break; {%- endfor %} diff --git a/scripts/idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h b/scripts/idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h index d2a3def71c2189..3b56a6f868b109 100644 --- a/scripts/idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h +++ b/scripts/idl/tests/outputs/cluster_struct_attribute/bridge/BridgeGlobalStructs.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/scripts/idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h b/scripts/idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h index a85ccfa9ad2cd4..4b67ca9cbaeefe 100644 --- a/scripts/idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h +++ b/scripts/idl/tests/outputs/global_struct_attribute/bridge/BridgeGlobalStructs.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/scripts/idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp b/scripts/idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp index 7ed6c62053575d..a0bc3f39be80be 100644 --- a/scripts/idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp +++ b/scripts/idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -10,196 +10,196 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { switch (clusterId) { - case ZCL_ACCESS_CONTROL_CLUSTER_ID: + case app::Clusters::AccessControl::Id: emberAfAccessControlClusterInitCallback(endpoint); break; - case ZCL_ACCOUNT_LOGIN_CLUSTER_ID: + case app::Clusters::AccountLogin::Id: emberAfAccountLoginClusterInitCallback(endpoint); break; - case ZCL_ACTIONS_CLUSTER_ID: + case app::Clusters::Actions::Id: emberAfActionsClusterInitCallback(endpoint); break; - case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: + case app::Clusters::AdministratorCommissioning::Id: emberAfAdministratorCommissioningClusterInitCallback(endpoint); break; - case ZCL_APPLICATION_BASIC_CLUSTER_ID: + case app::Clusters::ApplicationBasic::Id: emberAfApplicationBasicClusterInitCallback(endpoint); break; - case ZCL_APPLICATION_LAUNCHER_CLUSTER_ID: + case app::Clusters::ApplicationLauncher::Id: emberAfApplicationLauncherClusterInitCallback(endpoint); break; - case ZCL_AUDIO_OUTPUT_CLUSTER_ID: + case app::Clusters::AudioOutput::Id: emberAfAudioOutputClusterInitCallback(endpoint); break; - case ZCL_BARRIER_CONTROL_CLUSTER_ID: + case app::Clusters::BarrierControl::Id: emberAfBarrierControlClusterInitCallback(endpoint); break; - case ZCL_BASIC_CLUSTER_ID: + case app::Clusters::Basic::Id: emberAfBasicClusterInitCallback(endpoint); break; - case ZCL_BINARY_INPUT_BASIC_CLUSTER_ID: + case app::Clusters::BinaryInputBasic::Id: emberAfBinaryInputBasicClusterInitCallback(endpoint); break; - case ZCL_BINDING_CLUSTER_ID: + case app::Clusters::Binding::Id: emberAfBindingClusterInitCallback(endpoint); break; - case ZCL_BOOLEAN_STATE_CLUSTER_ID: + case app::Clusters::BooleanState::Id: emberAfBooleanStateClusterInitCallback(endpoint); break; - case ZCL_CHANNEL_CLUSTER_ID: + case app::Clusters::Channel::Id: emberAfChannelClusterInitCallback(endpoint); break; - case ZCL_COLOR_CONTROL_CLUSTER_ID: + case app::Clusters::ColorControl::Id: emberAfColorControlClusterInitCallback(endpoint); break; - case ZCL_CONTENT_LAUNCHER_CLUSTER_ID: + case app::Clusters::ContentLauncher::Id: emberAfContentLauncherClusterInitCallback(endpoint); break; - case ZCL_DESCRIPTOR_CLUSTER_ID: + case app::Clusters::Descriptor::Id: emberAfDescriptorClusterInitCallback(endpoint); break; - case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID: + case app::Clusters::DiagnosticLogs::Id: emberAfDiagnosticLogsClusterInitCallback(endpoint); break; - case ZCL_DOOR_LOCK_CLUSTER_ID: + case app::Clusters::DoorLock::Id: emberAfDoorLockClusterInitCallback(endpoint); break; - case ZCL_ELECTRICAL_MEASUREMENT_CLUSTER_ID: + case app::Clusters::ElectricalMeasurement::Id: emberAfElectricalMeasurementClusterInitCallback(endpoint); break; - case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::EthernetNetworkDiagnostics::Id: emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_FAN_CONTROL_CLUSTER_ID: + case app::Clusters::FanControl::Id: emberAfFanControlClusterInitCallback(endpoint); break; - case ZCL_FAULT_INJECTION_CLUSTER_ID: + case app::Clusters::FaultInjection::Id: emberAfFaultInjectionClusterInitCallback(endpoint); break; - case ZCL_FIXED_LABEL_CLUSTER_ID: + case app::Clusters::FixedLabel::Id: emberAfFixedLabelClusterInitCallback(endpoint); break; - case ZCL_FLOW_MEASUREMENT_CLUSTER_ID: + case app::Clusters::FlowMeasurement::Id: emberAfFlowMeasurementClusterInitCallback(endpoint); break; - case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: + case app::Clusters::GeneralCommissioning::Id: emberAfGeneralCommissioningClusterInitCallback(endpoint); break; - case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::GeneralDiagnostics::Id: emberAfGeneralDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: + case app::Clusters::GroupKeyManagement::Id: emberAfGroupKeyManagementClusterInitCallback(endpoint); break; - case ZCL_GROUPS_CLUSTER_ID: + case app::Clusters::Groups::Id: emberAfGroupsClusterInitCallback(endpoint); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: emberAfIdentifyClusterInitCallback(endpoint); break; - case ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID: + case app::Clusters::IlluminanceMeasurement::Id: emberAfIlluminanceMeasurementClusterInitCallback(endpoint); break; - case ZCL_KEYPAD_INPUT_CLUSTER_ID: + case app::Clusters::KeypadInput::Id: emberAfKeypadInputClusterInitCallback(endpoint); break; - case ZCL_LEVEL_CONTROL_CLUSTER_ID: + case app::Clusters::LevelControl::Id: emberAfLevelControlClusterInitCallback(endpoint); break; - case ZCL_LOCALIZATION_CONFIGURATION_CLUSTER_ID: + case app::Clusters::LocalizationConfiguration::Id: emberAfLocalizationConfigurationClusterInitCallback(endpoint); break; - case ZCL_LOW_POWER_CLUSTER_ID: + case app::Clusters::LowPower::Id: emberAfLowPowerClusterInitCallback(endpoint); break; - case ZCL_MEDIA_INPUT_CLUSTER_ID: + case app::Clusters::MediaInput::Id: emberAfMediaInputClusterInitCallback(endpoint); break; - case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: + case app::Clusters::MediaPlayback::Id: emberAfMediaPlaybackClusterInitCallback(endpoint); break; - case ZCL_MODE_SELECT_CLUSTER_ID: + case app::Clusters::ModeSelect::Id: emberAfModeSelectClusterInitCallback(endpoint); break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: + case app::Clusters::NetworkCommissioning::Id: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; - case ZCL_OCCUPANCY_SENSING_CLUSTER_ID: + case app::Clusters::OccupancySensing::Id: emberAfOccupancySensingClusterInitCallback(endpoint); break; - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: emberAfOnOffClusterInitCallback(endpoint); break; - case ZCL_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_ID: + case app::Clusters::OnOffSwitchConfiguration::Id: emberAfOnOffSwitchConfigurationClusterInitCallback(endpoint); break; - case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: + case app::Clusters::OperationalCredentials::Id: emberAfOperationalCredentialsClusterInitCallback(endpoint); break; - case ZCL_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_ID: + case app::Clusters::OtaSoftwareUpdateProvider::Id: emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); break; - case ZCL_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_ID: + case app::Clusters::OtaSoftwareUpdateRequestor::Id: emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); break; - case ZCL_POWER_SOURCE_CLUSTER_ID: + case app::Clusters::PowerSource::Id: emberAfPowerSourceClusterInitCallback(endpoint); break; - case ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID: + case app::Clusters::PowerSourceConfiguration::Id: emberAfPowerSourceConfigurationClusterInitCallback(endpoint); break; - case ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID: + case app::Clusters::PressureMeasurement::Id: emberAfPressureMeasurementClusterInitCallback(endpoint); break; - case ZCL_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_ID: + case app::Clusters::PumpConfigurationAndControl::Id: emberAfPumpConfigurationAndControlClusterInitCallback(endpoint); break; - case ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID: + case app::Clusters::RelativeHumidityMeasurement::Id: emberAfRelativeHumidityMeasurementClusterInitCallback(endpoint); break; - case ZCL_SCENES_CLUSTER_ID: + case app::Clusters::Scenes::Id: emberAfScenesClusterInitCallback(endpoint); break; - case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::SoftwareDiagnostics::Id: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_SWITCH_CLUSTER_ID: + case app::Clusters::Switch::Id: emberAfSwitchClusterInitCallback(endpoint); break; - case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: + case app::Clusters::TargetNavigator::Id: emberAfTargetNavigatorClusterInitCallback(endpoint); break; - case ZCL_TEMPERATURE_MEASUREMENT_CLUSTER_ID: + case app::Clusters::TemperatureMeasurement::Id: emberAfTemperatureMeasurementClusterInitCallback(endpoint); break; - case ZCL_THERMOSTAT_CLUSTER_ID: + case app::Clusters::Thermostat::Id: emberAfThermostatClusterInitCallback(endpoint); break; - case ZCL_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_ID: + case app::Clusters::ThermostatUserInterfaceConfiguration::Id: emberAfThermostatUserInterfaceConfigurationClusterInitCallback(endpoint); break; - case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::ThreadNetworkDiagnostics::Id: emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_TIME_FORMAT_LOCALIZATION_CLUSTER_ID: + case app::Clusters::TimeFormatLocalization::Id: emberAfTimeFormatLocalizationClusterInitCallback(endpoint); break; - case ZCL_UNIT_LOCALIZATION_CLUSTER_ID: + case app::Clusters::UnitLocalization::Id: emberAfUnitLocalizationClusterInitCallback(endpoint); break; - case ZCL_UNIT_TESTING_CLUSTER_ID: + case app::Clusters::UnitTesting::Id: emberAfUnitTestingClusterInitCallback(endpoint); break; - case ZCL_USER_LABEL_CLUSTER_ID: + case app::Clusters::UserLabel::Id: emberAfUserLabelClusterInitCallback(endpoint); break; - case ZCL_WAKE_ON_LAN_CLUSTER_ID: + case app::Clusters::WakeOnLan::Id: emberAfWakeOnLanClusterInitCallback(endpoint); break; - case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::WiFiNetworkDiagnostics::Id: emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_WINDOW_COVERING_CLUSTER_ID: + case app::Clusters::WindowCovering::Id: emberAfWindowCoveringClusterInitCallback(endpoint); break; default: diff --git a/scripts/idl/tests/outputs/large_lighting_app/cpp-app/callback-stub.cpp b/scripts/idl/tests/outputs/large_lighting_app/cpp-app/callback-stub.cpp index 57934f7f40ec20..54955e5a834a06 100644 --- a/scripts/idl/tests/outputs/large_lighting_app/cpp-app/callback-stub.cpp +++ b/scripts/idl/tests/outputs/large_lighting_app/cpp-app/callback-stub.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -10,85 +10,85 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { switch (clusterId) { - case ZCL_ACCESS_CONTROL_CLUSTER_ID: + case app::Clusters::AccessControl::Id: emberAfAccessControlClusterInitCallback(endpoint); break; - case ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID: + case app::Clusters::AdministratorCommissioning::Id: emberAfAdministratorCommissioningClusterInitCallback(endpoint); break; - case ZCL_BASIC_CLUSTER_ID: + case app::Clusters::Basic::Id: emberAfBasicClusterInitCallback(endpoint); break; - case ZCL_COLOR_CONTROL_CLUSTER_ID: + case app::Clusters::ColorControl::Id: emberAfColorControlClusterInitCallback(endpoint); break; - case ZCL_DESCRIPTOR_CLUSTER_ID: + case app::Clusters::Descriptor::Id: emberAfDescriptorClusterInitCallback(endpoint); break; - case ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID: + case app::Clusters::DiagnosticLogs::Id: emberAfDiagnosticLogsClusterInitCallback(endpoint); break; - case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::EthernetNetworkDiagnostics::Id: emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_FIXED_LABEL_CLUSTER_ID: + case app::Clusters::FixedLabel::Id: emberAfFixedLabelClusterInitCallback(endpoint); break; - case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: + case app::Clusters::GeneralCommissioning::Id: emberAfGeneralCommissioningClusterInitCallback(endpoint); break; - case ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::GeneralDiagnostics::Id: emberAfGeneralDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: + case app::Clusters::GroupKeyManagement::Id: emberAfGroupKeyManagementClusterInitCallback(endpoint); break; - case ZCL_GROUPS_CLUSTER_ID: + case app::Clusters::Groups::Id: emberAfGroupsClusterInitCallback(endpoint); break; - case ZCL_IDENTIFY_CLUSTER_ID: + case app::Clusters::Identify::Id: emberAfIdentifyClusterInitCallback(endpoint); break; - case ZCL_LEVEL_CONTROL_CLUSTER_ID: + case app::Clusters::LevelControl::Id: emberAfLevelControlClusterInitCallback(endpoint); break; - case ZCL_LOCALIZATION_CONFIGURATION_CLUSTER_ID: + case app::Clusters::LocalizationConfiguration::Id: emberAfLocalizationConfigurationClusterInitCallback(endpoint); break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: + case app::Clusters::NetworkCommissioning::Id: emberAfNetworkCommissioningClusterInitCallback(endpoint); break; - case ZCL_OCCUPANCY_SENSING_CLUSTER_ID: + case app::Clusters::OccupancySensing::Id: emberAfOccupancySensingClusterInitCallback(endpoint); break; - case ZCL_ON_OFF_CLUSTER_ID: + case app::Clusters::OnOff::Id: emberAfOnOffClusterInitCallback(endpoint); break; - case ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID: + case app::Clusters::OperationalCredentials::Id: emberAfOperationalCredentialsClusterInitCallback(endpoint); break; - case ZCL_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_ID: + case app::Clusters::OtaSoftwareUpdateProvider::Id: emberAfOtaSoftwareUpdateProviderClusterInitCallback(endpoint); break; - case ZCL_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_ID: + case app::Clusters::OtaSoftwareUpdateRequestor::Id: emberAfOtaSoftwareUpdateRequestorClusterInitCallback(endpoint); break; - case ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::SoftwareDiagnostics::Id: emberAfSoftwareDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_SWITCH_CLUSTER_ID: + case app::Clusters::Switch::Id: emberAfSwitchClusterInitCallback(endpoint); break; - case ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::ThreadNetworkDiagnostics::Id: emberAfThreadNetworkDiagnosticsClusterInitCallback(endpoint); break; - case ZCL_TIME_FORMAT_LOCALIZATION_CLUSTER_ID: + case app::Clusters::TimeFormatLocalization::Id: emberAfTimeFormatLocalizationClusterInitCallback(endpoint); break; - case ZCL_USER_LABEL_CLUSTER_ID: + case app::Clusters::UserLabel::Id: emberAfUserLabelClusterInitCallback(endpoint); break; - case ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID: + case app::Clusters::WiFiNetworkDiagnostics::Id: emberAfWiFiNetworkDiagnosticsClusterInitCallback(endpoint); break; default: diff --git a/scripts/idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h b/scripts/idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h index d2a3def71c2189..3b56a6f868b109 100644 --- a/scripts/idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h +++ b/scripts/idl/tests/outputs/several_clusters/bridge/BridgeGlobalStructs.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/scripts/idl/tests/outputs/several_clusters/cpp-app/callback-stub.cpp b/scripts/idl/tests/outputs/several_clusters/cpp-app/callback-stub.cpp index 4b92f0e3989ca6..d603013606d835 100644 --- a/scripts/idl/tests/outputs/several_clusters/cpp-app/callback-stub.cpp +++ b/scripts/idl/tests/outputs/several_clusters/cpp-app/callback-stub.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include @@ -10,13 +10,13 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) { switch (clusterId) { - case ZCL_FIRST_CLUSTER_ID: + case app::Clusters::First::Id: emberAfFirstClusterInitCallback(endpoint); break; - case ZCL_SECOND_CLUSTER_ID: + case app::Clusters::Second::Id: emberAfSecondClusterInitCallback(endpoint); break; - case ZCL_THIRD_CLUSTER_ID: + case app::Clusters::Third::Id: emberAfThirdClusterInitCallback(endpoint); break; default: diff --git a/scripts/idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h b/scripts/idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h index d2a3def71c2189..3b56a6f868b109 100644 --- a/scripts/idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h +++ b/scripts/idl/tests/outputs/simple_attribute/bridge/BridgeGlobalStructs.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include diff --git a/src/app/app-platform/ContentApp.cpp b/src/app/app-platform/ContentApp.cpp index cd7e8bdd0d4cd3..571561454162ac 100644 --- a/src/app/app-platform/ContentApp.cpp +++ b/src/app/app-platform/ContentApp.cpp @@ -19,8 +19,6 @@ * @file Contains functions relating to Content App of the Video Player. */ -#include -#include #include #include #include diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp index 736cf164fdfede..0b03dc22f8e262 100644 --- a/src/app/app-platform/ContentAppPlatform.cpp +++ b/src/app/app-platform/ContentAppPlatform.cpp @@ -19,8 +19,6 @@ * @file Contains functions relating to Content App platform of the Video Player. */ -#include -#include #include #include #include diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp index c3d59d66db159d..40b8e84443ce4e 100644 --- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp @@ -15,7 +15,6 @@ * limitations under the License. */ -#include #include #include #include diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.h b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.h index beb7721d5d66d5..91348717c481c5 100644 --- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.h +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.h @@ -18,7 +18,6 @@ #pragma once -#include #include #include #include diff --git a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp index c9c38f3fb23b5d..77c38d1f9d5d9f 100644 --- a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp @@ -24,7 +24,6 @@ #include "door-lock-server.h" #include #include -#include #include #include #include diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index a1e5307b66169d..a3c75c4818ff9c 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -24,7 +24,7 @@ #include "door-lock-server.h" #include #include -#include +#include #include #include #include diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp index e14e8fd3af7f0c..6d35ea2512a1bd 100644 --- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp +++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 4912062aa9c516..0ccf5c4c34eeb5 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -21,9 +21,9 @@ #include #include #include -#include #include #include +#include #include #include #include diff --git a/src/app/clusters/ias-zone-client/ias-zone-client.cpp b/src/app/clusters/ias-zone-client/ias-zone-client.cpp index 58eb813316a99e..7619a983986fb6 100644 --- a/src/app/clusters/ias-zone-client/ias-zone-client.cpp +++ b/src/app/clusters/ias-zone-client/ias-zone-client.cpp @@ -16,6 +16,7 @@ */ #include "ias-zone-client.h" +#include #include #include @@ -280,7 +281,7 @@ bool emberAfIasZoneClusterZoneEnrollRequestCallback(app::CommandHandler * comman zoneId = serverIndex; setServerZoneId(serverIndex, zoneId); } - emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID, + emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), app::Clusters::IasZone::Id, ZCL_ZONE_ENROLL_RESPONSE_COMMAND_ID, "uu", responseCode, zoneId); // Need to send this command with our source EUI because the server will // check our EUI64 against his CIE Address to see if we're his CIE. @@ -355,7 +356,7 @@ static void setCieAddress(EmberNodeId destAddress) 0, // ieee (filled in later) }; emberAfGetEui64(&writeAttributes[3]); - emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID, + emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), app::Clusters::IasZone::Id, ZCL_WRITE_ATTRIBUTES_COMMAND_ID, "b", writeAttributes, sizeof(writeAttributes)); emberAfIasZoneClusterPrintln("Writing CIE Address to IAS Zone Server"); if (EMBER_SUCCESS == sendCommand(destAddress)) @@ -404,7 +405,7 @@ static void checkForIasZoneServer(EmberNodeId emberNodeId, uint8_t * ieeeAddress return; } - EmberStatus status = emberAfFindDevicesByCluster(emberNodeId, ZCL_IAS_ZONE_CLUSTER_ID, + EmberStatus status = emberAfFindDevicesByCluster(emberNodeId, app::Clusters::IasZone::Id, true, // server cluster? iasZoneClientServiceDiscoveryCallback); @@ -434,7 +435,7 @@ void readIasZoneServerAttributes(EmberNodeId nodeId) EMBER_LOW_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_ZONE_STATUS_ATTRIBUTE_ID), }; - emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID, + emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), app::Clusters::IasZone::Id, ZCL_READ_ATTRIBUTES_COMMAND_ID, "b", iasZoneAttributeIds, sizeof(iasZoneAttributeIds)); if (EMBER_SUCCESS == sendCommand(nodeId)) { @@ -448,7 +449,7 @@ void readIasZoneServerCieAddress(EmberNodeId nodeId) EMBER_LOW_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID), EMBER_HIGH_BYTE(ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID), }; - emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), ZCL_IAS_ZONE_CLUSTER_ID, + emberAfFillExternalBuffer((ZCL_GLOBAL_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), app::Clusters::IasZone::Id, ZCL_READ_ATTRIBUTES_COMMAND_ID, "b", iasZoneAttributeIds, sizeof(iasZoneAttributeIds)); if (EMBER_SUCCESS == sendCommand(nodeId)) { @@ -458,7 +459,7 @@ void readIasZoneServerCieAddress(EmberNodeId nodeId) void emberAfPluginIasZoneClientWriteAttributesResponseCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen) { - if (clusterId == ZCL_IAS_ZONE_CLUSTER_ID && iasZoneClientState == IAS_ZONE_CLIENT_STATE_SET_CIE_ADDRESS && + if (clusterId == app::Clusters::IasZone::Id && iasZoneClientState == IAS_ZONE_CLIENT_STATE_SET_CIE_ADDRESS && buffer[0] == EMBER_ZCL_STATUS_SUCCESS) { readIasZoneServerCieAddress(emberAfCurrentCommand()->source); @@ -470,7 +471,7 @@ void emberAfPluginIasZoneClientWriteAttributesResponseCallback(ClusterId cluster void emberAfPluginIasZoneClientReadAttributesResponseCallback(ClusterId clusterId, uint8_t * buffer, uint16_t bufLen) { uint8_t zoneStatus, zoneType, zoneState; - if (clusterId == ZCL_IAS_ZONE_CLUSTER_ID && + if (clusterId == app::Clusters::IasZone::Id && (iasZoneClientState == IAS_ZONE_CLIENT_STATE_READ_ATTRIBUTES || iasZoneClientState == IAS_ZONE_CLIENT_STATE_READ_CIE_ADDRESS)) { diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index fa774254801edd..b9eed2bb889d52 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -20,9 +20,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -170,7 +170,7 @@ static EmberStatus sendToClient(EndpointId endpoint) static void enrollWithClient(EndpointId endpoint) { EmberStatus status; - emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_IAS_ZONE_CLUSTER_ID, + emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), IasZone::Id, ZCL_ZONE_ENROLL_REQUEST_COMMAND_ID, "vv", EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE, EMBER_AF_MANUFACTURER_CODE); status = sendToClient(endpoint); @@ -213,7 +213,7 @@ MatterIasZoneClusterServerPreAttributeChangedCallback(const app::ConcreteAttribu // currently existing in the field. bindingEntry.type = EMBER_UNICAST_BINDING; bindingEntry.local = endpoint; - bindingEntry.clusterId = MakeOptional(ZCL_IAS_ZONE_CLUSTER_ID); + bindingEntry.clusterId = MakeOptional(IasZone::Id); bindingEntry.remote = emberAfCurrentCommand()->apsFrame->sourceEndpoint; bindingEntry.nodeId = destNodeId; @@ -238,7 +238,7 @@ MatterIasZoneClusterServerPreAttributeChangedCallback(const app::ConcreteAttribu } zeroAddress = true; - emberAfReadServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, (uint8_t *) ieeeAddress, 8); + emberAfReadServerAttribute(endpoint, IasZone::Id, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, (uint8_t *) ieeeAddress, 8); for (i = 0; i < 8; i++) { if (ieeeAddress[i] != 0) @@ -255,8 +255,7 @@ MatterIasZoneClusterServerPreAttributeChangedCallback(const app::ConcreteAttribu // at this point because then the Write Attributes response will not // be sent. But we also delay to give the client time to configure us. emberAfIasZoneClusterPrintln("Sending enrollment after %d ms", DELAY_TIMER_MS); - emberAfScheduleServerTickExtended(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, DELAY_TIMER_MS, EMBER_AF_SHORT_POLL, - EMBER_AF_STAY_AWAKE); + emberAfScheduleServerTickExtended(endpoint, IasZone::Id, DELAY_TIMER_MS, EMBER_AF_SHORT_POLL, EMBER_AF_STAY_AWAKE); } return Protocols::InteractionModel::Status::Success; @@ -299,9 +298,8 @@ bool emberAfIasZoneClusterAmIEnrolled(EndpointId endpoint) { EmberAfIasZoneState zoneState = EMBER_ZCL_IAS_ZONE_STATE_NOT_ENROLLED; // Clear this out completely. EmberAfStatus status; - status = - emberAfReadServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_STATE_ATTRIBUTE_ID, (unsigned char *) &zoneState, - 1); // uint8_t size + status = emberAfReadServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_STATE_ATTRIBUTE_ID, (unsigned char *) &zoneState, + 1); // uint8_t size return (status == EMBER_ZCL_STATUS_SUCCESS && zoneState == EMBER_ZCL_IAS_ZONE_STATE_ENROLLED); } @@ -310,7 +308,7 @@ static void updateEnrollState(EndpointId endpoint, bool enrolled) { EmberAfIasZoneState zoneState = (enrolled ? EMBER_ZCL_IAS_ZONE_STATE_ENROLLED : EMBER_ZCL_IAS_ZONE_STATE_NOT_ENROLLED); - emberAfWriteServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_STATE_ATTRIBUTE_ID, (uint8_t *) &zoneState, + emberAfWriteServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_STATE_ATTRIBUTE_ID, (uint8_t *) &zoneState, ZCL_INT8U_ATTRIBUTE_TYPE); emberAfIasZoneClusterPrintln("IAS Zone Server State: %pEnrolled", (enrolled ? "" : "NOT ")); } @@ -326,7 +324,7 @@ bool emberAfIasZoneClusterZoneEnrollResponseCallback(app::CommandHandler * comma EmberAfStatus status; endpoint = emberAfCurrentEndpoint(); - status = emberAfReadServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_ID_ATTRIBUTE_ID, &epZoneId, sizeof(uint8_t)); + status = emberAfReadServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_ID_ATTRIBUTE_ID, &epZoneId, sizeof(uint8_t)); if (status == EMBER_ZCL_STATUS_SUCCESS) { if (enrollResponseCode == EMBER_ZCL_IAS_ENROLL_RESPONSE_CODE_SUCCESS) @@ -355,7 +353,7 @@ static EmberStatus sendZoneUpdate(uint16_t zoneStatus, uint16_t timeSinceStatusO { return EMBER_INVALID_CALL; } - emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_IAS_ZONE_CLUSTER_ID, + emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), IasZone::Id, ZCL_ZONE_STATUS_CHANGE_NOTIFICATION_COMMAND_ID, "vuuv", zoneStatus, 0 /*extended status, must be zero per spec*/, emberAfPluginIasZoneServerGetZoneId(endpoint), timeSinceStatusOccurredQs /* called "delay" in the spec */); @@ -382,7 +380,7 @@ EmberStatus emberAfPluginIasZoneServerUpdateZoneStatus(EndpointId endpoint, uint #endif EmberStatus sendStatus = EMBER_SUCCESS; - emberAfWriteServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_STATUS_ATTRIBUTE_ID, (uint8_t *) &newStatus, + emberAfWriteServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_STATUS_ATTRIBUTE_ID, (uint8_t *) &newStatus, ZCL_INT16U_ATTRIBUTE_TYPE); if (enrollmentMethod == EMBER_ZCL_IAS_ZONE_ENROLLMENT_MODE_TRIP_TO_PAIR) @@ -390,7 +388,7 @@ EmberStatus emberAfPluginIasZoneServerUpdateZoneStatus(EndpointId endpoint, uint // If unenrolled, send Zone Enroll Request command. if (!emberAfIasZoneClusterAmIEnrolled(endpoint)) { - emberAfScheduleServerTick(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, DELAY_TIMER_MS); + emberAfScheduleServerTick(endpoint, IasZone::Id, DELAY_TIMER_MS); // Don't send the zone status update since not enrolled. return EMBER_SUCCESS; } @@ -525,8 +523,7 @@ void emberAfIasZoneClusterServerInitCallback(EndpointId endpoint) #endif zoneType = (EmberAfIasZoneType) EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE; - emberAfWriteAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_TYPE_ATTRIBUTE_ID, (uint8_t *) &zoneType, - ZCL_INT16U_ATTRIBUTE_TYPE); + emberAfWriteAttribute(endpoint, IasZone::Id, ZCL_ZONE_TYPE_ATTRIBUTE_ID, (uint8_t *) &zoneType, ZCL_INT16U_ATTRIBUTE_TYPE); emberAfPluginIasZoneServerUpdateZoneStatus(endpoint, 0, // status: All alarms cleared @@ -541,7 +538,7 @@ void emberAfIasZoneClusterServerTickCallback(EndpointId endpoint) uint8_t emberAfPluginIasZoneServerGetZoneId(EndpointId endpoint) { uint8_t zoneId = UNDEFINED_ZONE_ID; - emberAfReadServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_ID_ATTRIBUTE_ID, &zoneId, + emberAfReadServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_ID_ATTRIBUTE_ID, &zoneId, emberAfGetDataSize(ZCL_INT8U_ATTRIBUTE_TYPE)); return zoneId; } @@ -569,7 +566,7 @@ static bool areZoneServerAttributesNonVolatile(EndpointId endpoint) static void setZoneId(EndpointId endpoint, uint8_t zoneId) { emberAfIasZoneClusterPrintln("IAS Zone Server Zone ID: 0x%X", zoneId); - emberAfWriteServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_ID_ATTRIBUTE_ID, &zoneId, ZCL_INT8U_ATTRIBUTE_TYPE); + emberAfWriteServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_ID_ATTRIBUTE_ID, &zoneId, ZCL_INT8U_ATTRIBUTE_TYPE); } static void unenrollSecurityDevice(EndpointId endpoint) @@ -577,10 +574,10 @@ static void unenrollSecurityDevice(EndpointId endpoint) uint8_t ieeeAddress[] = { 0, 0, 0, 0, 0, 0, 0, 0 }; uint16_t zoneType = EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE; - emberAfWriteServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, (uint8_t *) ieeeAddress, + emberAfWriteServerAttribute(endpoint, IasZone::Id, ZCL_IAS_CIE_ADDRESS_ATTRIBUTE_ID, (uint8_t *) ieeeAddress, ZCL_NODE_ID_ATTRIBUTE_TYPE); - emberAfWriteServerAttribute(endpoint, ZCL_IAS_ZONE_CLUSTER_ID, ZCL_ZONE_TYPE_ATTRIBUTE_ID, (uint8_t *) &zoneType, + emberAfWriteServerAttribute(endpoint, IasZone::Id, ZCL_ZONE_TYPE_ATTRIBUTE_ID, (uint8_t *) &zoneType, ZCL_INT16U_ATTRIBUTE_TYPE); setZoneId(endpoint, UNDEFINED_ZONE_ID); @@ -601,7 +598,7 @@ void emberAfPluginIasZoneServerStackStatusCallback(EmberStatus status) for (uint16_t i = 0; i < emberAfEndpointCount(); i++) { endpoint = emberAfEndpointFromIndex(i); - if (emberAfContainsServer(endpoint, ZCL_IAS_ZONE_CLUSTER_ID)) + if (emberAfContainsServer(endpoint, IasZone::Id)) { unenrollSecurityDevice(endpoint); } diff --git a/src/app/clusters/identify-server/identify-server.cpp b/src/app/clusters/identify-server/identify-server.cpp index 89720ad41fb502..5d749c951a7a85 100644 --- a/src/app/clusters/identify-server/identify-server.cpp +++ b/src/app/clusters/identify-server/identify-server.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/scenes/scenes.cpp b/src/app/clusters/scenes/scenes.cpp index b26bde015707e1..58369e8eb11837 100644 --- a/src/app/clusters/scenes/scenes.cpp +++ b/src/app/clusters/scenes/scenes.cpp @@ -19,9 +19,9 @@ #include "app/util/common.h" #include #include -#include #include #include +#include #include #include #include @@ -35,6 +35,7 @@ #endif using namespace chip; +using namespace chip::app::Clusters; using namespace chip::app::Clusters::Scenes; uint8_t emberAfPluginScenesServerEntriesInUse = 0; @@ -88,8 +89,8 @@ void emberAfScenesClusterServerInitCallback(EndpointId endpoint) { // The high bit of Name Support indicates whether scene names are supported. uint8_t nameSupport = EMBER_BIT(7); - writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_SCENE_NAME_SUPPORT_ATTRIBUTE_ID, "name support", - (uint8_t *) &nameSupport, ZCL_BITMAP8_ATTRIBUTE_TYPE); + writeServerAttribute(endpoint, Scenes::Id, ZCL_SCENE_NAME_SUPPORT_ATTRIBUTE_ID, "name support", (uint8_t *) &nameSupport, + ZCL_BITMAP8_ATTRIBUTE_TYPE); } #endif #if !defined(EMBER_AF_PLUGIN_SCENES_USE_TOKENS) || defined(EZSP_HOST) @@ -110,7 +111,7 @@ void emberAfScenesClusterServerInitCallback(EndpointId endpoint) EmberAfStatus emberAfScenesSetSceneCountAttribute(EndpointId endpoint, uint8_t newCount) { - return writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_SCENE_COUNT_ATTRIBUTE_ID, "scene count", (uint8_t *) &newCount, + return writeServerAttribute(endpoint, Scenes::Id, ZCL_SCENE_COUNT_ATTRIBUTE_ID, "scene count", (uint8_t *) &newCount, ZCL_INT8U_ATTRIBUTE_TYPE); } @@ -120,22 +121,22 @@ EmberAfStatus emberAfScenesMakeValid(EndpointId endpoint, uint8_t sceneId, Group bool valid = true; // scene ID - status = writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_CURRENT_SCENE_ATTRIBUTE_ID, "current scene", - (uint8_t *) &sceneId, ZCL_INT8U_ATTRIBUTE_TYPE); + status = writeServerAttribute(endpoint, Scenes::Id, ZCL_CURRENT_SCENE_ATTRIBUTE_ID, "current scene", (uint8_t *) &sceneId, + ZCL_INT8U_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { return status; } // group ID - status = writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_CURRENT_GROUP_ATTRIBUTE_ID, "current group", - (uint8_t *) &groupId, ZCL_INT16U_ATTRIBUTE_TYPE); + status = writeServerAttribute(endpoint, Scenes::Id, ZCL_CURRENT_GROUP_ATTRIBUTE_ID, "current group", (uint8_t *) &groupId, + ZCL_INT16U_ATTRIBUTE_TYPE); if (status != EMBER_ZCL_STATUS_SUCCESS) { return status; } - status = writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_SCENE_VALID_ATTRIBUTE_ID, "scene valid", (uint8_t *) &valid, + status = writeServerAttribute(endpoint, Scenes::Id, ZCL_SCENE_VALID_ATTRIBUTE_ID, "scene valid", (uint8_t *) &valid, ZCL_BOOLEAN_ATTRIBUTE_TYPE); return status; } @@ -143,7 +144,7 @@ EmberAfStatus emberAfScenesMakeValid(EndpointId endpoint, uint8_t sceneId, Group EmberAfStatus emberAfScenesClusterMakeInvalidCallback(EndpointId endpoint) { bool valid = false; - return writeServerAttribute(endpoint, ZCL_SCENES_CLUSTER_ID, ZCL_SCENE_VALID_ATTRIBUTE_ID, "scene valid", (uint8_t *) &valid, + return writeServerAttribute(endpoint, Scenes::Id, ZCL_SCENE_VALID_ATTRIBUTE_ID, "scene valid", (uint8_t *) &valid, ZCL_BOOLEAN_ATTRIBUTE_TYPE); } @@ -259,8 +260,7 @@ bool emberAfScenesClusterRemoveSceneCallback(app::CommandHandler * commandObj, c if (emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST || emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST_REPLY) { { - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, - ZCL_REMOVE_SCENE_RESPONSE_COMMAND_ID }; + app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_REMOVE_SCENE_RESPONSE_COMMAND_ID }; TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = commandObj->PrepareCommand(path)); VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); @@ -312,8 +312,7 @@ bool emberAfScenesClusterRemoveAllScenesCallback(app::CommandHandler * commandOb if (emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST || emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST_REPLY) { { - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, - ZCL_REMOVE_ALL_SCENES_RESPONSE_COMMAND_ID }; + app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_REMOVE_ALL_SCENES_RESPONSE_COMMAND_ID }; TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = commandObj->PrepareCommand(path)); VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); @@ -347,8 +346,7 @@ bool emberAfScenesClusterStoreSceneCallback(app::CommandHandler * commandObj, co if (emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST || emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST_REPLY) { { - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, - ZCL_STORE_SCENE_RESPONSE_COMMAND_ID }; + app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_STORE_SCENE_RESPONSE_COMMAND_ID }; TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = commandObj->PrepareCommand(path)); VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); @@ -443,8 +441,7 @@ bool emberAfScenesClusterGetSceneMembershipCallback(app::CommandHandler * comman } { - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, - ZCL_GET_SCENE_MEMBERSHIP_RESPONSE_COMMAND_ID }; + app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_GET_SCENE_MEMBERSHIP_RESPONSE_COMMAND_ID }; TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = commandObj->PrepareCommand(path)); VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE); @@ -502,69 +499,64 @@ EmberAfStatus emberAfScenesClusterStoreCurrentSceneCallback(chip::FabricIndex fa // When creating a new entry or refreshing an existing one, the extension // fields are updated with the current state of other clusters on the device. #ifdef ZCL_USING_ON_OFF_CLUSTER_SERVER - entry.hasOnOffValue = readServerAttribute(endpoint, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", - (uint8_t *) &entry.onOffValue, sizeof(entry.onOffValue)); + entry.hasOnOffValue = readServerAttribute(endpoint, OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", (uint8_t *) &entry.onOffValue, + sizeof(entry.onOffValue)); #endif #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER - entry.hasCurrentLevelValue = - readServerAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, "current level", - (uint8_t *) &entry.currentLevelValue, sizeof(entry.currentLevelValue)); + entry.hasCurrentLevelValue = readServerAttribute(endpoint, LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, "current level", + (uint8_t *) &entry.currentLevelValue, sizeof(entry.currentLevelValue)); #endif #ifdef ZCL_USING_THERMOSTAT_CLUSTER_SERVER - entry.hasOccupiedCoolingSetpointValue = readServerAttribute( - endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, "occupied cooling setpoint", - (uint8_t *) &entry.occupiedCoolingSetpointValue, sizeof(entry.occupiedCoolingSetpointValue)); - entry.hasOccupiedHeatingSetpointValue = readServerAttribute( - endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, "occupied heating setpoint", - (uint8_t *) &entry.occupiedHeatingSetpointValue, sizeof(entry.occupiedHeatingSetpointValue)); - entry.hasSystemModeValue = readServerAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_SYSTEM_MODE_ATTRIBUTE_ID, "system mode", + entry.hasOccupiedCoolingSetpointValue = + readServerAttribute(endpoint, Thermostat::Id, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, "occupied cooling setpoint", + (uint8_t *) &entry.occupiedCoolingSetpointValue, sizeof(entry.occupiedCoolingSetpointValue)); + entry.hasOccupiedHeatingSetpointValue = + readServerAttribute(endpoint, Thermostat::Id, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, "occupied heating setpoint", + (uint8_t *) &entry.occupiedHeatingSetpointValue, sizeof(entry.occupiedHeatingSetpointValue)); + entry.hasSystemModeValue = readServerAttribute(endpoint, Thermostat::Id, ZCL_SYSTEM_MODE_ATTRIBUTE_ID, "system mode", (uint8_t *) &entry.systemModeValue, sizeof(entry.systemModeValue)); #endif #ifdef ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER - entry.hasCurrentXValue = readServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_X_ATTRIBUTE_ID, - "current x", (uint8_t *) &entry.currentXValue, sizeof(entry.currentXValue)); - entry.hasCurrentYValue = readServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_Y_ATTRIBUTE_ID, - "current y", (uint8_t *) &entry.currentYValue, sizeof(entry.currentYValue)); - entry.hasEnhancedCurrentHueValue = readServerAttribute( - endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_ENHANCED_CURRENT_HUE_ATTRIBUTE_ID, "enhanced current hue", - (uint8_t *) &entry.enhancedCurrentHueValue, sizeof(entry.enhancedCurrentHueValue)); + entry.hasCurrentXValue = readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_X_ATTRIBUTE_ID, "current x", + (uint8_t *) &entry.currentXValue, sizeof(entry.currentXValue)); + entry.hasCurrentYValue = readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_Y_ATTRIBUTE_ID, "current y", + (uint8_t *) &entry.currentYValue, sizeof(entry.currentYValue)); + entry.hasEnhancedCurrentHueValue = + readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_ENHANCED_CURRENT_HUE_ATTRIBUTE_ID, "enhanced current hue", + (uint8_t *) &entry.enhancedCurrentHueValue, sizeof(entry.enhancedCurrentHueValue)); entry.hasCurrentSaturationValue = - readServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, - "current saturation", (uint8_t *) &entry.currentSaturationValue, sizeof(entry.currentSaturationValue)); + readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, "current saturation", + (uint8_t *) &entry.currentSaturationValue, sizeof(entry.currentSaturationValue)); entry.hasColorLoopActiveValue = - readServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_LOOP_ACTIVE_ATTRIBUTE_ID, - "color loop active", (uint8_t *) &entry.colorLoopActiveValue, sizeof(entry.colorLoopActiveValue)); - entry.hasColorLoopDirectionValue = readServerAttribute( - endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_LOOP_DIRECTION_ATTRIBUTE_ID, "color loop direction", - (uint8_t *) &entry.colorLoopDirectionValue, sizeof(entry.colorLoopDirectionValue)); + readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_LOOP_ACTIVE_ATTRIBUTE_ID, "color loop active", + (uint8_t *) &entry.colorLoopActiveValue, sizeof(entry.colorLoopActiveValue)); + entry.hasColorLoopDirectionValue = + readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_LOOP_DIRECTION_ATTRIBUTE_ID, "color loop direction", + (uint8_t *) &entry.colorLoopDirectionValue, sizeof(entry.colorLoopDirectionValue)); entry.hasColorLoopTimeValue = - readServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_LOOP_TIME_ATTRIBUTE_ID, - "color loop time", (uint8_t *) &entry.colorLoopTimeValue, sizeof(entry.colorLoopTimeValue)); - entry.hasColorTemperatureMiredsValue = readServerAttribute( - endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID, "color temp mireds", - (uint8_t *) &entry.colorTemperatureMiredsValue, sizeof(entry.colorTemperatureMiredsValue)); + readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_LOOP_TIME_ATTRIBUTE_ID, "color loop time", + (uint8_t *) &entry.colorLoopTimeValue, sizeof(entry.colorLoopTimeValue)); + entry.hasColorTemperatureMiredsValue = + readServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID, "color temp mireds", + (uint8_t *) &entry.colorTemperatureMiredsValue, sizeof(entry.colorTemperatureMiredsValue)); #endif // ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #ifdef ZCL_USING_DOOR_LOCK_CLUSTER_SERVER - entry.hasLockStateValue = readServerAttribute(endpoint, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_LOCK_STATE_ATTRIBUTE_ID, "lock state", + entry.hasLockStateValue = readServerAttribute(endpoint, DoorLock::Id, ZCL_LOCK_STATE_ATTRIBUTE_ID, "lock state", (uint8_t *) &entry.lockStateValue, sizeof(entry.lockStateValue)); #endif #ifdef ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER - entry.hasCurrentPositionLiftPercentageValue = - readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, - "currentPositionLiftPercentage", (uint8_t *) &entry.currentPositionLiftPercentageValue, - sizeof(entry.currentPositionLiftPercentageValue)); - entry.hasCurrentPositionTiltPercentageValue = - readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, - "currentPositionTiltPercentage", (uint8_t *) &entry.currentPositionTiltPercentageValue, - sizeof(entry.currentPositionTiltPercentageValue)); - entry.hasTargetPositionLiftPercent100thsValue = - readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_TARGET_POSITION_LIFT_PERCENT100_THS_ATTRIBUTE_ID, - "targetPositionLiftPercent100ths", (uint8_t *) &entry.targetPositionLiftPercent100thsValue, - sizeof(entry.targetPositionLiftPercent100thsValue)); - entry.hasTargetPositionTiltPercent100thsValue = - readServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_TARGET_POSITION_TILT_PERCENT100_THS_ATTRIBUTE_ID, - "targetPositionTiltPercent100ths", (uint8_t *) &entry.targetPositionTiltPercent100thsValue, - sizeof(entry.targetPositionTiltPercent100thsValue)); + entry.hasCurrentPositionLiftPercentageValue = readServerAttribute( + endpoint, WindowCovering::Id, ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, "currentPositionLiftPercentage", + (uint8_t *) &entry.currentPositionLiftPercentageValue, sizeof(entry.currentPositionLiftPercentageValue)); + entry.hasCurrentPositionTiltPercentageValue = readServerAttribute( + endpoint, WindowCovering::Id, ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, "currentPositionTiltPercentage", + (uint8_t *) &entry.currentPositionTiltPercentageValue, sizeof(entry.currentPositionTiltPercentageValue)); + entry.hasTargetPositionLiftPercent100thsValue = readServerAttribute( + endpoint, WindowCovering::Id, ZCL_WC_TARGET_POSITION_LIFT_PERCENT100_THS_ATTRIBUTE_ID, "targetPositionLiftPercent100ths", + (uint8_t *) &entry.targetPositionLiftPercent100thsValue, sizeof(entry.targetPositionLiftPercent100thsValue)); + entry.hasTargetPositionTiltPercent100thsValue = readServerAttribute( + endpoint, WindowCovering::Id, ZCL_WC_TARGET_POSITION_TILT_PERCENT100_THS_ATTRIBUTE_ID, "targetPositionTiltPercent100ths", + (uint8_t *) &entry.targetPositionTiltPercent100thsValue, sizeof(entry.targetPositionTiltPercent100thsValue)); #endif // When creating a new entry, the name is set to the null string (i.e., the @@ -610,76 +602,76 @@ EmberAfStatus emberAfScenesClusterRecallSavedSceneCallback(chip::FabricIndex fab #ifdef ZCL_USING_ON_OFF_CLUSTER_SERVER if (entry.hasOnOffValue) { - writeServerAttribute(endpoint, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", - (uint8_t *) &entry.onOffValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + writeServerAttribute(endpoint, OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, "on/off", (uint8_t *) &entry.onOffValue, + ZCL_BOOLEAN_ATTRIBUTE_TYPE); } #endif #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER if (entry.hasCurrentLevelValue) { - writeServerAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, "current level", + writeServerAttribute(endpoint, LevelControl::Id, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, "current level", (uint8_t *) &entry.currentLevelValue, ZCL_INT8U_ATTRIBUTE_TYPE); } #endif #ifdef ZCL_USING_THERMOSTAT_CLUSTER_SERVER if (entry.hasOccupiedCoolingSetpointValue) { - writeServerAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, + writeServerAttribute(endpoint, Thermostat::Id, ZCL_OCCUPIED_COOLING_SETPOINT_ATTRIBUTE_ID, "occupied cooling setpoint", (uint8_t *) &entry.occupiedCoolingSetpointValue, ZCL_INT16S_ATTRIBUTE_TYPE); } if (entry.hasOccupiedHeatingSetpointValue) { - writeServerAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, + writeServerAttribute(endpoint, Thermostat::Id, ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID, "occupied heating setpoint", (uint8_t *) &entry.occupiedHeatingSetpointValue, ZCL_INT16S_ATTRIBUTE_TYPE); } if (entry.hasSystemModeValue) { - writeServerAttribute(endpoint, ZCL_THERMOSTAT_CLUSTER_ID, ZCL_SYSTEM_MODE_ATTRIBUTE_ID, "system mode", + writeServerAttribute(endpoint, Thermostat::Id, ZCL_SYSTEM_MODE_ATTRIBUTE_ID, "system mode", (uint8_t *) &entry.systemModeValue, ZCL_INT8U_ATTRIBUTE_TYPE); } #endif #ifdef ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER if (entry.hasCurrentXValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_X_ATTRIBUTE_ID, "current x", + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_X_ATTRIBUTE_ID, "current x", (uint8_t *) &entry.currentXValue, ZCL_INT16U_ATTRIBUTE_TYPE); } if (entry.hasCurrentYValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_Y_ATTRIBUTE_ID, "current y", + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_Y_ATTRIBUTE_ID, "current y", (uint8_t *) &entry.currentYValue, ZCL_INT16U_ATTRIBUTE_TYPE); } if (entry.hasEnhancedCurrentHueValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_ENHANCED_CURRENT_HUE_ATTRIBUTE_ID, + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_ENHANCED_CURRENT_HUE_ATTRIBUTE_ID, "enhanced current hue", (uint8_t *) &entry.enhancedCurrentHueValue, ZCL_INT16U_ATTRIBUTE_TYPE); } if (entry.hasCurrentSaturationValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID, "current saturation", (uint8_t *) &entry.currentSaturationValue, ZCL_INT8U_ATTRIBUTE_TYPE); } if (entry.hasColorLoopActiveValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_LOOP_ACTIVE_ATTRIBUTE_ID, + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_LOOP_ACTIVE_ATTRIBUTE_ID, "color loop active", (uint8_t *) &entry.colorLoopActiveValue, ZCL_INT8U_ATTRIBUTE_TYPE); } if (entry.hasColorLoopDirectionValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_LOOP_DIRECTION_ATTRIBUTE_ID, + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_LOOP_DIRECTION_ATTRIBUTE_ID, "color loop direction", (uint8_t *) &entry.colorLoopDirectionValue, ZCL_INT8U_ATTRIBUTE_TYPE); } if (entry.hasColorLoopTimeValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_LOOP_TIME_ATTRIBUTE_ID, - "color loop time", (uint8_t *) &entry.colorLoopTimeValue, ZCL_INT16U_ATTRIBUTE_TYPE); + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_LOOP_TIME_ATTRIBUTE_ID, "color loop time", + (uint8_t *) &entry.colorLoopTimeValue, ZCL_INT16U_ATTRIBUTE_TYPE); } if (entry.hasColorTemperatureMiredsValue) { - writeServerAttribute(endpoint, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID, + writeServerAttribute(endpoint, ColorControl::Id, ZCL_COLOR_CONTROL_COLOR_TEMPERATURE_ATTRIBUTE_ID, "color temp mireds", (uint8_t *) &entry.colorTemperatureMiredsValue, ZCL_INT16U_ATTRIBUTE_TYPE); } @@ -687,34 +679,34 @@ EmberAfStatus emberAfScenesClusterRecallSavedSceneCallback(chip::FabricIndex fab #ifdef ZCL_USING_DOOR_LOCK_CLUSTER_SERVER if (entry.hasLockStateValue) { - writeServerAttribute(endpoint, ZCL_DOOR_LOCK_CLUSTER_ID, ZCL_LOCK_STATE_ATTRIBUTE_ID, "lock state", + writeServerAttribute(endpoint, DoorLock::Id, ZCL_LOCK_STATE_ATTRIBUTE_ID, "lock state", (uint8_t *) &entry.lockStateValue, ZCL_INT8U_ATTRIBUTE_TYPE); } #endif #ifdef ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER if (entry.hasCurrentPositionLiftPercentageValue) { - writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, + writeServerAttribute(endpoint, WindowCovering::Id, ZCL_WC_CURRENT_POSITION_LIFT_PERCENTAGE_ATTRIBUTE_ID, "CurrentPositionLiftPercentage", (uint8_t *) &entry.currentPositionLiftPercentageValue, ZCL_INT8U_ATTRIBUTE_TYPE); } if (entry.hasCurrentPositionTiltPercentageValue) { - writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, + writeServerAttribute(endpoint, WindowCovering::Id, ZCL_WC_CURRENT_POSITION_TILT_PERCENTAGE_ATTRIBUTE_ID, "CurrentPositionTiltPercentage", (uint8_t *) &entry.currentPositionTiltPercentageValue, ZCL_INT8U_ATTRIBUTE_TYPE); } if (entry.hasTargetPositionLiftPercent100thsValue) { - writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, - ZCL_WC_TARGET_POSITION_LIFT_PERCENT100_THS_ATTRIBUTE_ID, "TargetPositionLiftPercent100ths", - (uint8_t *) &entry.targetPositionLiftPercent100thsValue, ZCL_INT16U_ATTRIBUTE_TYPE); + writeServerAttribute(endpoint, WindowCovering::Id, ZCL_WC_TARGET_POSITION_LIFT_PERCENT100_THS_ATTRIBUTE_ID, + "TargetPositionLiftPercent100ths", (uint8_t *) &entry.targetPositionLiftPercent100thsValue, + ZCL_INT16U_ATTRIBUTE_TYPE); } if (entry.hasTargetPositionTiltPercent100thsValue) { - writeServerAttribute(endpoint, ZCL_WINDOW_COVERING_CLUSTER_ID, - ZCL_WC_TARGET_POSITION_TILT_PERCENT100_THS_ATTRIBUTE_ID, "TargetPositionTiltPercent100ths", - (uint8_t *) &entry.targetPositionTiltPercent100thsValue, ZCL_INT16U_ATTRIBUTE_TYPE); + writeServerAttribute(endpoint, WindowCovering::Id, ZCL_WC_TARGET_POSITION_TILT_PERCENT100_THS_ATTRIBUTE_ID, + "TargetPositionTiltPercent100ths", (uint8_t *) &entry.targetPositionTiltPercent100thsValue, + ZCL_INT16U_ATTRIBUTE_TYPE); } #endif emberAfScenesMakeValid(endpoint, sceneId, groupId); @@ -837,7 +829,7 @@ bool emberAfPluginScenesServerParseAddScene( { #if 0 #ifdef ZCL_USING_ON_OFF_CLUSTER_SERVER - case ZCL_ON_OFF_CLUSTER_ID: + case OnOff::Id: // We only know of one extension for the On/Off cluster and it is just one // byte, which means we can skip some logic for this cluster. If other // extensions are added in this cluster, more logic will be needed here. @@ -846,7 +838,7 @@ bool emberAfPluginScenesServerParseAddScene( break; #endif #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER - case ZCL_LEVEL_CONTROL_CLUSTER_ID: + case LevelControl::Id: // We only know of one extension for the Level Control cluster and it is // just one byte, which means we can skip some logic for this cluster. If // other extensions are added in this cluster, more logic will be needed @@ -856,7 +848,7 @@ bool emberAfPluginScenesServerParseAddScene( break; #endif #ifdef ZCL_USING_THERMOSTAT_CLUSTER_SERVER - case ZCL_THERMOSTAT_CLUSTER_ID: + case Thermostat::Id: if (length < 2) { break; @@ -886,7 +878,7 @@ bool emberAfPluginScenesServerParseAddScene( break; #endif #ifdef ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER - case ZCL_COLOR_CONTROL_CLUSTER_ID: + case ColorControl::Id: if (length < 2) { break; @@ -960,7 +952,7 @@ bool emberAfPluginScenesServerParseAddScene( break; #endif // ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #ifdef ZCL_USING_DOOR_LOCK_CLUSTER_SERVER - case ZCL_DOOR_LOCK_CLUSTER_ID: + case DoorLock::Id: // We only know of one extension for the Door Lock cluster and it is just // one byte, which means we can skip some logic for this cluster. If // other extensions are added in this cluster, more logic will be needed @@ -970,7 +962,7 @@ bool emberAfPluginScenesServerParseAddScene( break; #endif #ifdef ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER - case ZCL_WINDOW_COVERING_CLUSTER_ID: + case WindowCovering::Id: // If we're here, we know we have at least one byte, so we can skip the // length check for the first field. entry.hasCurrentPositionLiftPercentageValue = true; @@ -1041,10 +1033,10 @@ bool emberAfPluginScenesServerParseAddScene( return true; } { - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, ZCL_ADD_SCENE_RESPONSE_COMMAND_ID }; + app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_ADD_SCENE_RESPONSE_COMMAND_ID }; if (enhanced) { - path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, ZCL_ENHANCED_ADD_SCENE_RESPONSE_COMMAND_ID }; + path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_ENHANCED_ADD_SCENE_RESPONSE_COMMAND_ID }; } TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = commandObj->PrepareCommand(path)); @@ -1097,10 +1089,10 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c // The status, group id, and scene id are always included in the response, but // the transition time, name, and extension fields are only included if the // scene was found. - app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, ZCL_VIEW_SCENE_RESPONSE_COMMAND_ID }; + app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_VIEW_SCENE_RESPONSE_COMMAND_ID }; if (enhanced) { - path = { emberAfCurrentEndpoint(), ZCL_SCENES_CLUSTER_ID, ZCL_ENHANCED_VIEW_SCENE_RESPONSE_COMMAND_ID }; + path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_ENHANCED_VIEW_SCENE_RESPONSE_COMMAND_ID }; } TLV::TLVWriter * writer = nullptr; SuccessOrExit(err = commandObj->PrepareCommand(path)); @@ -1135,7 +1127,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c #ifdef ZCL_USING_ON_OFF_CLUSTER_SERVER if (entry.hasOnOffValue) { - emberAfPutInt16uInResp(ZCL_ON_OFF_CLUSTER_ID); + emberAfPutInt16uInResp(OnOff::Id); emberAfPutInt8uInResp(1); // length emberAfPutInt8uInResp(entry.onOffValue); } @@ -1143,7 +1135,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c #ifdef ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER if (entry.hasCurrentLevelValue) { - emberAfPutInt16uInResp(ZCL_LEVEL_CONTROL_CLUSTER_ID); + emberAfPutInt16uInResp(LevelControl::Id); emberAfPutInt8uInResp(1); // length emberAfPutInt8uInResp(entry.currentLevelValue); } @@ -1152,7 +1144,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c if (entry.hasOccupiedCoolingSetpointValue) { uint8_t * length; - emberAfPutInt16uInResp(ZCL_THERMOSTAT_CLUSTER_ID); + emberAfPutInt16uInResp(Thermostat::Id); length = &appResponseData[appResponseLength]; emberAfPutInt8uInResp(0); // temporary length emberAfPutInt16sInResp(entry.occupiedCoolingSetpointValue); @@ -1173,7 +1165,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c if (entry.hasCurrentXValue) { uint8_t * length; - emberAfPutInt16uInResp(ZCL_COLOR_CONTROL_CLUSTER_ID); + emberAfPutInt16uInResp(ColorControl::Id); length = &appResponseData[appResponseLength]; emberAfPutInt8uInResp(0); // temporary length emberAfPutInt16uInResp(entry.currentXValue); @@ -1221,7 +1213,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c #ifdef ZCL_USING_DOOR_LOCK_CLUSTER_SERVER if (entry.hasLockStateValue) { - emberAfPutInt16uInResp(ZCL_DOOR_LOCK_CLUSTER_ID); + emberAfPutInt16uInResp(DoorLock::Id); emberAfPutInt8uInResp(1); // length emberAfPutInt8uInResp(entry.lockStateValue); } @@ -1230,7 +1222,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c if (entry.hasCurrentPositionLiftPercentageValue) { uint8_t * length; - emberAfPutInt16uInResp(ZCL_WINDOW_COVERING_CLUSTER_ID); + emberAfPutInt16uInResp(WindowCovering::Id); length = &appResponseData[appResponseLength]; emberAfPutInt8uInResp(0); // temporary length emberAfPutInt8uInResp(entry.currentPositionLiftPercentageValue); diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index c133e1514ca7de..fdb65b21c33fe0 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp b/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp index 5759a1fe65c4e9..b737888cc3e73d 100644 --- a/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp +++ b/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index 65237ba9b1211f..e32d75daeea49a 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index ea4ae8f0a22417..03327d0469b013 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -58,11 +58,6 @@ "name": "ZCL callback header", "output": "callback.h" }, - { - "path": "../../zap-templates/templates/app/cluster-id.zapt", - "name": "ZCL cluster-id header", - "output": "cluster-id.h" - }, { "path": "../../zap-templates/templates/app/command-id.zapt", "name": "ZCL command-id header", diff --git a/src/app/util/generic-callback-stubs.cpp b/src/app/util/generic-callback-stubs.cpp index 768ffb03871fea..ba8ee45b766ed5 100644 --- a/src/app/util/generic-callback-stubs.cpp +++ b/src/app/util/generic-callback-stubs.cpp @@ -16,7 +16,7 @@ */ #include -#include +#include #include #include diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 20e7122d1eaaab..c0a7e48e94f898 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -18,8 +18,8 @@ #include "app/util/common.h" #include #include -#include #include +#include #include #include #include @@ -51,8 +51,8 @@ uint32_t afNumPktsSent; #endif const EmberAfClusterName zclClusterNames[] = { - CLUSTER_IDS_TO_NAMES // defined in print-cluster.h - { ZCL_NULL_CLUSTER_ID, nullptr }, // terminator + CLUSTER_IDS_TO_NAMES // defined in print-cluster.h + { kInvalidClusterId, nullptr }, // terminator }; // A pointer to the current command being processed @@ -93,7 +93,7 @@ void emberAfSetDeviceEnabled(EndpointId endpoint, bool enabled) afDeviceEnabled[index] = enabled; } #ifdef ZCL_USING_BASIC_CLUSTER_DEVICE_ENABLED_ATTRIBUTE - emberAfWriteServerAttribute(endpoint, ZCL_BASIC_CLUSTER_ID, ZCL_DEVICE_ENABLED_ATTRIBUTE_ID, (uint8_t *) &enabled, + emberAfWriteServerAttribute(endpoint, app::Clusters::Basic::Id, ZCL_DEVICE_ENABLED_ATTRIBUTE_ID, (uint8_t *) &enabled, ZCL_BOOLEAN_ATTRIBUTE_TYPE); #endif } @@ -103,7 +103,7 @@ bool emberAfIsDeviceIdentifying(EndpointId endpoint) { #ifdef ZCL_USING_IDENTIFY_CLUSTER_SERVER uint16_t identifyTime; - EmberAfStatus status = emberAfReadServerAttribute(endpoint, ZCL_IDENTIFY_CLUSTER_ID, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, + EmberAfStatus status = emberAfReadServerAttribute(endpoint, app::Clusters::Identify::Id, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &identifyTime, sizeof(identifyTime)); return (status == EMBER_ZCL_STATUS_SUCCESS && 0 < identifyTime); #else @@ -230,7 +230,7 @@ uint16_t emberAfFindClusterNameIndex(ClusterId cluster) { static_assert(sizeof(ClusterId) == 4, "May need to adjust our index type or somehow define it in terms of cluster id type"); uint16_t index = 0; - while (zclClusterNames[index].id != ZCL_NULL_CLUSTER_ID) + while (zclClusterNames[index].id != kInvalidClusterId) { if (zclClusterNames[index].id == cluster) { diff --git a/src/app/util/util.h b/src/app/util/util.h index 54a2a224a2b1bd..0949aea7afef9b 100644 --- a/src/app/util/util.h +++ b/src/app/util/util.h @@ -50,8 +50,6 @@ typedef struct extern const EmberAfClusterName zclClusterNames[]; -#define ZCL_NULL_CLUSTER_ID 0xFFFF - #include // Override APS retry: 0 - don't touch, 1 - always set, 2 - always unset diff --git a/src/app/zap-templates/templates/app/print-cluster.zapt b/src/app/zap-templates/templates/app/print-cluster.zapt index c5d56577a31228..3d1a17d764d224 100644 --- a/src/app/zap-templates/templates/app/print-cluster.zapt +++ b/src/app/zap-templates/templates/app/print-cluster.zapt @@ -3,13 +3,15 @@ // Prevent multiple inclusion #pragma once +#include + // This is the mapping of IDs to cluster names assuming a format according // to the "EmberAfClusterName" defined in the ZCL header. // The names of clusters that are not present, are removed. {{#zcl_clusters}} #if defined(ZCL_USING_{{asDelimitedMacro this.define}}_SERVER) || defined(ZCL_USING_{{asDelimitedMacro this.define}}_CLIENT) - #define CHIP_PRINTCLUSTER_{{asDelimitedMacro this.define}} {ZCL_{{asDelimitedMacro this.define}}_ID, "{{this.label}}" }, + #define CHIP_PRINTCLUSTER_{{asDelimitedMacro this.define}} { chip::app::Clusters::{{asUpperCamelCase this.label}}::Id, "{{this.label}}" }, #else #define CHIP_PRINTCLUSTER_{{asDelimitedMacro this.define}} #endif diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h deleted file mode 100644 index 5833b9fadd0453..00000000000000 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h +++ /dev/null @@ -1,236 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// THIS FILE IS GENERATED BY ZAP - -// Prevent multiple inclusion -#pragma once - -#include - -// Definitions for cluster: Identify -static constexpr chip::ClusterId ZCL_IDENTIFY_CLUSTER_ID = 0x0003; - -// Definitions for cluster: Groups -static constexpr chip::ClusterId ZCL_GROUPS_CLUSTER_ID = 0x0004; - -// Definitions for cluster: Scenes -static constexpr chip::ClusterId ZCL_SCENES_CLUSTER_ID = 0x0005; - -// Definitions for cluster: On/Off -static constexpr chip::ClusterId ZCL_ON_OFF_CLUSTER_ID = 0x0006; - -// Definitions for cluster: On/off Switch Configuration -static constexpr chip::ClusterId ZCL_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_ID = 0x0007; - -// Definitions for cluster: Level Control -static constexpr chip::ClusterId ZCL_LEVEL_CONTROL_CLUSTER_ID = 0x0008; - -// Definitions for cluster: Binary Input (Basic) -static constexpr chip::ClusterId ZCL_BINARY_INPUT_BASIC_CLUSTER_ID = 0x000F; - -// Definitions for cluster: Pulse Width Modulation -static constexpr chip::ClusterId ZCL_PWM_CLUSTER_ID = 0x001C; - -// Definitions for cluster: Descriptor -static constexpr chip::ClusterId ZCL_DESCRIPTOR_CLUSTER_ID = 0x001D; - -// Definitions for cluster: Binding -static constexpr chip::ClusterId ZCL_BINDING_CLUSTER_ID = 0x001E; - -// Definitions for cluster: Access Control -static constexpr chip::ClusterId ZCL_ACCESS_CONTROL_CLUSTER_ID = 0x001F; - -// Definitions for cluster: Actions -static constexpr chip::ClusterId ZCL_ACTIONS_CLUSTER_ID = 0x0025; - -// Definitions for cluster: Basic -static constexpr chip::ClusterId ZCL_BASIC_CLUSTER_ID = 0x0028; - -// Definitions for cluster: OTA Software Update Provider -static constexpr chip::ClusterId ZCL_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_ID = 0x0029; - -// Definitions for cluster: OTA Software Update Requestor -static constexpr chip::ClusterId ZCL_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_ID = 0x002A; - -// Definitions for cluster: Localization Configuration -static constexpr chip::ClusterId ZCL_LOCALIZATION_CONFIGURATION_CLUSTER_ID = 0x002B; - -// Definitions for cluster: Time Format Localization -static constexpr chip::ClusterId ZCL_TIME_FORMAT_LOCALIZATION_CLUSTER_ID = 0x002C; - -// Definitions for cluster: Unit Localization -static constexpr chip::ClusterId ZCL_UNIT_LOCALIZATION_CLUSTER_ID = 0x002D; - -// Definitions for cluster: Power Source Configuration -static constexpr chip::ClusterId ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID = 0x002E; - -// Definitions for cluster: Power Source -static constexpr chip::ClusterId ZCL_POWER_SOURCE_CLUSTER_ID = 0x002F; - -// Definitions for cluster: General Commissioning -static constexpr chip::ClusterId ZCL_GENERAL_COMMISSIONING_CLUSTER_ID = 0x0030; - -// Definitions for cluster: Network Commissioning -static constexpr chip::ClusterId ZCL_NETWORK_COMMISSIONING_CLUSTER_ID = 0x0031; - -// Definitions for cluster: Diagnostic Logs -static constexpr chip::ClusterId ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID = 0x0032; - -// Definitions for cluster: General Diagnostics -static constexpr chip::ClusterId ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID = 0x0033; - -// Definitions for cluster: Software Diagnostics -static constexpr chip::ClusterId ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID = 0x0034; - -// Definitions for cluster: Thread Network Diagnostics -static constexpr chip::ClusterId ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID = 0x0035; - -// Definitions for cluster: WiFi Network Diagnostics -static constexpr chip::ClusterId ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID = 0x0036; - -// Definitions for cluster: Ethernet Network Diagnostics -static constexpr chip::ClusterId ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID = 0x0037; - -// Definitions for cluster: Time Synchronization -static constexpr chip::ClusterId ZCL_TIME_SYNCHRONIZATION_CLUSTER_ID = 0x0038; - -// Definitions for cluster: Bridged Device Basic -static constexpr chip::ClusterId ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID = 0x0039; - -// Definitions for cluster: Switch -static constexpr chip::ClusterId ZCL_SWITCH_CLUSTER_ID = 0x003B; - -// Definitions for cluster: AdministratorCommissioning -static constexpr chip::ClusterId ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID = 0x003C; - -// Definitions for cluster: Operational Credentials -static constexpr chip::ClusterId ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID = 0x003E; - -// Definitions for cluster: Group Key Management -static constexpr chip::ClusterId ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID = 0x003F; - -// Definitions for cluster: Fixed Label -static constexpr chip::ClusterId ZCL_FIXED_LABEL_CLUSTER_ID = 0x0040; - -// Definitions for cluster: User Label -static constexpr chip::ClusterId ZCL_USER_LABEL_CLUSTER_ID = 0x0041; - -// Definitions for cluster: Proxy Configuration -static constexpr chip::ClusterId ZCL_PROXY_CONFIGURATION_CLUSTER_ID = 0x0042; - -// Definitions for cluster: Proxy Discovery -static constexpr chip::ClusterId ZCL_PROXY_DISCOVERY_CLUSTER_ID = 0x0043; - -// Definitions for cluster: Proxy Valid -static constexpr chip::ClusterId ZCL_PROXY_VALID_CLUSTER_ID = 0x0044; - -// Definitions for cluster: Boolean State -static constexpr chip::ClusterId ZCL_BOOLEAN_STATE_CLUSTER_ID = 0x0045; - -// Definitions for cluster: Mode Select -static constexpr chip::ClusterId ZCL_MODE_SELECT_CLUSTER_ID = 0x0050; - -// Definitions for cluster: Door Lock -static constexpr chip::ClusterId ZCL_DOOR_LOCK_CLUSTER_ID = 0x0101; - -// Definitions for cluster: Window Covering -static constexpr chip::ClusterId ZCL_WINDOW_COVERING_CLUSTER_ID = 0x0102; - -// Definitions for cluster: Barrier Control -static constexpr chip::ClusterId ZCL_BARRIER_CONTROL_CLUSTER_ID = 0x0103; - -// Definitions for cluster: Pump Configuration and Control -static constexpr chip::ClusterId ZCL_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_ID = 0x0200; - -// Definitions for cluster: Thermostat -static constexpr chip::ClusterId ZCL_THERMOSTAT_CLUSTER_ID = 0x0201; - -// Definitions for cluster: Fan Control -static constexpr chip::ClusterId ZCL_FAN_CONTROL_CLUSTER_ID = 0x0202; - -// Definitions for cluster: Thermostat User Interface Configuration -static constexpr chip::ClusterId ZCL_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_ID = 0x0204; - -// Definitions for cluster: Color Control -static constexpr chip::ClusterId ZCL_COLOR_CONTROL_CLUSTER_ID = 0x0300; - -// Definitions for cluster: Ballast Configuration -static constexpr chip::ClusterId ZCL_BALLAST_CONFIGURATION_CLUSTER_ID = 0x0301; - -// Definitions for cluster: Illuminance Measurement -static constexpr chip::ClusterId ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID = 0x0400; - -// Definitions for cluster: Temperature Measurement -static constexpr chip::ClusterId ZCL_TEMPERATURE_MEASUREMENT_CLUSTER_ID = 0x0402; - -// Definitions for cluster: Pressure Measurement -static constexpr chip::ClusterId ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID = 0x0403; - -// Definitions for cluster: Flow Measurement -static constexpr chip::ClusterId ZCL_FLOW_MEASUREMENT_CLUSTER_ID = 0x0404; - -// Definitions for cluster: Relative Humidity Measurement -static constexpr chip::ClusterId ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID = 0x0405; - -// Definitions for cluster: Occupancy Sensing -static constexpr chip::ClusterId ZCL_OCCUPANCY_SENSING_CLUSTER_ID = 0x0406; - -// Definitions for cluster: Wake on LAN -static constexpr chip::ClusterId ZCL_WAKE_ON_LAN_CLUSTER_ID = 0x0503; - -// Definitions for cluster: Channel -static constexpr chip::ClusterId ZCL_CHANNEL_CLUSTER_ID = 0x0504; - -// Definitions for cluster: Target Navigator -static constexpr chip::ClusterId ZCL_TARGET_NAVIGATOR_CLUSTER_ID = 0x0505; - -// Definitions for cluster: Media Playback -static constexpr chip::ClusterId ZCL_MEDIA_PLAYBACK_CLUSTER_ID = 0x0506; - -// Definitions for cluster: Media Input -static constexpr chip::ClusterId ZCL_MEDIA_INPUT_CLUSTER_ID = 0x0507; - -// Definitions for cluster: Low Power -static constexpr chip::ClusterId ZCL_LOW_POWER_CLUSTER_ID = 0x0508; - -// Definitions for cluster: Keypad Input -static constexpr chip::ClusterId ZCL_KEYPAD_INPUT_CLUSTER_ID = 0x0509; - -// Definitions for cluster: Content Launcher -static constexpr chip::ClusterId ZCL_CONTENT_LAUNCHER_CLUSTER_ID = 0x050A; - -// Definitions for cluster: Audio Output -static constexpr chip::ClusterId ZCL_AUDIO_OUTPUT_CLUSTER_ID = 0x050B; - -// Definitions for cluster: Application Launcher -static constexpr chip::ClusterId ZCL_APPLICATION_LAUNCHER_CLUSTER_ID = 0x050C; - -// Definitions for cluster: Application Basic -static constexpr chip::ClusterId ZCL_APPLICATION_BASIC_CLUSTER_ID = 0x050D; - -// Definitions for cluster: Account Login -static constexpr chip::ClusterId ZCL_ACCOUNT_LOGIN_CLUSTER_ID = 0x050E; - -// Definitions for cluster: Electrical Measurement -static constexpr chip::ClusterId ZCL_ELECTRICAL_MEASUREMENT_CLUSTER_ID = 0x0B04; - -// Definitions for cluster: Unit Testing -static constexpr chip::ClusterId ZCL_UNIT_TESTING_CLUSTER_ID = 0xFFF1FC05; - -// Definitions for cluster: Fault Injection -static constexpr chip::ClusterId ZCL_FAULT_INJECTION_CLUSTER_ID = 0xFFF1FC06; diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 4ab05c73ae61de..c12c9c4da68c77 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -20,92 +20,94 @@ // Prevent multiple inclusion #pragma once +#include + // This is the mapping of IDs to cluster names assuming a format according // to the "EmberAfClusterName" defined in the ZCL header. // The names of clusters that are not present, are removed. #if defined(ZCL_USING_IDENTIFY_CLUSTER_SERVER) || defined(ZCL_USING_IDENTIFY_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER { ZCL_IDENTIFY_CLUSTER_ID, "Identify" }, +#define CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER { chip::app::Clusters::Identify::Id, "Identify" }, #else #define CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER #endif #if defined(ZCL_USING_GROUPS_CLUSTER_SERVER) || defined(ZCL_USING_GROUPS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GROUPS_CLUSTER { ZCL_GROUPS_CLUSTER_ID, "Groups" }, +#define CHIP_PRINTCLUSTER_GROUPS_CLUSTER { chip::app::Clusters::Groups::Id, "Groups" }, #else #define CHIP_PRINTCLUSTER_GROUPS_CLUSTER #endif #if defined(ZCL_USING_SCENES_CLUSTER_SERVER) || defined(ZCL_USING_SCENES_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SCENES_CLUSTER { ZCL_SCENES_CLUSTER_ID, "Scenes" }, +#define CHIP_PRINTCLUSTER_SCENES_CLUSTER { chip::app::Clusters::Scenes::Id, "Scenes" }, #else #define CHIP_PRINTCLUSTER_SCENES_CLUSTER #endif #if defined(ZCL_USING_ON_OFF_CLUSTER_SERVER) || defined(ZCL_USING_ON_OFF_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ON_OFF_CLUSTER { ZCL_ON_OFF_CLUSTER_ID, "On/Off" }, +#define CHIP_PRINTCLUSTER_ON_OFF_CLUSTER { chip::app::Clusters::OnOff::Id, "On/Off" }, #else #define CHIP_PRINTCLUSTER_ON_OFF_CLUSTER #endif #if defined(ZCL_USING_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_ON_OFF_SWITCH_CONFIGURATION_CLUSTER \ - { ZCL_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_ID, "On/off Switch Configuration" }, + { chip::app::Clusters::OnOffSwitchConfiguration::Id, "On/off Switch Configuration" }, #else #define CHIP_PRINTCLUSTER_ON_OFF_SWITCH_CONFIGURATION_CLUSTER #endif #if defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_LEVEL_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LEVEL_CONTROL_CLUSTER { ZCL_LEVEL_CONTROL_CLUSTER_ID, "Level Control" }, +#define CHIP_PRINTCLUSTER_LEVEL_CONTROL_CLUSTER { chip::app::Clusters::LevelControl::Id, "Level Control" }, #else #define CHIP_PRINTCLUSTER_LEVEL_CONTROL_CLUSTER #endif #if defined(ZCL_USING_BINARY_INPUT_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BINARY_INPUT_BASIC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BINARY_INPUT_BASIC_CLUSTER { ZCL_BINARY_INPUT_BASIC_CLUSTER_ID, "Binary Input (Basic)" }, +#define CHIP_PRINTCLUSTER_BINARY_INPUT_BASIC_CLUSTER { chip::app::Clusters::BinaryInputBasic::Id, "Binary Input (Basic)" }, #else #define CHIP_PRINTCLUSTER_BINARY_INPUT_BASIC_CLUSTER #endif #if defined(ZCL_USING_PWM_CLUSTER_SERVER) || defined(ZCL_USING_PWM_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PWM_CLUSTER { ZCL_PWM_CLUSTER_ID, "Pulse Width Modulation" }, +#define CHIP_PRINTCLUSTER_PWM_CLUSTER { chip::app::Clusters::PulseWidthModulation::Id, "Pulse Width Modulation" }, #else #define CHIP_PRINTCLUSTER_PWM_CLUSTER #endif #if defined(ZCL_USING_DESCRIPTOR_CLUSTER_SERVER) || defined(ZCL_USING_DESCRIPTOR_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER { ZCL_DESCRIPTOR_CLUSTER_ID, "Descriptor" }, +#define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER { chip::app::Clusters::Descriptor::Id, "Descriptor" }, #else #define CHIP_PRINTCLUSTER_DESCRIPTOR_CLUSTER #endif #if defined(ZCL_USING_BINDING_CLUSTER_SERVER) || defined(ZCL_USING_BINDING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { ZCL_BINDING_CLUSTER_ID, "Binding" }, +#define CHIP_PRINTCLUSTER_BINDING_CLUSTER { chip::app::Clusters::Binding::Id, "Binding" }, #else #define CHIP_PRINTCLUSTER_BINDING_CLUSTER #endif #if defined(ZCL_USING_ACCESS_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_ACCESS_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER { ZCL_ACCESS_CONTROL_CLUSTER_ID, "Access Control" }, +#define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER { chip::app::Clusters::AccessControl::Id, "Access Control" }, #else #define CHIP_PRINTCLUSTER_ACCESS_CONTROL_CLUSTER #endif #if defined(ZCL_USING_ACTIONS_CLUSTER_SERVER) || defined(ZCL_USING_ACTIONS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACTIONS_CLUSTER { ZCL_ACTIONS_CLUSTER_ID, "Actions" }, +#define CHIP_PRINTCLUSTER_ACTIONS_CLUSTER { chip::app::Clusters::Actions::Id, "Actions" }, #else #define CHIP_PRINTCLUSTER_ACTIONS_CLUSTER #endif #if defined(ZCL_USING_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BASIC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { ZCL_BASIC_CLUSTER_ID, "Basic" }, +#define CHIP_PRINTCLUSTER_BASIC_CLUSTER { chip::app::Clusters::Basic::Id, "Basic" }, #else #define CHIP_PRINTCLUSTER_BASIC_CLUSTER #endif #if defined(ZCL_USING_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER) || defined(ZCL_USING_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER \ - { ZCL_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_ID, "OTA Software Update Provider" }, + { chip::app::Clusters::OtaSoftwareUpdateProvider::Id, "OTA Software Update Provider" }, #else #define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER #endif @@ -113,186 +115,189 @@ #if defined(ZCL_USING_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_SERVER) || \ defined(ZCL_USING_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER \ - { ZCL_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_ID, "OTA Software Update Requestor" }, + { chip::app::Clusters::OtaSoftwareUpdateRequestor::Id, "OTA Software Update Requestor" }, #else #define CHIP_PRINTCLUSTER_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER #endif #if defined(ZCL_USING_LOCALIZATION_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_LOCALIZATION_CONFIGURATION_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_LOCALIZATION_CONFIGURATION_CLUSTER \ - { ZCL_LOCALIZATION_CONFIGURATION_CLUSTER_ID, "Localization Configuration" }, + { chip::app::Clusters::LocalizationConfiguration::Id, "Localization Configuration" }, #else #define CHIP_PRINTCLUSTER_LOCALIZATION_CONFIGURATION_CLUSTER #endif #if defined(ZCL_USING_TIME_FORMAT_LOCALIZATION_CLUSTER_SERVER) || defined(ZCL_USING_TIME_FORMAT_LOCALIZATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TIME_FORMAT_LOCALIZATION_CLUSTER { ZCL_TIME_FORMAT_LOCALIZATION_CLUSTER_ID, "Time Format Localization" }, +#define CHIP_PRINTCLUSTER_TIME_FORMAT_LOCALIZATION_CLUSTER \ + { chip::app::Clusters::TimeFormatLocalization::Id, "Time Format Localization" }, #else #define CHIP_PRINTCLUSTER_TIME_FORMAT_LOCALIZATION_CLUSTER #endif #if defined(ZCL_USING_UNIT_LOCALIZATION_CLUSTER_SERVER) || defined(ZCL_USING_UNIT_LOCALIZATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_UNIT_LOCALIZATION_CLUSTER { ZCL_UNIT_LOCALIZATION_CLUSTER_ID, "Unit Localization" }, +#define CHIP_PRINTCLUSTER_UNIT_LOCALIZATION_CLUSTER { chip::app::Clusters::UnitLocalization::Id, "Unit Localization" }, #else #define CHIP_PRINTCLUSTER_UNIT_LOCALIZATION_CLUSTER #endif #if defined(ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_POWER_SOURCE_CONFIGURATION_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_POWER_SOURCE_CONFIGURATION_CLUSTER \ - { ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID, "Power Source Configuration" }, + { chip::app::Clusters::PowerSourceConfiguration::Id, "Power Source Configuration" }, #else #define CHIP_PRINTCLUSTER_POWER_SOURCE_CONFIGURATION_CLUSTER #endif #if defined(ZCL_USING_POWER_SOURCE_CLUSTER_SERVER) || defined(ZCL_USING_POWER_SOURCE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_POWER_SOURCE_CLUSTER { ZCL_POWER_SOURCE_CLUSTER_ID, "Power Source" }, +#define CHIP_PRINTCLUSTER_POWER_SOURCE_CLUSTER { chip::app::Clusters::PowerSource::Id, "Power Source" }, #else #define CHIP_PRINTCLUSTER_POWER_SOURCE_CLUSTER #endif #if defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER { ZCL_GENERAL_COMMISSIONING_CLUSTER_ID, "General Commissioning" }, +#define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER { chip::app::Clusters::GeneralCommissioning::Id, "General Commissioning" }, #else #define CHIP_PRINTCLUSTER_GENERAL_COMMISSIONING_CLUSTER #endif #if defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { ZCL_NETWORK_COMMISSIONING_CLUSTER_ID, "Network Commissioning" }, +#define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER { chip::app::Clusters::NetworkCommissioning::Id, "Network Commissioning" }, #else #define CHIP_PRINTCLUSTER_NETWORK_COMMISSIONING_CLUSTER #endif #if defined(ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_SERVER) || defined(ZCL_USING_DIAGNOSTIC_LOGS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER { ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID, "Diagnostic Logs" }, +#define CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER { chip::app::Clusters::DiagnosticLogs::Id, "Diagnostic Logs" }, #else #define CHIP_PRINTCLUSTER_DIAGNOSTIC_LOGS_CLUSTER #endif #if defined(ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_GENERAL_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GENERAL_DIAGNOSTICS_CLUSTER { ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID, "General Diagnostics" }, +#define CHIP_PRINTCLUSTER_GENERAL_DIAGNOSTICS_CLUSTER { chip::app::Clusters::GeneralDiagnostics::Id, "General Diagnostics" }, #else #define CHIP_PRINTCLUSTER_GENERAL_DIAGNOSTICS_CLUSTER #endif #if defined(ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_SOFTWARE_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SOFTWARE_DIAGNOSTICS_CLUSTER { ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID, "Software Diagnostics" }, +#define CHIP_PRINTCLUSTER_SOFTWARE_DIAGNOSTICS_CLUSTER { chip::app::Clusters::SoftwareDiagnostics::Id, "Software Diagnostics" }, #else #define CHIP_PRINTCLUSTER_SOFTWARE_DIAGNOSTICS_CLUSTER #endif #if defined(ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_THREAD_NETWORK_DIAGNOSTICS_CLUSTER \ - { ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID, "Thread Network Diagnostics" }, + { chip::app::Clusters::ThreadNetworkDiagnostics::Id, "Thread Network Diagnostics" }, #else #define CHIP_PRINTCLUSTER_THREAD_NETWORK_DIAGNOSTICS_CLUSTER #endif #if defined(ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_WIFI_NETWORK_DIAGNOSTICS_CLUSTER { ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID, "WiFi Network Diagnostics" }, +#define CHIP_PRINTCLUSTER_WIFI_NETWORK_DIAGNOSTICS_CLUSTER \ + { chip::app::Clusters::WiFiNetworkDiagnostics::Id, "WiFi Network Diagnostics" }, #else #define CHIP_PRINTCLUSTER_WIFI_NETWORK_DIAGNOSTICS_CLUSTER #endif #if defined(ZCL_USING_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_SERVER) || defined(ZCL_USING_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER \ - { ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID, "Ethernet Network Diagnostics" }, + { chip::app::Clusters::EthernetNetworkDiagnostics::Id, "Ethernet Network Diagnostics" }, #else #define CHIP_PRINTCLUSTER_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER #endif #if defined(ZCL_USING_TIME_SYNCHRONIZATION_CLUSTER_SERVER) || defined(ZCL_USING_TIME_SYNCHRONIZATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TIME_SYNCHRONIZATION_CLUSTER { ZCL_TIME_SYNCHRONIZATION_CLUSTER_ID, "Time Synchronization" }, +#define CHIP_PRINTCLUSTER_TIME_SYNCHRONIZATION_CLUSTER { chip::app::Clusters::TimeSynchronization::Id, "Time Synchronization" }, #else #define CHIP_PRINTCLUSTER_TIME_SYNCHRONIZATION_CLUSTER #endif #if defined(ZCL_USING_BRIDGED_DEVICE_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_BRIDGED_DEVICE_BASIC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BRIDGED_DEVICE_BASIC_CLUSTER { ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, "Bridged Device Basic" }, +#define CHIP_PRINTCLUSTER_BRIDGED_DEVICE_BASIC_CLUSTER { chip::app::Clusters::BridgedDeviceBasic::Id, "Bridged Device Basic" }, #else #define CHIP_PRINTCLUSTER_BRIDGED_DEVICE_BASIC_CLUSTER #endif #if defined(ZCL_USING_SWITCH_CLUSTER_SERVER) || defined(ZCL_USING_SWITCH_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_SWITCH_CLUSTER { ZCL_SWITCH_CLUSTER_ID, "Switch" }, +#define CHIP_PRINTCLUSTER_SWITCH_CLUSTER { chip::app::Clusters::Switch::Id, "Switch" }, #else #define CHIP_PRINTCLUSTER_SWITCH_CLUSTER #endif #if defined(ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_SERVER) || defined(ZCL_USING_ADMINISTRATOR_COMMISSIONING_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_ADMINISTRATOR_COMMISSIONING_CLUSTER \ - { ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID, "AdministratorCommissioning" }, + { chip::app::Clusters::AdministratorCommissioning::Id, "AdministratorCommissioning" }, #else #define CHIP_PRINTCLUSTER_ADMINISTRATOR_COMMISSIONING_CLUSTER #endif #if defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER) || defined(ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER { ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, "Operational Credentials" }, +#define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER \ + { chip::app::Clusters::OperationalCredentials::Id, "Operational Credentials" }, #else #define CHIP_PRINTCLUSTER_OPERATIONAL_CREDENTIALS_CLUSTER #endif #if defined(ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER) || defined(ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_GROUP_KEY_MANAGEMENT_CLUSTER { ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID, "Group Key Management" }, +#define CHIP_PRINTCLUSTER_GROUP_KEY_MANAGEMENT_CLUSTER { chip::app::Clusters::GroupKeyManagement::Id, "Group Key Management" }, #else #define CHIP_PRINTCLUSTER_GROUP_KEY_MANAGEMENT_CLUSTER #endif #if defined(ZCL_USING_FIXED_LABEL_CLUSTER_SERVER) || defined(ZCL_USING_FIXED_LABEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FIXED_LABEL_CLUSTER { ZCL_FIXED_LABEL_CLUSTER_ID, "Fixed Label" }, +#define CHIP_PRINTCLUSTER_FIXED_LABEL_CLUSTER { chip::app::Clusters::FixedLabel::Id, "Fixed Label" }, #else #define CHIP_PRINTCLUSTER_FIXED_LABEL_CLUSTER #endif #if defined(ZCL_USING_USER_LABEL_CLUSTER_SERVER) || defined(ZCL_USING_USER_LABEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_USER_LABEL_CLUSTER { ZCL_USER_LABEL_CLUSTER_ID, "User Label" }, +#define CHIP_PRINTCLUSTER_USER_LABEL_CLUSTER { chip::app::Clusters::UserLabel::Id, "User Label" }, #else #define CHIP_PRINTCLUSTER_USER_LABEL_CLUSTER #endif #if defined(ZCL_USING_PROXY_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_PROXY_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PROXY_CONFIGURATION_CLUSTER { ZCL_PROXY_CONFIGURATION_CLUSTER_ID, "Proxy Configuration" }, +#define CHIP_PRINTCLUSTER_PROXY_CONFIGURATION_CLUSTER { chip::app::Clusters::ProxyConfiguration::Id, "Proxy Configuration" }, #else #define CHIP_PRINTCLUSTER_PROXY_CONFIGURATION_CLUSTER #endif #if defined(ZCL_USING_PROXY_DISCOVERY_CLUSTER_SERVER) || defined(ZCL_USING_PROXY_DISCOVERY_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER { ZCL_PROXY_DISCOVERY_CLUSTER_ID, "Proxy Discovery" }, +#define CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER { chip::app::Clusters::ProxyDiscovery::Id, "Proxy Discovery" }, #else #define CHIP_PRINTCLUSTER_PROXY_DISCOVERY_CLUSTER #endif #if defined(ZCL_USING_PROXY_VALID_CLUSTER_SERVER) || defined(ZCL_USING_PROXY_VALID_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER { ZCL_PROXY_VALID_CLUSTER_ID, "Proxy Valid" }, +#define CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER { chip::app::Clusters::ProxyValid::Id, "Proxy Valid" }, #else #define CHIP_PRINTCLUSTER_PROXY_VALID_CLUSTER #endif #if defined(ZCL_USING_BOOLEAN_STATE_CLUSTER_SERVER) || defined(ZCL_USING_BOOLEAN_STATE_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER { ZCL_BOOLEAN_STATE_CLUSTER_ID, "Boolean State" }, +#define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER { chip::app::Clusters::BooleanState::Id, "Boolean State" }, #else #define CHIP_PRINTCLUSTER_BOOLEAN_STATE_CLUSTER #endif #if defined(ZCL_USING_MODE_SELECT_CLUSTER_SERVER) || defined(ZCL_USING_MODE_SELECT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER { ZCL_MODE_SELECT_CLUSTER_ID, "Mode Select" }, +#define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER { chip::app::Clusters::ModeSelect::Id, "Mode Select" }, #else #define CHIP_PRINTCLUSTER_MODE_SELECT_CLUSTER #endif #if defined(ZCL_USING_DOOR_LOCK_CLUSTER_SERVER) || defined(ZCL_USING_DOOR_LOCK_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER { ZCL_DOOR_LOCK_CLUSTER_ID, "Door Lock" }, +#define CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER { chip::app::Clusters::DoorLock::Id, "Door Lock" }, #else #define CHIP_PRINTCLUSTER_DOOR_LOCK_CLUSTER #endif #if defined(ZCL_USING_WINDOW_COVERING_CLUSTER_SERVER) || defined(ZCL_USING_WINDOW_COVERING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER { ZCL_WINDOW_COVERING_CLUSTER_ID, "Window Covering" }, +#define CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER { chip::app::Clusters::WindowCovering::Id, "Window Covering" }, #else #define CHIP_PRINTCLUSTER_WINDOW_COVERING_CLUSTER #endif #if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER { ZCL_BARRIER_CONTROL_CLUSTER_ID, "Barrier Control" }, +#define CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER { chip::app::Clusters::BarrierControl::Id, "Barrier Control" }, #else #define CHIP_PRINTCLUSTER_BARRIER_CONTROL_CLUSTER #endif @@ -300,19 +305,19 @@ #if defined(ZCL_USING_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER) || \ defined(ZCL_USING_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER \ - { ZCL_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_ID, "Pump Configuration and Control" }, + { chip::app::Clusters::PumpConfigurationAndControl::Id, "Pump Configuration and Control" }, #else #define CHIP_PRINTCLUSTER_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER #endif #if defined(ZCL_USING_THERMOSTAT_CLUSTER_SERVER) || defined(ZCL_USING_THERMOSTAT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_THERMOSTAT_CLUSTER { ZCL_THERMOSTAT_CLUSTER_ID, "Thermostat" }, +#define CHIP_PRINTCLUSTER_THERMOSTAT_CLUSTER { chip::app::Clusters::Thermostat::Id, "Thermostat" }, #else #define CHIP_PRINTCLUSTER_THERMOSTAT_CLUSTER #endif #if defined(ZCL_USING_FAN_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_FAN_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FAN_CONTROL_CLUSTER { ZCL_FAN_CONTROL_CLUSTER_ID, "Fan Control" }, +#define CHIP_PRINTCLUSTER_FAN_CONTROL_CLUSTER { chip::app::Clusters::FanControl::Id, "Fan Control" }, #else #define CHIP_PRINTCLUSTER_FAN_CONTROL_CLUSTER #endif @@ -320,43 +325,45 @@ #if defined(ZCL_USING_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_SERVER) || \ defined(ZCL_USING_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER \ - { ZCL_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_ID, "Thermostat User Interface Configuration" }, + { chip::app::Clusters::ThermostatUserInterfaceConfiguration::Id, "Thermostat User Interface Configuration" }, #else #define CHIP_PRINTCLUSTER_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER #endif #if defined(ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER) || defined(ZCL_USING_COLOR_CONTROL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER { ZCL_COLOR_CONTROL_CLUSTER_ID, "Color Control" }, +#define CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER { chip::app::Clusters::ColorControl::Id, "Color Control" }, #else #define CHIP_PRINTCLUSTER_COLOR_CONTROL_CLUSTER #endif #if defined(ZCL_USING_BALLAST_CONFIGURATION_CLUSTER_SERVER) || defined(ZCL_USING_BALLAST_CONFIGURATION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER { ZCL_BALLAST_CONFIGURATION_CLUSTER_ID, "Ballast Configuration" }, +#define CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER { chip::app::Clusters::BallastConfiguration::Id, "Ballast Configuration" }, #else #define CHIP_PRINTCLUSTER_BALLAST_CONFIGURATION_CLUSTER #endif #if defined(ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ILLUMINANCE_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER { ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID, "Illuminance Measurement" }, +#define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER \ + { chip::app::Clusters::IlluminanceMeasurement::Id, "Illuminance Measurement" }, #else #define CHIP_PRINTCLUSTER_ILLUMINANCE_MEASUREMENT_CLUSTER #endif #if defined(ZCL_USING_TEMPERATURE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_TEMPERATURE_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TEMPERATURE_MEASUREMENT_CLUSTER { ZCL_TEMPERATURE_MEASUREMENT_CLUSTER_ID, "Temperature Measurement" }, +#define CHIP_PRINTCLUSTER_TEMPERATURE_MEASUREMENT_CLUSTER \ + { chip::app::Clusters::TemperatureMeasurement::Id, "Temperature Measurement" }, #else #define CHIP_PRINTCLUSTER_TEMPERATURE_MEASUREMENT_CLUSTER #endif #if defined(ZCL_USING_PRESSURE_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_PRESSURE_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER { ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID, "Pressure Measurement" }, +#define CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER { chip::app::Clusters::PressureMeasurement::Id, "Pressure Measurement" }, #else #define CHIP_PRINTCLUSTER_PRESSURE_MEASUREMENT_CLUSTER #endif #if defined(ZCL_USING_FLOW_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_FLOW_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER { ZCL_FLOW_MEASUREMENT_CLUSTER_ID, "Flow Measurement" }, +#define CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER { chip::app::Clusters::FlowMeasurement::Id, "Flow Measurement" }, #else #define CHIP_PRINTCLUSTER_FLOW_MEASUREMENT_CLUSTER #endif @@ -364,103 +371,104 @@ #if defined(ZCL_USING_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_SERVER) || \ defined(ZCL_USING_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER \ - { ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID, "Relative Humidity Measurement" }, + { chip::app::Clusters::RelativeHumidityMeasurement::Id, "Relative Humidity Measurement" }, #else #define CHIP_PRINTCLUSTER_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER #endif #if defined(ZCL_USING_OCCUPANCY_SENSING_CLUSTER_SERVER) || defined(ZCL_USING_OCCUPANCY_SENSING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_OCCUPANCY_SENSING_CLUSTER { ZCL_OCCUPANCY_SENSING_CLUSTER_ID, "Occupancy Sensing" }, +#define CHIP_PRINTCLUSTER_OCCUPANCY_SENSING_CLUSTER { chip::app::Clusters::OccupancySensing::Id, "Occupancy Sensing" }, #else #define CHIP_PRINTCLUSTER_OCCUPANCY_SENSING_CLUSTER #endif #if defined(ZCL_USING_WAKE_ON_LAN_CLUSTER_SERVER) || defined(ZCL_USING_WAKE_ON_LAN_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER { ZCL_WAKE_ON_LAN_CLUSTER_ID, "Wake on LAN" }, +#define CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER { chip::app::Clusters::WakeOnLan::Id, "Wake on LAN" }, #else #define CHIP_PRINTCLUSTER_WAKE_ON_LAN_CLUSTER #endif #if defined(ZCL_USING_CHANNEL_CLUSTER_SERVER) || defined(ZCL_USING_CHANNEL_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER { ZCL_CHANNEL_CLUSTER_ID, "Channel" }, +#define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER { chip::app::Clusters::Channel::Id, "Channel" }, #else #define CHIP_PRINTCLUSTER_CHANNEL_CLUSTER #endif #if defined(ZCL_USING_TARGET_NAVIGATOR_CLUSTER_SERVER) || defined(ZCL_USING_TARGET_NAVIGATOR_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER { ZCL_TARGET_NAVIGATOR_CLUSTER_ID, "Target Navigator" }, +#define CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER { chip::app::Clusters::TargetNavigator::Id, "Target Navigator" }, #else #define CHIP_PRINTCLUSTER_TARGET_NAVIGATOR_CLUSTER #endif #if defined(ZCL_USING_MEDIA_PLAYBACK_CLUSTER_SERVER) || defined(ZCL_USING_MEDIA_PLAYBACK_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER { ZCL_MEDIA_PLAYBACK_CLUSTER_ID, "Media Playback" }, +#define CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER { chip::app::Clusters::MediaPlayback::Id, "Media Playback" }, #else #define CHIP_PRINTCLUSTER_MEDIA_PLAYBACK_CLUSTER #endif #if defined(ZCL_USING_MEDIA_INPUT_CLUSTER_SERVER) || defined(ZCL_USING_MEDIA_INPUT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER { ZCL_MEDIA_INPUT_CLUSTER_ID, "Media Input" }, +#define CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER { chip::app::Clusters::MediaInput::Id, "Media Input" }, #else #define CHIP_PRINTCLUSTER_MEDIA_INPUT_CLUSTER #endif #if defined(ZCL_USING_LOW_POWER_CLUSTER_SERVER) || defined(ZCL_USING_LOW_POWER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER { ZCL_LOW_POWER_CLUSTER_ID, "Low Power" }, +#define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER { chip::app::Clusters::LowPower::Id, "Low Power" }, #else #define CHIP_PRINTCLUSTER_LOW_POWER_CLUSTER #endif #if defined(ZCL_USING_KEYPAD_INPUT_CLUSTER_SERVER) || defined(ZCL_USING_KEYPAD_INPUT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_KEYPAD_INPUT_CLUSTER { ZCL_KEYPAD_INPUT_CLUSTER_ID, "Keypad Input" }, +#define CHIP_PRINTCLUSTER_KEYPAD_INPUT_CLUSTER { chip::app::Clusters::KeypadInput::Id, "Keypad Input" }, #else #define CHIP_PRINTCLUSTER_KEYPAD_INPUT_CLUSTER #endif #if defined(ZCL_USING_CONTENT_LAUNCHER_CLUSTER_SERVER) || defined(ZCL_USING_CONTENT_LAUNCHER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_CONTENT_LAUNCHER_CLUSTER { ZCL_CONTENT_LAUNCHER_CLUSTER_ID, "Content Launcher" }, +#define CHIP_PRINTCLUSTER_CONTENT_LAUNCHER_CLUSTER { chip::app::Clusters::ContentLauncher::Id, "Content Launcher" }, #else #define CHIP_PRINTCLUSTER_CONTENT_LAUNCHER_CLUSTER #endif #if defined(ZCL_USING_AUDIO_OUTPUT_CLUSTER_SERVER) || defined(ZCL_USING_AUDIO_OUTPUT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_AUDIO_OUTPUT_CLUSTER { ZCL_AUDIO_OUTPUT_CLUSTER_ID, "Audio Output" }, +#define CHIP_PRINTCLUSTER_AUDIO_OUTPUT_CLUSTER { chip::app::Clusters::AudioOutput::Id, "Audio Output" }, #else #define CHIP_PRINTCLUSTER_AUDIO_OUTPUT_CLUSTER #endif #if defined(ZCL_USING_APPLICATION_LAUNCHER_CLUSTER_SERVER) || defined(ZCL_USING_APPLICATION_LAUNCHER_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER { ZCL_APPLICATION_LAUNCHER_CLUSTER_ID, "Application Launcher" }, +#define CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER { chip::app::Clusters::ApplicationLauncher::Id, "Application Launcher" }, #else #define CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER #endif #if defined(ZCL_USING_APPLICATION_BASIC_CLUSTER_SERVER) || defined(ZCL_USING_APPLICATION_BASIC_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER { ZCL_APPLICATION_BASIC_CLUSTER_ID, "Application Basic" }, +#define CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER { chip::app::Clusters::ApplicationBasic::Id, "Application Basic" }, #else #define CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER #endif #if defined(ZCL_USING_ACCOUNT_LOGIN_CLUSTER_SERVER) || defined(ZCL_USING_ACCOUNT_LOGIN_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER { ZCL_ACCOUNT_LOGIN_CLUSTER_ID, "Account Login" }, +#define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER { chip::app::Clusters::AccountLogin::Id, "Account Login" }, #else #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif #if defined(ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_SERVER) || defined(ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER { ZCL_ELECTRICAL_MEASUREMENT_CLUSTER_ID, "Electrical Measurement" }, +#define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ + { chip::app::Clusters::ElectricalMeasurement::Id, "Electrical Measurement" }, #else #define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER #endif #if defined(ZCL_USING_UNIT_TESTING_CLUSTER_SERVER) || defined(ZCL_USING_UNIT_TESTING_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER { ZCL_UNIT_TESTING_CLUSTER_ID, "Unit Testing" }, +#define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER { chip::app::Clusters::UnitTesting::Id, "Unit Testing" }, #else #define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER #endif #if defined(ZCL_USING_FAULT_INJECTION_CLUSTER_SERVER) || defined(ZCL_USING_FAULT_INJECTION_CLUSTER_CLIENT) -#define CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER { ZCL_FAULT_INJECTION_CLUSTER_ID, "Fault Injection" }, +#define CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER { chip::app::Clusters::FaultInjection::Id, "Fault Injection" }, #else #define CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER #endif From 07490806709b03b4574c26d31c26579ddb9f9be8 Mon Sep 17 00:00:00 2001 From: FernandoLGuzman <31297194+FernandoLGuzman@users.noreply.github.com> Date: Thu, 1 Dec 2022 05:41:55 -0800 Subject: [PATCH 02/30] Increase chef cloud build timeout to 5 hours (#23843) --- integrations/cloudbuild/chef.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index dcab96539dc693..7fcdb111ed8e0f 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -53,7 +53,7 @@ steps: logsBucket: matter-build-automation-build-logs # Global timeout for all steps -timeout: 14400s +timeout: 18000s queueTtl: 21600s artifacts: From 0493fc32aef12c254ded406815142835674fadaf Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 08:42:45 -0500 Subject: [PATCH 03/30] Remove emberAfSetDeviceEnabled. (#23851) This function does two things: 1) Write to afDeviceEnabled, which nothing reads. 2) If needed set the ZCL_DEVICE_ENABLED_ATTRIBUTE_ID attribute, which does not exist in Matter. --- src/app/util/af.h | 10 ---------- src/app/util/attribute-storage.cpp | 2 -- src/app/util/util.cpp | 20 -------------------- 3 files changed, 32 deletions(-) diff --git a/src/app/util/af.h b/src/app/util/af.h index 043c5e80ebe5bb..9c9bad4b3f1345 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -303,16 +303,6 @@ void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, size_t size); */ bool emberAfIsDeviceIdentifying(chip::EndpointId endpoint); -/** - * @brief Function that enables or disables an endpoint. - * - * By calling this function, you turn off all processing of incoming traffic - * for a given endpoint. - * - * @param endpoint Zigbee endpoint number - */ -void emberAfSetDeviceEnabled(chip::EndpointId endpoint, bool enabled); - /** @} END Device Control */ /** @name Miscellaneous */ diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 661c97308e7866..d9b76dec4101af 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -242,7 +242,6 @@ EmberAfStatus emberAfSetDynamicEndpoint(uint16_t index, EndpointId id, const Emb // Now enable the endpoint. emberAfEndpointEnableDisable(id, true); - emberAfSetDeviceEnabled(id, true); return EMBER_ZCL_STATUS_SUCCESS; } @@ -257,7 +256,6 @@ EndpointId emberAfClearDynamicEndpoint(uint16_t index) (emberAfEndpointIndexIsEnabled(index))) { ep = emAfEndpoints[index].endpoint; - emberAfSetDeviceEnabled(ep, false); emberAfEndpointEnableDisable(ep, false); emAfEndpoints[index].endpoint = kInvalidEndpointId; } diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index c0a7e48e94f898..1115b776d5f2e8 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -41,9 +41,6 @@ using namespace chip; //------------------------------------------------------------------------------ // Globals -// Storage and functions for turning on and off devices -bool afDeviceEnabled[MAX_ENDPOINT_COUNT]; - #ifdef EMBER_AF_ENABLE_STATISTICS // a variable containing the number of messages send from the utilities // since emberAfInit was called. @@ -83,21 +80,6 @@ EMBER_AF_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS //------------------------------------------------------------------------------ -// Device enabled/disabled functions - -void emberAfSetDeviceEnabled(EndpointId endpoint, bool enabled) -{ - uint16_t index = emberAfIndexFromEndpoint(endpoint); - if (index != 0xFFFF && index < sizeof(afDeviceEnabled)) - { - afDeviceEnabled[index] = enabled; - } -#ifdef ZCL_USING_BASIC_CLUSTER_DEVICE_ENABLED_ATTRIBUTE - emberAfWriteServerAttribute(endpoint, app::Clusters::Basic::Id, ZCL_DEVICE_ENABLED_ATTRIBUTE_ID, (uint8_t *) &enabled, - ZCL_BOOLEAN_ATTRIBUTE_TYPE); -#endif -} - // Is the device identifying? bool emberAfIsDeviceIdentifying(EndpointId endpoint) { @@ -167,8 +149,6 @@ void emberAfInit(chip::Messaging::ExchangeManager * exchangeMgr) // emberAfPopNetworkIndex(); } - memset(afDeviceEnabled, true, emberAfEndpointCount()); - MATTER_PLUGINS_INIT emAfCallInits(); From 7b3a9fc0088f08fbc9b1baa83b6f1a8241d9445d Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 1 Dec 2022 17:09:24 +0200 Subject: [PATCH 04/30] [Telink] Add shell commands support (#23796) * Added shell CLI command "matter factoryreset" to Telink lighting-app * [Telink] Restyled * [Telink] use correct zephyr include path * [Telink] reverted to using default shell commands set Co-authored-by: Dmytro Huz --- config/telink/app/zephyr.conf | 3 ++- src/lib/shell/MainLoopZephyr.cpp | 4 ++-- src/lib/shell/streamer_zephyr.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/telink/app/zephyr.conf b/config/telink/app/zephyr.conf index c83f5aeccca9c4..bd920eff8b4d49 100644 --- a/config/telink/app/zephyr.conf +++ b/config/telink/app/zephyr.conf @@ -106,5 +106,6 @@ CONFIG_DYNAMIC_INTERRUPTS=y # nvs_sector_size = flash_page_size * mult = 256 * 8 = 2048 CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=8 -# Shall settings +# Shell settings +CONFIG_SHELL=n CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255 \ No newline at end of file diff --git a/src/lib/shell/MainLoopZephyr.cpp b/src/lib/shell/MainLoopZephyr.cpp index e70a29c52c9dce..17b5d8438499a5 100644 --- a/src/lib/shell/MainLoopZephyr.cpp +++ b/src/lib/shell/MainLoopZephyr.cpp @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#include +#include +#include #include #include diff --git a/src/lib/shell/streamer_zephyr.cpp b/src/lib/shell/streamer_zephyr.cpp index 40a16d56fbbd94..aad69438ab24b0 100644 --- a/src/lib/shell/streamer_zephyr.cpp +++ b/src/lib/shell/streamer_zephyr.cpp @@ -24,8 +24,8 @@ #include -#include -#include +#include +#include namespace chip { namespace Shell { From fad4f23f1b5174bfb6165b54a767f3114f7708e4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 10:37:38 -0500 Subject: [PATCH 05/30] Add NS_ASSUME_NONNULL_BEGIN to MTRCallbackBridgeBase_internal. (#23849) This way we can explicitly annotate which bits might be null. For some of the block pointers we apparently need to explicitly specify _Nonnull even with NS_ASSUME_NONNULL_BEGIN. Maybe because of the templating involved. --- .../CHIP/MTRCallbackBridgeBase_internal.h | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h index 31ac86e348f8bc..2205023338a214 100644 --- a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h +++ b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h @@ -27,6 +27,8 @@ #include #include +NS_ASSUME_NONNULL_BEGIN + /** * Bridge that allows invoking a given MTRActionBlock on the Matter queue, after * communication with the device in question has been established, as far as we @@ -35,11 +37,7 @@ class MTRCallbackBridgeBase { }; -// TODO: ADD NS_ASSUME_NONNULL_BEGIN to this header. When that happens, note -// that in MTRActionBlock the two callback pointers are nonnull and the two -// arguments of MTRResponseHandler are both nullable. - -typedef void (^MTRResponseHandler)(id value, NSError * error); +typedef void (^MTRResponseHandler)(id _Nullable value, NSError * _Nullable error); typedef void (*MTRErrorCallback)(void * context, CHIP_ERROR error); /** @@ -85,7 +83,7 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { * Construct a callback bridge, which can then have DispatchAction() called * on it. */ - MTRCallbackBridge(dispatch_queue_t queue, MTRResponseHandler handler, MTRActionBlock action, T OnSuccessFn) + MTRCallbackBridge(dispatch_queue_t queue, MTRResponseHandler handler, MTRActionBlock _Nonnull action, T OnSuccessFn) : mQueue(queue) , mHandler(handler) , mAction(action) @@ -130,7 +128,7 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { * Does not attempt to establish any sessions to devices. Must not be used * with any action blocks that need a session. */ - void DispatchLocalAction(MTRLocalActionBlock action) + void DispatchLocalAction(MTRLocalActionBlock _Nonnull action) { LogRequestStart(); @@ -187,8 +185,8 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { ChipLogDetail(Controller, "%s", mCookie.UTF8String); } - void MaybeDoAction( - chip::Messaging::ExchangeManager * exchangeManager, const chip::Optional & session, NSError * error) + void MaybeDoAction(chip::Messaging::ExchangeManager * _Nullable exchangeManager, + const chip::Optional & session, NSError * _Nullable error) { // Make sure we don't hold on to our action longer than we have to. auto action = mAction; @@ -213,7 +211,7 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { static void OnFailureFn(void * context, CHIP_ERROR error) { DispatchFailure(context, [MTRError errorForCHIPErrorCode:error]); } - static void DispatchSuccess(void * context, id value) { DispatchCallbackResult(context, nil, value); } + static void DispatchSuccess(void * context, id _Nullable value) { DispatchCallbackResult(context, nil, value); } static void DispatchFailure(void * context, NSError * error) { DispatchCallbackResult(context, error, nil); } @@ -241,7 +239,7 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { dispatch_queue_t mQueue; private: - static void DispatchCallbackResult(void * context, NSError * error, id value) + static void DispatchCallbackResult(void * context, NSError * _Nullable error, id _Nullable value) { MTRCallbackBridge * callbackBridge = static_cast(context); if (!callbackBridge) { @@ -267,7 +265,7 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { } MTRResponseHandler mHandler; - MTRActionBlock mAction; + MTRActionBlock _Nullable mAction; bool mKeepAlive = false; T mSuccess; @@ -277,3 +275,5 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { NSDate * mRequestTime; NSString * mCookie; }; + +NS_ASSUME_NONNULL_END From 5f1e4e1670c43215afcc65b291c4f2c9d89d74cc Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Thu, 1 Dec 2022 22:17:42 +0530 Subject: [PATCH 06/30] [Silabs] SiWx917 platform changes (#23799) * Lighting app changes for SiWx917 * examples platform folder changes for SiWx917 * source platform changes for SiWx917 * third_party folder changes for CCP * Restyle plus some extra changes * Spell checks corrected * Address review comments * Restyling the PR --- examples/lighting-app/silabs/SiWx917/BUILD.gn | 71 +- examples/lighting-app/silabs/SiWx917/args.gni | 2 +- .../silabs/SiWx917/build_for_wifi_args.gni | 2 +- .../silabs/SiWx917/include/AppConfig.h | 2 +- .../silabs/SiWx917/include/AppTask.h | 11 - .../silabs/SiWx917/src/AppTask.cpp | 62 +- .../lighting-app/silabs/SiWx917/src/main.cpp | 24 +- .../silabs/SiWx917/with_pw_rpc.gni | 2 +- examples/platform/silabs/SiWx917/BUILD.gn | 26 +- .../silabs/SiWx917/BaseApplication.cpp | 165 +- .../platform/silabs/SiWx917/BaseApplication.h | 11 - .../platform/silabs/SiWx917/FreeRTOSConfig.h | 28 +- .../SiWx917/{rs911x => SiWx917}/hal/rsi_hal.h | 6 - .../SiWx917/hal/rsi_hal_mcu_platform_init.c | 113 + .../hal/rsi_hal_mcu_timer.c | 223 +- .../SiWx917/{rs911x => SiWx917}/rs911x.gni | 75 +- .../SiWx917/{rs911x => SiWx917}/rsi_if.c | 112 +- .../{rs911x => SiWx917}/rsi_wlan_config.h | 112 +- .../SiWx917/{rs911x => SiWx917}/wfx_rsi.h | 12 +- .../{rs911x => SiWx917}/wfx_rsi_host.c | 11 +- .../SiWx917/{rs911x => SiWx917}/wfx_rsidev.c | 2 +- ...ider.cpp => SiWx917DeviceDataProvider.cpp} | 2 +- ...Provider.h => SiWx917DeviceDataProvider.h} | 0 .../silabs/SiWx917/TemperatureSensor.cpp | 49 - .../platform/silabs/SiWx917/board_config.h | 2 +- .../silabs/SiWx917/device/inc/system_si917.h | 167 ++ .../SiWx917/device/src/startup_RS1xxxx.c | 530 +++++ .../silabs/SiWx917/device/src/startup_si917.c | 403 ++++ ...mperatureSensor.h => init_ccpPlatform.cpp} | 32 +- ...{init_efrPlatform.h => init_ccpPlatform.h} | 3 +- .../silabs/SiWx917/init_efrPlatform.cpp | 86 - .../ldscripts/{efr32mg12.ld => SiWx917.ld} | 43 +- .../silabs/SiWx917/ldscripts/efr32mg21.ld | 289 --- .../silabs/SiWx917/ldscripts/efr32mg24.ld | 243 --- .../silabs/SiWx917/ldscripts/mgm24.ld | 243 --- .../platform/silabs/SiWx917/matter_config.cpp | 120 +- .../platform/silabs/SiWx917/matter_config.h | 2 +- .../project_include/OpenThreadConfig.h | 77 - .../silabs/SiWx917/pw_sys_io/BUILD.gn | 2 +- .../{sys_io_efr32.cc => sys_io_siwx917.cc} | 0 .../silabs/SiWx917/rs911x/hal/efx_spi.c | 324 --- .../rs911x/hal/rsi_board_configuration.h | 43 - .../rs911x/hal/rsi_hal_mcu_interrupt.c | 161 -- .../SiWx917/rs911x/hal/rsi_hal_mcu_ioports.c | 141 -- .../SiWx917/rs911x/hal/rsi_hal_mcu_rtc.c | 326 --- .../{efr32_utils.cpp => siwx917_utils.cpp} | 5 +- .../{efr32_utils.h => siwx917_utils.h} | 2 +- examples/platform/silabs/SiWx917/uart.cpp | 236 +-- examples/platform/silabs/SiWx917/uart.h | 7 - .../platform/silabs/SiWx917/wf200/efr_spi.c | 426 ---- .../platform/silabs/SiWx917/wf200/host_if.cpp | 1270 ----------- .../silabs/SiWx917/wf200/sl_wfx_board.h | 34 - .../SiWx917/wf200/sl_wfx_configuration.h | 30 - .../silabs/SiWx917/wf200/sl_wfx_crypto.c | 409 ---- .../silabs/SiWx917/wf200/sl_wfx_host.h | 52 - .../SiWx917/wf200/sl_wfx_securelink_task.c | 85 - .../silabs/SiWx917/wf200/sl_wfx_task.c | 128 -- .../silabs/SiWx917/wf200/sl_wfx_task.h | 57 - .../platform/silabs/SiWx917/wf200/wf200.gni | 30 - .../silabs/SiWx917/wf200/wf200_init.c | 543 ----- src/platform/BUILD.gn | 7 + src/platform/device.gni | 4 +- src/platform/silabs/BLEManagerImpl.h | 39 +- src/platform/silabs/CHIPMem-Platform.cpp | 5 + .../silabs/ConnectivityManagerImpl_WIFI.cpp | 2 + .../silabs/SiWx917/BLEManagerImpl.cpp | 614 +++--- src/platform/silabs/SiWx917/BUILD.gn | 53 +- .../silabs/SiWx917/CHIPCryptoPALPsaEfr32.cpp | 1879 ----------------- .../SiWx917/ConfigurationManagerImpl.cpp | 6 +- .../SiWx917/ConnectivityManagerImpl.cpp | 74 - .../silabs/SiWx917/Efr32OpaqueKeypair.h | 224 -- .../silabs/SiWx917/Efr32PsaOpaqueKeypair.cpp | 452 ---- .../SiWx917/Efr32PsaOperationalKeystore.cpp | 455 ---- .../SiWx917/Efr32PsaOperationalKeystore.h | 145 -- .../silabs/SiWx917/PlatformManagerImpl.cpp | 22 + .../silabs/SiWx917/ThreadStackManagerImpl.cpp | 173 -- src/platform/silabs/SiWx917/args.gni | 11 +- .../silabs/SiWx917/bluetooth/rsi_ble_config.h | 269 +++ .../SiWx917/bluetooth/wfx_sl_ble_init.c | 539 +++++ .../SiWx917/bluetooth/wfx_sl_ble_init.h | 121 ++ .../SiWx917/efr32-mbedtls-psa-crypto-config.h | 78 - ...config.h => siwx917-chip-mbedtls-config.h} | 47 +- .../silabs/SiWx917/wifi/dhcp_client.cpp | 6 - .../silabs/SiWx917/wifi/ethernetif.cpp | 147 +- src/platform/silabs/SiWx917/wifi/ethernetif.h | 5 +- .../silabs/SiWx917/wifi/lwip_netif.cpp | 6 - .../silabs/SiWx917/wifi/wfx_host_events.h | 101 +- .../silabs/SiWx917/wifi/wfx_notify.cpp | 7 - src/platform/silabs/SiWx917/wifi_args.gni | 9 +- third_party/silabs/BUILD.gn | 8 +- third_party/silabs/SiWx917_sdk.gni | 743 ++----- third_party/silabs/efr32_arm.gni | 2 +- third_party/silabs/silabs_board.gni | 3 + 93 files changed, 3041 insertions(+), 10889 deletions(-) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/hal/rsi_hal.h (94%) create mode 100644 examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_platform_init.c rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/hal/rsi_hal_mcu_timer.c (54%) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/rs911x.gni (54%) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/rsi_if.c (92%) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/rsi_wlan_config.h (84%) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/wfx_rsi.h (85%) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/wfx_rsi_host.c (99%) rename examples/platform/silabs/SiWx917/{rs911x => SiWx917}/wfx_rsidev.c (99%) rename examples/platform/silabs/SiWx917/{EFR32DeviceDataProvider.cpp => SiWx917DeviceDataProvider.cpp} (99%) rename examples/platform/silabs/SiWx917/{EFR32DeviceDataProvider.h => SiWx917DeviceDataProvider.h} (100%) delete mode 100644 examples/platform/silabs/SiWx917/TemperatureSensor.cpp create mode 100644 examples/platform/silabs/SiWx917/device/inc/system_si917.h create mode 100644 examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c create mode 100644 examples/platform/silabs/SiWx917/device/src/startup_si917.c rename examples/platform/silabs/SiWx917/{TemperatureSensor.h => init_ccpPlatform.cpp} (64%) rename examples/platform/silabs/SiWx917/{init_efrPlatform.h => init_ccpPlatform.h} (96%) delete mode 100644 examples/platform/silabs/SiWx917/init_efrPlatform.cpp rename examples/platform/silabs/SiWx917/ldscripts/{efr32mg12.ld => SiWx917.ld} (74%) delete mode 100644 examples/platform/silabs/SiWx917/ldscripts/efr32mg21.ld delete mode 100644 examples/platform/silabs/SiWx917/ldscripts/efr32mg24.ld delete mode 100644 examples/platform/silabs/SiWx917/ldscripts/mgm24.ld delete mode 100644 examples/platform/silabs/SiWx917/project_include/OpenThreadConfig.h rename examples/platform/silabs/SiWx917/pw_sys_io/{sys_io_efr32.cc => sys_io_siwx917.cc} (100%) delete mode 100644 examples/platform/silabs/SiWx917/rs911x/hal/efx_spi.c delete mode 100644 examples/platform/silabs/SiWx917/rs911x/hal/rsi_board_configuration.h delete mode 100644 examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_interrupt.c delete mode 100644 examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_ioports.c delete mode 100644 examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_rtc.c rename examples/platform/silabs/SiWx917/{efr32_utils.cpp => siwx917_utils.cpp} (91%) rename examples/platform/silabs/SiWx917/{efr32_utils.h => siwx917_utils.h} (98%) delete mode 100644 examples/platform/silabs/SiWx917/wf200/efr_spi.c delete mode 100644 examples/platform/silabs/SiWx917/wf200/host_if.cpp delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_board.h delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_configuration.h delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_crypto.c delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_host.h delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_securelink_task.c delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_task.c delete mode 100644 examples/platform/silabs/SiWx917/wf200/sl_wfx_task.h delete mode 100644 examples/platform/silabs/SiWx917/wf200/wf200.gni delete mode 100644 examples/platform/silabs/SiWx917/wf200/wf200_init.c delete mode 100644 src/platform/silabs/SiWx917/CHIPCryptoPALPsaEfr32.cpp delete mode 100644 src/platform/silabs/SiWx917/ConnectivityManagerImpl.cpp delete mode 100644 src/platform/silabs/SiWx917/Efr32OpaqueKeypair.h delete mode 100644 src/platform/silabs/SiWx917/Efr32PsaOpaqueKeypair.cpp delete mode 100644 src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.cpp delete mode 100644 src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.h delete mode 100644 src/platform/silabs/SiWx917/ThreadStackManagerImpl.cpp create mode 100644 src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h create mode 100644 src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c create mode 100644 src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h delete mode 100644 src/platform/silabs/SiWx917/efr32-mbedtls-psa-crypto-config.h rename src/platform/silabs/SiWx917/{efr32-chip-mbedtls-config.h => siwx917-chip-mbedtls-config.h} (86%) diff --git a/examples/lighting-app/silabs/SiWx917/BUILD.gn b/examples/lighting-app/silabs/SiWx917/BUILD.gn index 3a812b966d3361..61f849a88854f5 100644 --- a/examples/lighting-app/silabs/SiWx917/BUILD.gn +++ b/examples/lighting-app/silabs/SiWx917/BUILD.gn @@ -18,8 +18,8 @@ import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") import("${build_root}/config/defaults.gni") +import("${efr32_sdk_build_root}/SiWx917_sdk.gni") import("${efr32_sdk_build_root}/efr32_executable.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") @@ -31,8 +31,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -efr32_project_dir = "${chip_root}/examples/lighting-app/silabs/efr32" -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +efr32_project_dir = "${chip_root}/examples/lighting-app/silabs/SiWx917" +examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" examples_common_plat_dir = "${chip_root}/examples/platform/silabs" declare_args() { @@ -56,13 +56,19 @@ declare_args() { sl_wfx_config_scan = true # Disable LCD on supported devices - disable_lcd = false + disable_lcd = true # Argument to Disable IPv4 for wifi(rs911) chip_enable_wifi_ipv4 = false # Argument to force enable WPA3 security on rs91x rs91x_wpa3_only = false + + #default WiFi SSID + ssid = "" + + #default Wifi Password + psk = "" } declare_args() { @@ -80,7 +86,7 @@ assert(!(use_wf200 && chip_enable_openthread)) if (chip_enable_wifi) { assert(use_rs911x || use_wf200) enable_openthread_cli = false - import("${chip_root}/src/platform/silabs/EFR32/wifi_args.gni") + import("${chip_root}/src/platform/silabs/SiWx917/wifi_args.gni") } # ThunderBoards, Explorer Kit and MGM240L do not support LCD (No LCD) @@ -90,6 +96,8 @@ if (silabs_board == "BRD4166A" || silabs_board == "BRD2601B" || disable_lcd = true } +defines = [] + # WiFi settings if (chip_enable_wifi) { # disabling LCD for MG24 for wifi @@ -97,7 +105,19 @@ if (chip_enable_wifi) { show_qr_code = false disable_lcd = true } - wifi_sdk_dir = "${chip_root}/src/platform/silabs/EFR32/wifi" + + if (ssid != "") { + defines += [ + "CHIP_ONNETWORK_PAIRING = 1", + "CHIP_WIFI_SSID = $ssid", + ] + } + if (psk != "") { + assert(ssid != "", "ssid can't be null if psk is provided") + defines += [ "CHIP_WIFI_PSK = $psk" ] + } + + wifi_sdk_dir = "${chip_root}/src/platform/silabs/SiWx917/wifi" efr32_lwip_defs = [ "LWIP_NETIF_API=1" ] if (lwip_ipv4) { efr32_lwip_defs += [ @@ -122,13 +142,8 @@ if (chip_enable_wifi) { efr32_lwip_defs += [ "LWIP_IPV6=0" ] } - if (use_rs911x) { - wiseconnect_sdk_root = - "${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" - import("${examples_plat_dir}/rs911x/rs911x.gni") - } else { - import("${examples_plat_dir}/wf200/wf200.gni") - } + wiseconnect_sdk_root = "${chip_root}/third_party/silabs/wisemcu-wifi-bt-sdk" + import("${examples_plat_dir}/SiWx917/rs911x.gni") } efr32_sdk("sdk") { @@ -138,22 +153,18 @@ efr32_sdk("sdk") { ] include_dirs = [ - "${chip_root}/src/platform/silabs/EFR32", + "${chip_root}/src/platform/silabs/SiWx917", "${efr32_project_dir}/include", "${examples_plat_dir}", "${chip_root}/src/lib", "${examples_common_plat_dir}", ] - defines = [ + defines += [ "BOARD_ID=${silabs_board}", "OTA_PERIODIC_TIMEOUT=${OTA_periodic_query_timeout}", ] - if (enable_heap_monitoring) { - defines += [ "HEAP_MONITORING" ] - } - if (chip_enable_pw_rpc) { defines += [ "HAL_VCOM_ENABLE=1", @@ -196,9 +207,9 @@ efr32_executable("lighting_app") { sources = [ "${examples_common_plat_dir}/heap_4_silabs.c", "${examples_plat_dir}/BaseApplication.cpp", - "${examples_plat_dir}/efr32_utils.cpp", - "${examples_plat_dir}/init_efrPlatform.cpp", + "${examples_plat_dir}/init_ccpPlatform.cpp", "${examples_plat_dir}/matter_config.cpp", + "${examples_plat_dir}/siwx917_utils.cpp", "src/AppTask.cpp", "src/LightingManager.cpp", "src/ZclCallbacks.cpp", @@ -206,12 +217,13 @@ efr32_executable("lighting_app") { ] if (use_wstk_leds) { - sources += [ "${examples_plat_dir}/LEDWidget.cpp" ] + # TODO: Commentting for CCP till the bring up of this is done + #sources += [ "${examples_plat_dir}/LEDWidget.cpp" ] } - if (chip_enable_pw_rpc || chip_build_libshell || enable_openthread_cli || - use_wf200 || use_rs911x) { - sources += [ "${examples_plat_dir}/uart.cpp" ] + if (chip_enable_pw_rpc || chip_build_libshell || use_rs911x) { + # TODO: Commentting for CCP till the bring up of this is done + #sources += [ "${examples_plat_dir}/uart.cpp" ] } deps = [ @@ -231,10 +243,7 @@ efr32_executable("lighting_app") { ] } - if (chip_enable_ota_requestor) { - defines += [ "EFR32_OTA_ENABLED" ] - sources += [ "${examples_plat_dir}/OTAConfig.cpp" ] - } + #TODO: OTA should be added # WiFi Settings if (chip_enable_wifi) { @@ -326,7 +335,7 @@ efr32_executable("lighting_app") { "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_dir}/pw_sys_io:pw_sys_io_efr32", + "${examples_plat_dir}/pw_sys_io:pw_sys_io_siwx917", ] deps += pw_build_LINK_DEPS @@ -365,7 +374,7 @@ efr32_executable("lighting_app") { # Attestation Credentials if (chip_build_platform_attestation_credentials_provider) { - deps += [ "${examples_plat_dir}:efr32-attestation-credentials" ] + deps += [ "${examples_plat_dir}:siwx917-attestation-credentials" ] } # Factory Data Provider diff --git a/examples/lighting-app/silabs/SiWx917/args.gni b/examples/lighting-app/silabs/SiWx917/args.gni index d216faa0a07dae..8b382c4520b390 100644 --- a/examples/lighting-app/silabs/SiWx917/args.gni +++ b/examples/lighting-app/silabs/SiWx917/args.gni @@ -15,7 +15,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/config/standalone/args.gni") -import("${chip_root}/src/platform/silabs/EFR32/args.gni") +import("${chip_root}/src/platform/silabs/SiWx917/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") diff --git a/examples/lighting-app/silabs/SiWx917/build_for_wifi_args.gni b/examples/lighting-app/silabs/SiWx917/build_for_wifi_args.gni index 363d2be9e6f362..8a0192cd5e9c3f 100644 --- a/examples/lighting-app/silabs/SiWx917/build_for_wifi_args.gni +++ b/examples/lighting-app/silabs/SiWx917/build_for_wifi_args.gni @@ -17,7 +17,7 @@ import("${chip_root}/config/standalone/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") chip_enable_openthread = false -import("${chip_root}/src/platform/silabs/EFR32/wifi_args.gni") +import("${chip_root}/src/platform/silabs/SiWx917/wifi_args.gni") chip_enable_ota_requestor = true diff --git a/examples/lighting-app/silabs/SiWx917/include/AppConfig.h b/examples/lighting-app/silabs/SiWx917/include/AppConfig.h index ffadaf9706cd2e..b86af8b22c2213 100644 --- a/examples/lighting-app/silabs/SiWx917/include/AppConfig.h +++ b/examples/lighting-app/silabs/SiWx917/include/AppConfig.h @@ -19,7 +19,7 @@ #pragma once -#include "efr32_utils.h" +#include "siwx917_utils.h" // ---- Lighting Example App Config ---- diff --git a/examples/lighting-app/silabs/SiWx917/include/AppTask.h b/examples/lighting-app/silabs/SiWx917/include/AppTask.h index df80995592fd95..225b726f732b13 100644 --- a/examples/lighting-app/silabs/SiWx917/include/AppTask.h +++ b/examples/lighting-app/silabs/SiWx917/include/AppTask.h @@ -30,7 +30,6 @@ #include "BaseApplication.h" #include "FreeRTOS.h" #include "LightingManager.h" -#include "sl_simple_button_instances.h" #include "timers.h" // provides FreeRTOS timer support #include #include @@ -70,16 +69,6 @@ class AppTask : public BaseApplication CHIP_ERROR StartAppTask(); - /** - * @brief Event handler when a button is pressed - * Function posts an event for button processing - * - * @param buttonHandle APP_LIGHT_SWITCH or APP_FUNCTION_BUTTON - * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, - * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED - */ - void ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction) override; - /** * @brief Callback called by the identify-server when an identify command is received * diff --git a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp index 9abc9e17750f52..22cab2f3ed1e5f 100644 --- a/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp +++ b/examples/lighting-app/silabs/SiWx917/src/AppTask.cpp @@ -21,11 +21,6 @@ #include "AppConfig.h" #include "AppEvent.h" -#ifdef ENABLE_WSTK_LEDS -#include "LEDWidget.h" -#include "sl_simple_led_instances.h" -#endif // ENABLE_WSTK_LEDS - #include #include #include @@ -43,11 +38,6 @@ #include -#ifdef ENABLE_WSTK_LEDS -#define SYSTEM_STATE_LED &sl_led_led0 -#define LIGHT_LED &sl_led_led1 -#endif // ENABLE_WSTK_LEDS - #define APP_FUNCTION_BUTTON &sl_button_btn0 #define APP_LIGHT_SWITCH &sl_button_btn1 @@ -56,10 +46,6 @@ using namespace ::chip::DeviceLayer; namespace { -#ifdef ENABLE_WSTK_LEDS -LEDWidget sLightLED; -#endif // ENABLE_WSTK_LEDS - EmberAfIdentifyEffectIdentifier sIdentifyEffect = EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT; /********************************************************** @@ -144,19 +130,16 @@ CHIP_ERROR AppTask::Init() appError(err); } - err = LightMgr().Init(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("LightMgr::Init() failed"); - appError(err); - } - - LightMgr().SetCallbacks(ActionInitiated, ActionCompleted); + /* TODO + err = LightMgr().Init(); + if (err != CHIP_NO_ERROR) + { + SILABS_LOG("LightMgr::Init() failed"); + appError(err); + } -#ifdef ENABLE_WSTK_LEDS - sLightLED.Init(LIGHT_LED); - sLightLED.Set(LightMgr().IsLightOn()); -#endif // ENABLE_WSTK_LEDS + LightMgr().SetCallbacks(ActionInitiated, ActionCompleted); + */ return err; } @@ -246,39 +229,12 @@ void AppTask::LightActionEventHandler(AppEvent * aEvent) } } -void AppTask::ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction) -{ - if (buttonHandle == NULL) - { - return; - } - - AppEvent button_event = {}; - button_event.Type = AppEvent::kEventType_Button; - button_event.ButtonEvent.Action = btnAction; - - if (buttonHandle == APP_LIGHT_SWITCH && btnAction == SL_SIMPLE_BUTTON_PRESSED) - { - button_event.Handler = LightActionEventHandler; - sAppTask.PostEvent(&button_event); - } - else if (buttonHandle == APP_FUNCTION_BUTTON) - { - button_event.Handler = BaseApplication::ButtonHandler; - sAppTask.PostEvent(&button_event); - } -} - void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) { // Action initiated, update the light led bool lightOn = aAction == LightingManager::ON_ACTION; SILABS_LOG("Turning light %s", (lightOn) ? "On" : "Off") -#ifdef ENABLE_WSTK_LEDS - sLightLED.Set(lightOn); -#endif // ENABLE_WSTK_LEDS - #ifdef DISPLAY_ENABLED sAppTask.GetLCD().WriteDemoUI(lightOn); #endif diff --git a/examples/lighting-app/silabs/SiWx917/src/main.cpp b/examples/lighting-app/silabs/SiWx917/src/main.cpp index 2594f6f9216e78..e3ed2a9c8490a8 100644 --- a/examples/lighting-app/silabs/SiWx917/src/main.cpp +++ b/examples/lighting-app/silabs/SiWx917/src/main.cpp @@ -20,14 +20,13 @@ #include #include "AppConfig.h" -#include "init_efrPlatform.h" -#include "sl_simple_button_instances.h" -#include "sl_system_kernel.h" +#include "init_ccpPlatform.h" + #include #include #include #include -#ifdef EFR32_ATTESTATION_CREDENTIALS +#ifdef SI917_ATTESTATION_CREDENTIALS #include #else #include @@ -49,16 +48,18 @@ static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; // ================================================================================ int main(void) { - init_efrPlatform(); - if (EFR32MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR) + init_ccpPlatform(); + if (SI917MatterConfig::InitMatter(BLE_DEV_NAME) != CHIP_NO_ERROR) + { appError(CHIP_ERROR_INTERNAL); + } gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage()); chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider); chip::DeviceLayer::PlatformMgr().LockChipStack(); // Initialize device attestation config -#ifdef EFR32_ATTESTATION_CREDENTIALS +#ifdef SI917_ATTESTATION_CREDENTIALS SetDeviceAttestationCredentialsProvider(Silabs::GetSilabsDacProvider()); #else SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); @@ -67,18 +68,15 @@ int main(void) SILABS_LOG("Starting App Task"); if (AppTask::GetAppTask().StartAppTask() != CHIP_NO_ERROR) + { appError(CHIP_ERROR_INTERNAL); + } SILABS_LOG("Starting FreeRTOS scheduler"); - sl_system_kernel_start(); + vTaskStartScheduler(); // Should never get here. chip::Platform::MemoryShutdown(); SILABS_LOG("vTaskStartScheduler() failed"); appError(CHIP_ERROR_INTERNAL); } - -void sl_button_on_change(const sl_button_t * handle) -{ - AppTask::GetAppTask().ButtonEventHandler(handle, sl_button_get_state(handle)); -} diff --git a/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni b/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni index 40a8bb79d84b6a..3e2b6e54411c6c 100644 --- a/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni +++ b/examples/lighting-app/silabs/SiWx917/with_pw_rpc.gni @@ -17,7 +17,7 @@ import("//build_overrides/chip.gni") import("${chip_root}/config/efr32/lib/pw_rpc/pw_rpc.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/SiWx917/args.gni") efr32_sdk_target = get_label_info(":sdk", "label_no_toolchain") diff --git a/examples/platform/silabs/SiWx917/BUILD.gn b/examples/platform/silabs/SiWx917/BUILD.gn index dbd8473a6c89de..990a43d59d66c7 100644 --- a/examples/platform/silabs/SiWx917/BUILD.gn +++ b/examples/platform/silabs/SiWx917/BUILD.gn @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("${chip_root}/src/lib/lib.gni") import("${chip_root}/src/platform/device.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") +import("${efr32_sdk_build_root}/SiWx917_sdk.gni") config("chip_examples_project_config") { include_dirs = [ "project_include" ] @@ -40,22 +40,6 @@ config("chip_examples_project_config") { ] } -source_set("openthread_core_config_efr32_chip_examples") { - if (chip_enable_openthread) { - sources = [ "project_include/OpenThreadConfig.h" ] - - public_deps = [ "${efr32_sdk_build_root}:efr32_sdk" ] - - if (use_silabs_thread_lib) { - public_deps += [ "${efr32_sdk_build_root}:openthread_core_config_efr32" ] - } else { - public_deps += [ "${chip_root}/third_party/openthread/platforms/efr32:openthread_core_config_efr32" ] - } - - public_configs = [ ":chip_examples_project_config" ] - } -} - source_set("efr-matter-shell") { if (chip_build_libshell) { defines = [ "ENABLE_CHIP_SHELL" ] @@ -75,8 +59,8 @@ config("attestation-credentials-config") { include_dirs = [ "${chip_root}" ] defines = [ - # Set to 1 to enable EFR32 attestation credentials - "EFR32_ATTESTATION_CREDENTIALS", + # Set to 1 to enable SI917 attestation credentials + "SI917_ATTESTATION_CREDENTIALS", ] } @@ -96,8 +80,8 @@ source_set("efr32-attestation-credentials") { source_set("efr32-factory-data-provider") { sources = [ - "EFR32DeviceDataProvider.cpp", - "EFR32DeviceDataProvider.h", + "SiWx917DeviceDataProvider.cpp", + "SiWx917DeviceDataProvider.h", ] public_deps = [ diff --git a/examples/platform/silabs/SiWx917/BaseApplication.cpp b/examples/platform/silabs/SiWx917/BaseApplication.cpp index a9ecfc63bb0c60..b401c1825578f6 100644 --- a/examples/platform/silabs/SiWx917/BaseApplication.cpp +++ b/examples/platform/silabs/SiWx917/BaseApplication.cpp @@ -25,11 +25,6 @@ #include "AppEvent.h" #include "AppTask.h" -#ifdef ENABLE_WSTK_LEDS -#include "LEDWidget.h" -#include "sl_simple_led_instances.h" -#endif // ENABLE_WSTK_LEDS - #ifdef DISPLAY_ENABLED #include "lcd.h" #ifdef QR_CODE_ENABLED @@ -37,7 +32,7 @@ #endif // QR_CODE_ENABLED #endif // DISPLAY_ENABLED -#include "EFR32DeviceDataProvider.h" +#include "SiWx917DeviceDataProvider.h" #include #include #include @@ -49,12 +44,6 @@ #include #include -#if CHIP_ENABLE_OPENTHREAD -#include -#include -#include -#endif // CHIP_ENABLE_OPENTHREAD - #ifdef SL_WIFI #include "wfx_host_events.h" #include @@ -74,12 +63,6 @@ #define APP_EVENT_QUEUE_SIZE 10 #define EXAMPLE_VENDOR_ID 0xcafe -#ifdef ENABLE_WSTK_LEDS -#define SYSTEM_STATE_LED &sl_led_led0 -#endif // ENABLE_WSTK_LEDS - -#define APP_FUNCTION_BUTTON &sl_button_btn0 - using namespace chip; using namespace ::chip::DeviceLayer; @@ -95,10 +78,6 @@ TimerHandle_t sLightTimer; TaskHandle_t sAppTaskHandle; QueueHandle_t sAppEventQueue; -#ifdef ENABLE_WSTK_LEDS -LEDWidget sStatusLED; -#endif // ENABLE_WSTK_LEDS - #ifdef SL_WIFI app::Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::SlWiFiDriver::GetInstance())); @@ -211,11 +190,6 @@ CHIP_ERROR BaseApplication::Init(Identify * identifyObj) SILABS_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); -#ifdef ENABLE_WSTK_LEDS - LEDWidget::InitGpio(); - sStatusLED.Init(SYSTEM_STATE_LED); -#endif // ENABLE_WSTK_LEDS - ConfigurationMgr().LogDeviceConfig(); // Create buffer for QR code that can fit max size and null terminator. @@ -271,13 +245,6 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent) #endif // CHIP_DEVICE_CONFIG_ENABLE_SED mFunction = kFunction_FactoryReset; - -#ifdef ENABLE_WSTK_LEDS - // Turn off all LEDs before starting blink to make sure blink is - // co-ordinated. - sStatusLED.Set(false); - sStatusLED.Blink(500); -#endif // ENABLE_WSTK_LEDS } else if (mFunctionTimerActive && mFunction == kFunction_FactoryReset) { @@ -329,133 +296,6 @@ void BaseApplication::LightEventHandler() // the LEDs at an even rate of 100ms. // // Otherwise, blink the LED ON for a very short time. - if (mFunction != kFunction_FactoryReset) - { - if ((gIdentifyptr != nullptr) && (gIdentifyptr->mActive)) - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(250, 250); -#endif // ENABLE_WSTK_LEDS - } - else if (sIdentifyEffect != EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_STOP_EFFECT) - { - if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BLINK) - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(50, 50); -#endif // ENABLE_WSTK_LEDS - } - if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_BREATHE) - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(1000, 1000); -#endif // ENABLE_WSTK_LEDS - } - if (sIdentifyEffect == EMBER_ZCL_IDENTIFY_EFFECT_IDENTIFIER_OKAY) - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(300, 700); -#endif // ENABLE_WSTK_LEDS - } - } -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) - else if (sIsProvisioned && sIsEnabled) - { - if (sIsAttached) - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Set(true); -#endif // ENABLE_WSTK_LEDS - } - else - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(950, 50); -#endif - } - } - else if (sHaveBLEConnections) - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(100, 100); -#endif // ENABLE_WSTK_LEDS - } - else - { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Blink(50, 950); -#endif // ENABLE_WSTK_LEDS - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED - } - -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Animate(); -#endif // ENABLE_WSTK_LEDS -} - -void BaseApplication::ButtonHandler(AppEvent * aEvent) -{ - // To trigger software update: press the APP_FUNCTION_BUTTON button briefly (< - // FACTORY_RESET_TRIGGER_TIMEOUT) To initiate factory reset: press the - // APP_FUNCTION_BUTTON for FACTORY_RESET_TRIGGER_TIMEOUT + - // FACTORY_RESET_CANCEL_WINDOW_TIMEOUT All LEDs start blinking after - // FACTORY_RESET_TRIGGER_TIMEOUT to signal factory reset has been initiated. - // To cancel factory reset: release the APP_FUNCTION_BUTTON once all LEDs - // start blinking within the FACTORY_RESET_CANCEL_WINDOW_TIMEOUT - if (aEvent->ButtonEvent.Action == SL_SIMPLE_BUTTON_PRESSED) - { - if (!mFunctionTimerActive && mFunction == kFunction_NoneSelected) - { - StartFunctionTimer(FACTORY_RESET_TRIGGER_TIMEOUT); - mFunction = kFunction_StartBleAdv; - } - } - else - { - // If the button was released before factory reset got initiated, open the commissioning window and start BLE advertissement - // in fast mode - if (mFunctionTimerActive && mFunction == kFunction_StartBleAdv) - { - CancelFunctionTimer(); - mFunction = kFunction_NoneSelected; - -#ifdef QR_CODE_ENABLED - // TOGGLE QRCode/LCD demo UI - slLCD.ToggleQRCode(); -#endif - -#ifdef SL_WIFI - if (!ConnectivityMgr().IsWiFiStationProvisioned()) -#else - if (!ConnectivityMgr().IsThreadProvisioned()) -#endif /* !SL_WIFI */ - { - // Open Basic CommissioningWindow. Will start BLE advertisements - chip::DeviceLayer::PlatformMgr().LockChipStack(); - CHIP_ERROR err = chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - if (err != CHIP_NO_ERROR) - { - SILABS_LOG("Failed to open the Basic Commissioning Window"); - } - } - else { SILABS_LOG("Network is already provisioned, Ble advertissement not enabled"); } - } - else if (mFunctionTimerActive && mFunction == kFunction_FactoryReset) - { - CancelFunctionTimer(); - -#if CHIP_DEVICE_CONFIG_ENABLE_SED == 1 - StopStatusLEDTimer(); -#endif - - // Change the function to none selected since factory reset has been - // canceled. - mFunction = kFunction_NoneSelected; - SILABS_LOG("Factory Reset has been Canceled"); - } - } } void BaseApplication::CancelFunctionTimer() @@ -500,9 +340,6 @@ void BaseApplication::StartStatusLEDTimer() void BaseApplication::StopStatusLEDTimer() { -#ifdef ENABLE_WSTK_LEDS - sStatusLED.Set(false); -#endif // ENABLE_WSTK_LEDS if (xTimerStop(sLightTimer, 100) != pdPASS) { diff --git a/examples/platform/silabs/SiWx917/BaseApplication.h b/examples/platform/silabs/SiWx917/BaseApplication.h index febd7aa68591b2..2c0e07edb35289 100644 --- a/examples/platform/silabs/SiWx917/BaseApplication.h +++ b/examples/platform/silabs/SiWx917/BaseApplication.h @@ -28,7 +28,6 @@ #include "AppEvent.h" #include "FreeRTOS.h" -#include "sl_simple_button_instances.h" #include "timers.h" // provides FreeRTOS timer support #include #include @@ -88,16 +87,6 @@ class BaseApplication static SilabsLCD & GetLCD(void); #endif - /** - * @brief Event handler when a button is pressed - * Function posts an event for button processing - * - * @param buttonHandle APP_LIGHT_SWITCH or APP_FUNCTION_BUTTON - * @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED, - * SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED - */ - virtual void ButtonEventHandler(const sl_button_t * buttonHandle, uint8_t btnAction) = 0; - /** * @brief Function called to start the LED light timer */ diff --git a/examples/platform/silabs/SiWx917/FreeRTOSConfig.h b/examples/platform/silabs/SiWx917/FreeRTOSConfig.h index 50f4c24ff31679..02b441ec790272 100644 --- a/examples/platform/silabs/SiWx917/FreeRTOSConfig.h +++ b/examples/platform/silabs/SiWx917/FreeRTOSConfig.h @@ -107,20 +107,6 @@ extern "C" { #include -#include "RTE_Components.h" -#include CMSIS_device_header - -#include "em_assert.h" -#include "em_device.h" - -#if defined(SL_COMPONENT_CATALOG_PRESENT) -#include "sl_component_catalog.h" -#endif - -#if SL_SYSTEM_VIEW -#include "SEGGER_SYSVIEW_FreeRTOS.h" -#endif - /*----------------------------------------------------------- * Application specific definitions. * @@ -133,6 +119,8 @@ extern "C" { * See http://www.freertos.org/a00110.html. *----------------------------------------------------------*/ +extern uint32_t SystemCoreClock; + /* Energy saving modes. */ #if defined(SL_CATALOG_POWER_MANAGER_PRESENT) #define configUSE_TICKLESS_IDLE 1 @@ -148,7 +136,7 @@ extern "C" { #define configUSE_TICK_HOOK (1) #define configCHECK_FOR_STACK_OVERFLOW (2) #define configUSE_MALLOC_FAILED_HOOK (1) -#define configUSE_IDLE_HOOK (1) +#define configUSE_IDLE_HOOK (0) /* Main functions*/ /* Run time stats gathering related definitions. */ @@ -185,13 +173,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG (1) /* See into vPortSuppressTicksAndSleep source code for explanation */ #define configMAX_PRIORITIES (56) #define configMINIMAL_STACK_SIZE (320) /* Number of words to use for Idle and Timer stacks */ - -#ifdef HEAP_MONITORING -#define configMAX_TASK_NAME_LEN (24) -#else #define configMAX_TASK_NAME_LEN (10) -#endif // HEAP_MONITORING - #define configUSE_16_BIT_TICKS (0) #define configIDLE_SHOULD_YIELD (1) #define configUSE_MUTEXES (1) @@ -207,11 +189,7 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configSUPPORT_DYNAMIC_ALLOCATION (1) #ifndef configTOTAL_HEAP_SIZE -#ifdef SL_WIFI #define configTOTAL_HEAP_SIZE ((size_t)(34 * 1024)) -#else -#define configTOTAL_HEAP_SIZE ((size_t)(20 * 1024)) -#endif #endif // configTOTAL_HEAP_SIZE /* Optional functions - most linkers will remove unused functions anyway. */ diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal.h b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal.h similarity index 94% rename from examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal.h rename to examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal.h index 4e195433edc57f..8e4e6e25952583 100644 --- a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal.h +++ b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal.h @@ -54,12 +54,6 @@ // Macro to drive high value on GPIO #define RSI_HAL_GPIO_HIGH 1 -// Macro to drive LDMA channel number -#define RSI_LDMA_TRANSFER_CHANNEL_NUM 3 - -// Macro to drive semaphore block minimun timer in milli seconds -#define RSI_SEM_BLOCK_MIN_TIMER_VALUE_MS 50 - /****************************************************** * * Function Declarations * ******************************************************/ diff --git a/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_platform_init.c b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_platform_init.c new file mode 100644 index 00000000000000..b2effb5997f388 --- /dev/null +++ b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_platform_init.c @@ -0,0 +1,113 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Includes + */ +#include "rsi_board.h" +#include "rsi_pll.h" +#include "rsi_rom_clks.h" +#include "siwx917_utils.h" +#include "system_RS1xxxx.h" + +#define SOC_PLL_REF_FREQUENCY 32000000 /* PLL input REFERENCE clock 32MHZ */ + +// Note: Change this macro to required PLL frequency in hertz +#define PS4_SOC_FREQ 80000000 /* PLL out clock 80MHz */ +#define SWITCH_QSPI_TO_SOC_PLL +#define ICACHE_DISABLE +#define DEBUG_DISABLE + +#define PMU_GOOD_TIME 31 /*Duration in us*/ +#define XTAL_GOOD_TIME 31 /*Duration in us*/ + +/*Pre-fetch and regestring */ +#define ICACHE2_ADDR_TRANSLATE_1_REG *(volatile uint32_t *) (0x20280000 + 0x24) +#define MISC_CFG_SRAM_REDUNDANCY_CTRL *(volatile uint32_t *) (0x46008000 + 0x18) +#define MISC_CONFIG_MISC_CTRL1 *(volatile uint32_t *) (0x46008000 + 0x44) +#define MISC_QUASI_SYNC_MODE *(volatile uint32_t *) (0x46008000 + 0x84) + +/** + * @fn void soc_pll_config() + * @brief This function to configure clock for SiWx917 SoC (80MHz) + * Configure the PLL frequency and Switch M4 clock to PLL clock for speed operations + * + * @param[in] none + * @param[out] none + * @return int + * @section description + * configure clock for SiWx917 SoC + * + */ +int soc_pll_config(void) +{ + RSI_CLK_SocPllLockConfig(1, 1, 7); + + RSI_CLK_SocPllRefClkConfig(2); + + RSI_CLK_M4SocClkConfig(M4CLK, M4_ULPREFCLK, 0); + + /*Enable fre-fetch and register if SOC-PLL frequency is more than or equal to 120M*/ +#if (PS4_SOC_FREQ >= 120000000) + ICACHE2_ADDR_TRANSLATE_1_REG = BIT(21); + MISC_CFG_SRAM_REDUNDANCY_CTRL = BIT(4); + MISC_CONFIG_MISC_CTRL1 |= BIT(4); +#if !(defined WISE_AOC_4) + MISC_QUASI_SYNC_MODE |= BIT(6); + MISC_QUASI_SYNC_MODE |= (BIT(6) | BIT(7)); +#endif /* !WISE_AOC_4 */ +#endif /* (PS4_SOC_FREQ > 120000000) */ + + RSI_CLK_SetSocPllFreq(M4CLK, PS4_SOC_FREQ, SOC_PLL_REF_FREQUENCY); + + RSI_CLK_M4SocClkConfig(M4CLK, M4_SOCPLLCLK, 0); + +#ifdef SWITCH_QSPI_TO_SOC_PLL + RSI_CLK_QspiClkConfig(M4CLK, QSPI_INTFPLLCLK, 0, 0, 0); +#endif /* SWITCH_QSPI_TO_SOC_PLL */ + + return 0; +} + +/*==============================================*/ +/** + * @fn void rsi_hal_board_init() + * @brief This function Initializes the platform + * @param[in] none + * @param[out] none + * @return none + * @section description + * This function initializes the platform + * + */ +void rsi_hal_board_init(void) +{ + SystemCoreClockUpdate(); + + /* configure clock for SiWx917 SoC */ + soc_pll_config(); + SILABS_LOG("%s, soc_pll_config, SystemCoreClock=%d\n", __func__, SystemCoreClock); + +#ifdef COMMON_FLASH_EN + /* Before TA going to power save mode ,set m4ss_ref_clk_mux_ctrl ,tass_ref_clk_mux_ctrl, + AON domain power supply controls form TA to M4 */ + RSI_Set_Cntrls_To_M4(); +#endif +#ifdef DEBUG_UART + DEBUGINIT(); +#endif +} diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_timer.c b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c similarity index 54% rename from examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_timer.c rename to examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c index c6d6381932d3ea..e7141d4646060c 100644 --- a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_timer.c +++ b/examples/platform/silabs/SiWx917/SiWx917/hal/rsi_hal_mcu_timer.c @@ -19,13 +19,14 @@ * Includes */ -#include "em_cmu.h" +#include "rsi_driver.h" #ifdef RSI_WITH_OS /* FreeRTOS includes. */ #include "FreeRTOS.h" -#include "event_groups.h" +#include "StackMacros.h" #include "task.h" #include "timers.h" + #if defined(SysTick) #undef SysTick_Handler /* FreeRTOS SysTick interrupt handler prototype */ @@ -33,115 +34,9 @@ extern void SysTick_Handler(void); /* FreeRTOS tick timer interrupt handler prototype */ extern void xPortSysTickHandler(void); #endif /* SysTick */ -#endif /* RSI_WITH_OS */ -#include "wfx_host_events.h" - -/* RSI Driver include file */ -#include "rsi_driver.h" -/* RSI WLAN Config include file */ -#include "rsi_bootup_config.h" -#include "rsi_common_apis.h" -#include "rsi_data_types.h" -#include "rsi_error.h" -#include "rsi_nwk.h" -#include "rsi_socket.h" -#include "rsi_utils.h" -#include "rsi_wlan.h" -#include "rsi_wlan_apis.h" -#include "rsi_wlan_config.h" -#include "wfx_rsi.h" - -#ifndef _use_the_rsi_defined_functions - -StaticTimer_t sRsiTimerBuffer; - -/* - * We (Matter port) need a few functions out of this file - * They are at the top - */ -uint32_t rsi_hal_gettickcount(void) -{ - return xTaskGetTickCount(); -} -void rsi_delay_ms(uint32_t delay_ms) -{ -#ifndef RSI_WITH_OS - uint32_t start; #endif - if (delay_ms == 0) // Check if delay is 0msec - return; - -#ifdef RSI_WITH_OS - vTaskDelay(pdMS_TO_TICKS(delay_ms)); -#else - start = rsi_hal_gettickcount(); - do - { - } while (rsi_hal_gettickcount() - start < delay_ms); -#endif -} -static struct rsi_timer -{ - void (*func)(void); - TimerHandle_t handle; - uint8_t id; - uint8_t name[3]; -} rsi_timer[WFX_RSI_NUM_TIMERS]; -static void timer_cb(TimerHandle_t thandle) -{ - int x; - for (x = 0; x < WFX_RSI_NUM_TIMERS; x++) - { - if (rsi_timer[x].handle == thandle) - { - (*rsi_timer[x].func)(); - break; - } - } -} - -/* - * Run a one-shot/periodic timer - */ -int32_t rsi_timer_start(uint8_t timer_node, uint8_t mode, uint8_t type, uint32_t duration, void (*rsi_timer_cb)(void)) -{ - int x; - struct rsi_timer * tp; - - if (mode == RSI_HAL_TIMER_MODE_MILLI) - return RSI_ERROR_INVALID_OPTION; /* Not supported for now - Fix this later */ - for (x = 0; x < WFX_RSI_NUM_TIMERS; x++) - { - tp = &rsi_timer[x]; - if (tp->handle == NULL) - { - goto found; - } - } - /* No space */ - return RSI_ERROR_INSUFFICIENT_BUFFER; -found: - tp->name[0] = 'r'; - tp->name[1] = timer_node; - tp->name[2] = 0; - tp->func = rsi_timer_cb; - tp->handle = - xTimerCreateStatic((char *) &tp->name[0], pdMS_TO_TICKS(duration), - ((mode == RSI_HAL_TIMER_TYPE_SINGLE_SHOT) ? pdFALSE : pdTRUE), NULL, timer_cb, &sRsiTimerBuffer); - - if (tp->handle == NULL) - { - return RSI_ERROR_INSUFFICIENT_BUFFER; - } - - (void) xTimerStart(tp->handle, TIMER_TICKS_TO_WAIT_0); - return RSI_ERROR_NONE; -} -#else /* _use_the_rsi_defined_functions */ - -/* Counts 1ms timeTicks */ -volatile uint32_t msTicks = 0; +static volatile uint32_t _dwTickCount; // systick cout variable /*===================================================*/ /** @@ -167,11 +62,11 @@ volatile uint32_t msTicks = 0; int32_t rsi_timer_start(uint8_t timer_node, uint8_t mode, uint8_t type, uint32_t duration, void (*rsi_timer_expiry_handler)(void)) { - // Initialise the timer + //! Initialise the timer - // register the call back + //! register the call back - // Start timer + //! Start timer return 0; } @@ -191,7 +86,7 @@ int32_t rsi_timer_start(uint8_t timer_node, uint8_t mode, uint8_t type, uint32_t int32_t rsi_timer_stop(uint8_t timer_node) { - // Stop the timer + //! Stop the timer return 0; } @@ -206,12 +101,13 @@ int32_t rsi_timer_stop(uint8_t timer_node) * @description This HAL API should contain API to read the timer * */ + uint32_t rsi_timer_read(uint8_t timer_node) { volatile uint32_t timer_val = 0; - // read the timer and return timer value + //! read the timer and return timer value return timer_val; } @@ -229,25 +125,65 @@ uint32_t rsi_timer_read(uint8_t timer_node) void rsi_delay_us(uint32_t delay_us) { - // call the API for delay in micro seconds + //! call the API for delay in micro seconds return; } -#ifdef RSI_M4_INTERFACE +/*===================================================*/ +/** + * @fn void rsi_delay_ms(uint32_t delay) + * @brief create delay in micro seconds + * @param[in] delay, timer delay in micro seconds + * @param[out] none + * @return none + * @description This HAL API should contain the code to create delay in micro seconds + * + */ +void rsi_delay_ms1(uint32_t delay_ms) +{ -extern void SysTick_Handler(void); + //! call the API for delay in milli seconds + + return; +} + +/*===================================================*/ +/** + * @fn void SysTick_Handler(void); + * @brief systick cout variable + * @param[in] none + * @param[out] none + * @return none + * @description This HAL API is systick cout variable + * + */ void SysTick_Handler(void) { _dwTickCount++; +#ifdef RSI_WITH_OS + if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) + { + xPortSysTickHandler(); + } +#endif } +/*===================================================*/ +/** + * @fn uint32_t GetTickCount( void ) + * @brief gets the tick count from systic ISR + * @param[in] delay, timer delay in micro seconds + * @param[out] none + * @return Returns the systick current tick count + * @description This HAL API gets the tick count from systic ISR + * + */ uint32_t GetTickCount(void) { return _dwTickCount; // gets the tick count from systic ISR } -#endif /*===================================================*/ /** @@ -257,23 +193,17 @@ uint32_t GetTickCount(void) * @param[out] none * @return none * @description This HAL API should contain the code to create delay in milli seconds + * */ + void rsi_delay_ms(uint32_t delay_ms) { -#ifndef RSI_WITH_OS - uint32_t start; -#endif - if (delay_ms == DELAY0) - return; + uint64_t waitTime = rsi_hal_gettickcount() + delay_ms; -#ifdef RSI_WITH_OS - vTaskDelay(delay_ms); -#else - start = rsi_hal_gettickcount(); - do + while (waitTime > rsi_hal_gettickcount()) { - } while (rsi_hal_gettickcount() - start < delay_ms); -#endif + // we busy wait + } } /*===================================================*/ @@ -285,38 +215,7 @@ void rsi_delay_ms(uint32_t delay_ms) * */ -#ifndef RSI_HAL_USE_RTOS_SYSTICK -/* - SysTick handler implementation that also clears overflow flag. -*/ -void SysTick_Handler(void) -{ - /* Increment counter necessary in Delay()*/ - msTicks++; -#ifdef RSI_WITH_OS - if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) - { - xPortSysTickHandler(); - } -#endif -} - -uint32_t rsi_hal_gettickcount(void) -{ - return msTicks; - -#ifdef LINUX_PLATFORM - // Define your API to get the tick count delay in milli seconds from systic ISR and return the resultant value - struct rsi_timeval tv1; - gettimeofday(&tv1, NULL); - return (tv1.tv_sec * CONVERT_SEC_TO_MSEC + tv1.tv_usec * CONVERT_USEC_TO_MSEC); -#endif -} - -#else uint32_t rsi_hal_gettickcount(void) { - return xTaskGetTickCount(); + return GetTickCount(); } -#endif /* RSI_HAL_USE_RTOS_SYSTICK */ -#endif /* _use_the_rsi_defined_functions */ diff --git a/examples/platform/silabs/SiWx917/rs911x/rs911x.gni b/examples/platform/silabs/SiWx917/SiWx917/rs911x.gni similarity index 54% rename from examples/platform/silabs/SiWx917/rs911x/rs911x.gni rename to examples/platform/silabs/SiWx917/SiWx917/rs911x.gni index f11981023e35f2..0cca17540074ab 100644 --- a/examples/platform/silabs/SiWx917/rs911x/rs911x.gni +++ b/examples/platform/silabs/SiWx917/SiWx917/rs911x.gni @@ -2,24 +2,34 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" -wifi_sdk_dir = "${chip_root}/src/platform/silabs/EFR32/wifi" -wiseconnect_sdk_root = "${chip_root}/third_party/silabs/wiseconnect-wifi-bt-sdk" +examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" +wifi_sdk_dir = "${chip_root}/src/platform/silabs/SiWx917/wifi" +wiseconnect_sdk_root = "${chip_root}/third_party/silabs/wisemcu-wifi-bt-sdk" rs911x_cflags = [] rs911x_src_plat = [ - "${examples_plat_dir}/rs911x/rsi_if.c", - "${examples_plat_dir}/rs911x/wfx_rsi_host.c", + "${examples_plat_dir}/SiWx917/rsi_if.c", + "${examples_plat_dir}/SiWx917/wfx_rsi_host.c", "${wifi_sdk_dir}/wfx_notify.cpp", - "${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_interrupt.c", - "${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_ioports.c", - "${examples_plat_dir}/rs911x/hal/rsi_hal_mcu_timer.c", - "${examples_plat_dir}/rs911x/hal/efx_spi.c", + + "${examples_plat_dir}/SiWx917/hal/rsi_hal_mcu_timer.c", + "${examples_plat_dir}/SiWx917/hal/rsi_hal_mcu_platform_init.c", + + "${wiseconnect_sdk_root}/platforms/si91x/hal/src/rsi_bootup_config.c", + "${wiseconnect_sdk_root}/platforms/si91x/hal/src/rsi_hal_mcu_m4.c", + "${wiseconnect_sdk_root}/platforms/si91x/hal/src/rsi_hal_mcu_m4_rom.c", + "${wiseconnect_sdk_root}/platforms/si91x/hal/src/rsi_hal_mcu_interrupt.c", ] rs911x_plat_incs = [ "${wifi_sdk_dir}", "${wifi_sdk_dir}/hal", - "${chip_root}/src/platform/EFR32", + "${wiseconnect_sdk_root}/platforms/si91x/hal/inc", + + # "${wiseconnect_sdk_root}/sapi/include", + "${chip_root}/src/platform/silabs/SiWx917", + "${chip_root}/src/platform/silabs/SiWx917/bluetooth", + "${examples_plat_dir}/SiWx917", + "${wiseconnect_sdk_root}/platforms/si91x/hal/inc", ] # @@ -31,6 +41,8 @@ rs911x_src_sapi = [ "${wiseconnect_sdk_root}/sapi/common/rsi_apis_rom.c", "${wiseconnect_sdk_root}/sapi/common/rsi_common_apis.c", "${wiseconnect_sdk_root}/sapi/common/rsi_device_init_apis.c", + + # "${wiseconnect_sdk_root}/sapi/common/rsi_wisemcu_hardware_setup.c", "${wiseconnect_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_frame_rd_wr.c", "${wiseconnect_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_functs.c", "${wiseconnect_sdk_root}/sapi/driver/device_interface/spi/rsi_spi_iface_init.c", @@ -60,14 +72,39 @@ rs911x_src_sapi = [ ] foreach(src_file, rs911x_src_sapi) { - rs911x_cflags += [ "-Wno-empty-body" ] + rs911x_cflags += [ + "-Wno-empty-body", + "-Wno-cpp", + "-Wno-missing-braces", + "-Wno-sign-compare", + "-Wno-error", + "-Wno-unknown-warning-option", + "-Wno-unused-variable", + "-Wno-implicit-function-declaration", + "-Wno-unused-function", + ] } rs911x_inc_plat = [ "${wifi_sdk_dir}", - "${examples_plat_dir}/rs911x", - "${examples_plat_dir}/rs911x/hal", + "${examples_plat_dir}/SiWx917", + "${examples_plat_dir}/SiWx917/hal", "${wiseconnect_sdk_root}/sapi/include", + + #CCP Platfrom + "${wiseconnect_sdk_root}/platforms/si91x/hal/inc", + "${wiseconnect_sdk_root}/platforms/si91x/boards/brd4325a/inc", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/inc", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/inc", + "${wiseconnect_sdk_root}/platforms/si91x/core/chip/inc", + "${wiseconnect_sdk_root}/platforms/si91x/core/config", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver/config", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/rom_driver/inc", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver/CMSIS/Driver/Include", + + "${wiseconnect_sdk_root}/platforms/si91x/core/cmsis", + "${wiseconnect_sdk_root}/platforms/si91x/service/system/inc", ] # Apparently - the rsi library needs this @@ -86,14 +123,20 @@ rs911x_src_lwip = [ "${wifi_sdk_dir}/lwip_netif.cpp", ] rs911x_defs = [ + "CCP_SI917_BRINGUP=1", "SL_HEAP_SIZE=32768", "SL_WIFI=1", - "SL_WFX_USE_SPI", - "EFX32_RS911X=1", "RS911X_WIFI", "RSI_WLAN_ENABLE", - "RSI_SPI_INTERFACE", "RSI_WITH_OS", + "RSI_M4_INTERFACE", #Enable CCP bus Interface + "RSI_WLAN_API_ENABLE", + "HMAC_512", + "LITTLE_ENDIAN_ORDER", + "_CHIP_9118", + + # "ROM_WIRELESS" + #__CC_ARM DEBUG_UART _CHIP_9118 LITTLE_ENDIAN_ORDER HMAC_512 ] rs911x_sock_defs = [ "RS911X_SOCKETS", diff --git a/examples/platform/silabs/SiWx917/rs911x/rsi_if.c b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c similarity index 92% rename from examples/platform/silabs/SiWx917/rs911x/rsi_if.c rename to examples/platform/silabs/SiWx917/SiWx917/rsi_if.c index 7d3be406fbce2f..3b15cd8f29e7af 100644 --- a/examples/platform/silabs/SiWx917/rs911x/rsi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c @@ -19,12 +19,6 @@ #include #include -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" - #include "sl_status.h" #include "FreeRTOS.h" @@ -38,6 +32,7 @@ #include "rsi_common_apis.h" #include "rsi_data_types.h" +#include "rsi_error.h" #include "rsi_nwk.h" #include "rsi_socket.h" #include "rsi_utils.h" @@ -46,12 +41,13 @@ #include "rsi_wlan_config.h" //#include "rsi_wlan_non_rom.h" #include "rsi_bootup_config.h" -#include "rsi_error.h" #include "dhcp_client.h" -#include "wfx_host_events.h" #include "wfx_rsi.h" +#define VAL(str) #str +#define TOSTRING(str) VAL(str) + /* Rsi driver Task will use as its stack */ StackType_t driverRsiTaskStack[WFX_RSI_WLAN_TASK_SZ] = { 0 }; @@ -107,24 +103,10 @@ int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t * ap) *********************************************************************/ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) { - int32_t status; - uint8_t buff[RSI_RESPONSE_MAX_SIZE] = { 0 }; - status = rsi_wlan_get(RSI_WLAN_EXT_STATS, buff, sizeof(buff)); - if (status != RSI_SUCCESS) - { - WFX_RSI_LOG("\r\n Failed, Error Code : 0x%lX\r\n", status); - } - else - { - rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff; - extra_info->beacon_lost_count = test->beacon_lost_count - temp_reset->beacon_lost_count; - extra_info->beacon_rx_count = test->beacon_rx_count - temp_reset->beacon_rx_count; - extra_info->mcast_rx_count = test->mcast_rx_count - temp_reset->mcast_rx_count; - extra_info->mcast_tx_count = test->mcast_tx_count - temp_reset->mcast_tx_count; - extra_info->ucast_rx_count = test->ucast_rx_count - temp_reset->ucast_rx_count; - extra_info->ucast_tx_count = test->ucast_tx_count - temp_reset->ucast_tx_count; - extra_info->overrun_count = test->overrun_count - temp_reset->overrun_count; - } + /* TODO : Place holder until we have similar functionality + * available for SiWx917 + */ + int32_t status = 0; return status; } @@ -138,24 +120,10 @@ int32_t wfx_rsi_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) *********************************************************************/ int32_t wfx_rsi_reset_count() { - int32_t status; - uint8_t buff[RSI_RESPONSE_MAX_SIZE] = { 0 }; - status = rsi_wlan_get(RSI_WLAN_EXT_STATS, buff, sizeof(buff)); - if (status != RSI_SUCCESS) - { - WFX_RSI_LOG("\r\n Failed, Error Code : 0x%lX\r\n", status); - } - else - { - rsi_wlan_ext_stats_t * test = (rsi_wlan_ext_stats_t *) buff; - temp_reset->beacon_lost_count = test->beacon_lost_count; - temp_reset->beacon_rx_count = test->beacon_rx_count; - temp_reset->mcast_rx_count = test->mcast_rx_count; - temp_reset->mcast_tx_count = test->mcast_tx_count; - temp_reset->ucast_rx_count = test->ucast_rx_count; - temp_reset->ucast_tx_count = test->ucast_tx_count; - temp_reset->overrun_count = test->overrun_count; - } + /* TODO : Place holder until we have similar functionality + * available for SiWx917 + */ + int32_t status = 0; return status; } @@ -187,8 +155,6 @@ static void wfx_rsi_join_cb(uint16_t status, const uint8_t * buf, const uint16_t { WFX_RSI_LOG("%s: status: %02x", __func__, status); wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING; - temp_reset = (wfx_wifi_scan_ext_t *) malloc(sizeof(wfx_wifi_scan_ext_t)); - memset(temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); if (status != RSI_SUCCESS) { /* @@ -294,24 +260,7 @@ static int32_t wfx_rsi_init(void) { int32_t status; uint8_t buf[RSI_RESPONSE_HOLD_BUFF_SIZE]; - extern void rsi_hal_board_init(void); - WFX_RSI_LOG("%s: starting(HEAP_SZ = %d)", __func__, SL_HEAP_SIZE); - //! Driver initialization - status = rsi_driver_init(wfx_rsi_drv_buf, WFX_RSI_BUF_SZ); - if ((status < RSI_DRIVER_STATUS) || (status > WFX_RSI_BUF_SZ)) - { - WFX_RSI_LOG("%s: error: RSI drv init failed with status: %02x", __func__, status); - return status; - } - - WFX_RSI_LOG("%s: rsi_device_init", __func__); - /* ! Redpine module intialisation */ - if ((status = rsi_device_init(LOAD_NWP_FW)) != RSI_SUCCESS) - { - WFX_RSI_LOG("%s: error: rsi_device_init failed with status: %02x", __func__, status); - return status; - } WFX_RSI_LOG("%s: start wireless drv task", __func__); /* * Create the driver task @@ -478,6 +427,7 @@ static void wfx_rsi_do_join(void) /* Call rsi connect call with given ssid and password * And check there is a success */ + if ((status = rsi_wlan_connect_async((int8_t *) &wfx_rsi.sec.ssid[0], (rsi_security_mode_t) wfx_rsi.sec.security, &wfx_rsi.sec.passkey[0], wfx_rsi_join_cb)) != RSI_SUCCESS) { @@ -485,7 +435,7 @@ static void wfx_rsi_do_join(void) wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING; WFX_RSI_LOG("%s: rsi_wlan_connect_async failed with status: %02x on try %d", __func__, status, wfx_rsi.join_retries); - vTaskDelay(4000); + vTaskDelay(400); /* TODO - Start a timer.. to retry */ } else @@ -501,6 +451,7 @@ static void wfx_rsi_do_join(void) { WFX_RSI_LOG("%s: starting JOIN to %s after %d tries\n", __func__, (char *) &wfx_rsi.sec.ssid[0], wfx_rsi.join_retries); } + WFX_RSI_LOG("Returning the do join"); } } @@ -518,6 +469,7 @@ static void wfx_rsi_do_join(void) void wfx_rsi_task(void * arg) { EventBits_t flags; + int32_t status = 0; #ifndef RS911X_SOCKETS TickType_t last_dhcp_poll, now; struct netif * sta_netif; @@ -537,6 +489,12 @@ void wfx_rsi_task(void * arg) wfx_started_notify(); WFX_RSI_LOG("%s: starting event wait", __func__); +#ifdef CHIP_ONNETWORK_PAIRING + memcpy(&wfx_rsi.sec.ssid[0], TOSTRING(CHIP_WIFI_SSID), sizeof(TOSTRING(CHIP_WIFI_SSID))); + memcpy(&wfx_rsi.sec.passkey[0], TOSTRING(CHIP_WIFI_PSK), sizeof(TOSTRING(CHIP_WIFI_PSK))); + xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_START_JOIN); +#endif + for (;;) { /* @@ -627,7 +585,7 @@ void wfx_rsi_task(void * arg) // Joining to the network wfx_rsi_do_join(); } - if (flags & WFX_EVT_STA_CONN) + if ((flags & WFX_EVT_STA_CONN)) { /* * Initiate the Join command (assuming we have been provisioned) @@ -851,4 +809,28 @@ int32_t wfx_rsi_send_data(void * p, uint16_t len) return status; } +int32_t wfx_rsi_init_platform() +{ + int32_t status; + /*init task - RS911x*/ + WFX_RSI_LOG("RSI_INIT"); + WFX_RSI_LOG("%s: starting(HEAP_SZ = %d)", __func__, SL_HEAP_SIZE); + //! Driver initialization + status = rsi_driver_init(wfx_rsi_drv_buf, WFX_RSI_BUF_SZ); + if ((status < RSI_DRIVER_STATUS) || (status > WFX_RSI_BUF_SZ)) + { + WFX_RSI_LOG("%s: error: RSI drv init failed with status: %02x", __func__, status); + } + + WFX_RSI_LOG("%s: rsi_device_init", __func__); + /* ! Redpine module intialisation */ + if ((status = rsi_device_init(LOAD_NWP_FW)) != RSI_SUCCESS) + { + WFX_RSI_LOG("%s: error: rsi_device_init failed with status: %02x", __func__, status); + return status; + } + + return status; +} + struct wfx_rsi wfx_rsi; diff --git a/examples/platform/silabs/SiWx917/rs911x/rsi_wlan_config.h b/examples/platform/silabs/SiWx917/SiWx917/rsi_wlan_config.h similarity index 84% rename from examples/platform/silabs/SiWx917/rs911x/rsi_wlan_config.h rename to examples/platform/silabs/SiWx917/SiWx917/rsi_wlan_config.h index f2a47b5cb8d2b5..4f2dc070ec83ac 100644 --- a/examples/platform/silabs/SiWx917/rs911x/rsi_wlan_config.h +++ b/examples/platform/silabs/SiWx917/SiWx917/rsi_wlan_config.h @@ -25,53 +25,31 @@ //! Disable feature #define RSI_DISABLE 0 -//! To enable wlan opermode -#define RSI_OPERMODE_WLAN 0 - //! To enable concurrent mode #define CONCURRENT_MODE RSI_DISABLE -//! opermode command parameters +//! opermode command paramaters /*=======================================================================*/ //! To set wlan feature select bit map #define RSI_FEATURE_BIT_MAP (FEAT_SECURITY_OPEN) //! TCP IP BYPASS feature check -#ifdef RS911X_SOCKETS -#define RSI_TCP_IP_BYPASS RSI_DISABLE - -#define RSI_TCP_IP_FEATURE_BIT_MAP \ - (TCP_IP_FEAT_DHCPV4_CLIENT | /*TCP_IP_FEAT_HTTP_CLIENT | */ \ - TCP_IP_FEAT_EXTENSION_VALID | /*TCP_IP_FEAT_SSL |*/ /*TCP_IP_FEAT_DNS_CLIENT |*/ \ - 0) -//! To set custom feature select bit map -#define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENSION_VALID +//#define RSI_TCP_IP_BYPASS RSI_DISABLE +//! TCP/IP feature select bitmap for selecting TCP/IP features +//#define RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_DHCPV4_CLIENT | TCP_IP_FEAT_ICMP) -#else /* Don't use RSI_SOCKETS */ #define RSI_TCP_IP_BYPASS RSI_ENABLE +//#define RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_DHCPV4_CLIENT | TCP_IP_FEAT_ICMP) #define RSI_TCP_IP_FEATURE_BIT_MAP (TCP_IP_FEAT_BYPASS /*| TCP_IP_FEAT_EXTENSION_VALID*/) -#endif + +//! To set custom feature select bit map +#define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set Extended custom feature select bit map -#if WIFI_ENABLE_SECURITY_WPA3 -#ifdef RSI_M4_INTERFACE -#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_256K_MODE | EXT_FEAT_IEEE_80211W) -#else -#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_384K_MODE | EXT_FEAT_IEEE_80211W) -#endif -#else -#ifdef RSI_M4_INTERFACE -#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_256K_MODE -#else -#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_384K_MODE -#endif -#endif +#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP EXT_FEAT_UART_SEL_FOR_DEBUG_PRINTS + +#define RSI_EXT_TCPIP_FEATURE_BITMAP 0 -//! To set Extended TCPIP feature select bit map -#define RSI_EXT_TCPIP_FEATURE_BITMAP (/*EXT_FEAT_HTTP_OTAF_SUPPORT |*/ EXT_TCP_IP_SSL_16K_RECORD) -//! Extended custom feature is selected internally -//! CCP -- EXT_FEAT_256K_MODE -//! Wiseconnect -- EXT_FEAT_384K_MODE /*=======================================================================*/ //! Feature frame parameters /*=======================================================================*/ @@ -82,13 +60,13 @@ #define AFE_TYPE 1 #define FEATURE_ENABLES 0 /*=======================================================================*/ -//! Band command parameters +//! Band command paramters /*=======================================================================*/ //! RSI_BAND_2P4GHZ(2.4GHz) or RSI_BAND_5GHZ(5GHz) or RSI_DUAL_BAND #define RSI_BAND RSI_BAND_2P4GHZ /*=======================================================================*/ -//! set region command parameters +//! set region command paramters /*=======================================================================*/ //! RSI_ENABLE or RSI_DISABLE Set region support @@ -98,13 +76,13 @@ #define RSI_SET_REGION_FROM_USER_OR_BEACON 1 //! 0-Default Region domain ,1-US, 2-EUROPE, 3-JAPAN -#define RSI_REGION_CODE 1 +#define RSI_REGION_CODE 3 //! 0- Without On Board Antenna , 1- With On Board Antenna #define RSI_MODULE_TYPE 1 /*=======================================================================*/ -//! set region AP command parameters +//! set region AP command paramters /*=======================================================================*/ //! RSI_ENABLE or RSI_DISABLE Set region AP support @@ -114,20 +92,21 @@ #define RSI_SET_REGION_AP_FROM_USER RSI_DISABLE //! "US" or "EU" or "JP" or other region codes -#define RSI_COUNTRY_CODE "US" +#define RSI_COUNTRY_CODE "US " + /*=======================================================================*/ //! Rejoin parameters /*=======================================================================*/ //! RSI_ENABLE or RSI_DISABLE rejoin params -#define RSI_REJOIN_PARAMS_SUPPORT RSI_ENABLE +#define RSI_REJOIN_PARAMS_SUPPORT RSI_DISABLE //! Rejoin retry count. If 0 retries infinity times -#define RSI_REJOIN_MAX_RETRY 5 +#define RSI_REJOIN_MAX_RETRY 0 //! Periodicity of rejoin attempt -#define RSI_REJOIN_SCAN_INTERVAL 1 +#define RSI_REJOIN_SCAN_INTERVAL 4 //! Beacon missed count #define RSI_REJOIN_BEACON_MISSED_COUNT 40 @@ -141,13 +120,13 @@ /*=======================================================================*/ //! RSI_ENABLE or RSI_DISABLE BG Scan support -#define RSI_BG_SCAN_SUPPORT RSI_ENABLE +#define RSI_BG_SCAN_SUPPORT RSI_DISABLE //! RSI_ENABLE or RSI_DISABLE BG scan #define RSI_BG_SCAN_ENABLE RSI_ENABLE //! RSI_ENABLE or RSI_DISABLE instant BG scan -#define RSI_INSTANT_BG RSI_ENABLE +#define RSI_INSTANT_BG 1 // RSI_DISABLE //! BG scan threshold value #define RSI_BG_SCAN_THRESHOLD 63 @@ -165,7 +144,7 @@ #define RSI_PASSIVE_SCAN_DURATION 50 //! Multi probe -#define RSI_MULTIPROBE RSI_ENABLE +#define RSI_MULTIPROBE RSI_DISABLE /*=======================================================================*/ @@ -197,15 +176,8 @@ //! RSI_ENABLE or RSI_DISABLE 11n mode in AP mode #define RSI_MODE_11N_ENABLE RSI_DISABLE -//! HT caps supported -#define RSI_HT_CAPS_NUM_RX_STBC (1 << 8) -#define RSI_HT_CAPS_SHORT_GI_20MHZ BIT(5) -#define RSI_HT_CAPS_GREENFIELD_EN BIT(4) -#define RSI_HT_CAPS_SUPPORT_CH_WIDTH BIT(1) - //! HT caps bit map. -#define RSI_HT_CAPS_BIT_MAP \ - (RSI_HT_CAPS_NUM_RX_STBC | RSI_HT_CAPS_SHORT_GI_20MHZ | RSI_HT_CAPS_GREENFIELD_EN | RSI_HT_CAPS_SUPPORT_CH_WIDTH) +#define RSI_HT_CAPS_BIT_MAP 10 /*=======================================================================*/ //! Scan command parameters @@ -253,12 +225,9 @@ #define RSI_POWER_LEVEL RSI_POWER_LEVEL_HIGH //! RSI_JOIN_FEAT_STA_BG_ONLY_MODE_ENABLE or RSI_JOIN_FEAT_LISTEN_INTERVAL_VALID -#if WIFI_ENABLE_SECURITY_WPA3 -#define RSI_JOIN_FEAT_BIT_MAP RSI_JOIN_FEAT_MFP_CAPABLE_REQUIRED -#else #define RSI_JOIN_FEAT_BIT_MAP 0 -#endif +//! #define RSI_LISTEN_INTERVAL 0 //! Transmission data rate. Physical rate at which data has to be transmitted. @@ -269,7 +238,7 @@ /*=======================================================================*/ //! DHCP client host name -#define RSI_DHCP_HOST_NAME "efr_9116" +#define RSI_DHCP_HOST_NAME "dhcp_client" //! Transmit test command parameters /*=======================================================================*/ @@ -345,16 +314,17 @@ /*=======================================================================*/ //! RSI_ENABLE or RSI_DISABLE High performance socket #define HIGH_PERFORMANCE_ENABLE RSI_ENABLE //@ RSI_ENABLE or RSI_DISABLE High performance socket -#define TOTAL_SOCKETS 10 //@ Total number of sockets. TCP TX + TCP RX + UDP TX + UDP RX -#define TOTAL_TCP_SOCKETS 4 //@ Total TCP sockets. TCP TX + TCP RX -#define TOTAL_UDP_SOCKETS 4 //@ Total UDP sockets. UDP TX + UDP RX -#define TCP_TX_ONLY_SOCKETS 0 //@ Total TCP TX only sockets. TCP TX -#define TCP_RX_ONLY_SOCKETS 0 //@ Total TCP RX only sockets. TCP RX -#define UDP_TX_ONLY_SOCKETS 0 //@ Total UDP TX only sockets. UDP TX -#define UDP_RX_ONLY_SOCKETS 0 //@ Total UDP RX only sockets. UDP RX -#define TCP_RX_HIGH_PERFORMANCE_SOCKETS 1 //@ Total TCP RX High Performance sockets -#define TCP_RX_WINDOW_SIZE_CAP 10 //@ TCP RX Window size -#define TCP_RX_WINDOW_DIV_FACTOR 10 //@ TCP RX Window division factor + +#define TOTAL_SOCKETS 1 //@ Total number of sockets. TCP TX + TCP RX + UDP TX + UDP RX +#define TOTAL_TCP_SOCKETS 1 //@ Total TCP sockets. TCP TX + TCP RX +#define TOTAL_UDP_SOCKETS 0 //@ Total UDP sockets. UDP TX + UDP RX +#define TCP_TX_ONLY_SOCKETS 0 //@ Total TCP TX only sockets. TCP TX +#define TCP_RX_ONLY_SOCKETS 1 //@ Total TCP RX only sockets. TCP RX +#define UDP_TX_ONLY_SOCKETS 0 //@ Total UDP TX only sockets. UDP TX +#define UDP_RX_ONLY_SOCKETS 0 //@ Total UDP RX only sockets. UDP RX +#define TCP_RX_HIGH_PERFORMANCE_SOCKETS 1 //@ Total TCP RX High Performance sockets +#define TCP_RX_WINDOW_SIZE_CAP 10 //@ TCP RX Window size +#define TCP_RX_WINDOW_DIV_FACTOR 10 //@ TCP RX Window division factor /*=======================================================================*/ //! Socket Create parameters @@ -384,12 +354,6 @@ //! Timeout for PING_REQUEST #define RSI_PING_REQ_TIMEOUT_MS 1000 -//! Provide HTTP/HTTPS response status code indication to application e.g 200, 404 etc -/*=======================================================================*/ -//! Enable or Diable feature -#define RSI_HTTP_STATUS_INDICATION_EN RSI_DISABLE -/*=======================================================================*/ - //! Store Config Profile parameters /*=======================================================================*/ @@ -470,7 +434,7 @@ //! To configure listen interval #define RSI_CONFIG_CLIENT_LISTEN_INTERVAL 0 //! To configure SSID -#define RSI_CONFIG_CLIENT_SSID "Matter_9116" +#define RSI_CONFIG_CLIENT_SSID "SILABS_AP" //! RSI_BAND_2P4GHZ(2.4GHz) or RSI_BAND_5GHZ(5GHz) or RSI_DUAL_BAND #define RSI_CONFIG_CLIENT_BAND RSI_BAND_2P4GHZ //! To configure channel number diff --git a/examples/platform/silabs/SiWx917/rs911x/wfx_rsi.h b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h similarity index 85% rename from examples/platform/silabs/SiWx917/rs911x/wfx_rsi.h rename to examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h index 380fc8f29e1693..4309e97ccc04d5 100644 --- a/examples/platform/silabs/SiWx917/rs911x/wfx_rsi.h +++ b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi.h @@ -21,11 +21,11 @@ * Interface to RSI Sapis */ -#define WFX_RSI_WLAN_TASK_SZ (1024 + 512 + 256) /* Unknown how big this should be */ -#define WFX_RSI_TASK_SZ (1024 + 1024) /* Stack for the WFX/RSI task */ -#define WFX_RSI_BUF_SZ (1024 * 10) /* May need tweak */ -#define WFX_RSI_CONFIG_MAX_JOIN 5 /* Max join retries */ -#define WFX_RSI_NUM_TIMERS 2 /* Number of RSI timers to alloc */ +#define WFX_RSI_WLAN_TASK_SZ (1024 + 512 + 256 + 1024 + 512) /* Unknown how big this should be */ +#define WFX_RSI_TASK_SZ (1024 + 1024 + 1024) /* Stack for the WFX/RSI task */ +#define WFX_RSI_BUF_SZ (1024 * 15) /* May need tweak */ +#define WFX_RSI_CONFIG_MAX_JOIN 5 /* Max join retries */ +#define WFX_RSI_NUM_TIMERS 2 /* Number of RSI timers to alloc */ /* * Various events fielded by the wfx_rsi task @@ -57,6 +57,8 @@ struct wfx_rsi EventGroupHandle_t events; TaskHandle_t drv_task; TaskHandle_t wlan_task; + TaskHandle_t init_task; + TaskHandle_t ble_task; uint16_t dev_state; uint16_t ap_chan; /* The chan our STA is using */ wfx_wifi_provision_t sec; diff --git a/examples/platform/silabs/SiWx917/rs911x/wfx_rsi_host.c b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c similarity index 99% rename from examples/platform/silabs/SiWx917/rs911x/wfx_rsi_host.c rename to examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c index a55e0aeb5cab2e..f44b6e9b8f7ff0 100644 --- a/examples/platform/silabs/SiWx917/rs911x/wfx_rsi_host.c +++ b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c @@ -15,15 +15,11 @@ * limitations under the License. */ +#include "stdbool.h" #include #include #include -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" #include "sl_status.h" #include "FreeRTOS.h" @@ -71,6 +67,11 @@ sl_status_t wfx_wifi_start(void) return SL_STATUS_OK; } +int32_t wfx_rsi_platform() +{ + return wfx_rsi_init_platform(); +} + /********************************************************************* * @fn void wfx_enable_sta_mode(void) * @brief diff --git a/examples/platform/silabs/SiWx917/rs911x/wfx_rsidev.c b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsidev.c similarity index 99% rename from examples/platform/silabs/SiWx917/rs911x/wfx_rsidev.c rename to examples/platform/silabs/SiWx917/SiWx917/wfx_rsidev.c index 8d8a3c1803382b..d7a464151cac53 100644 --- a/examples/platform/silabs/SiWx917/rs911x/wfx_rsidev.c +++ b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsidev.c @@ -223,7 +223,7 @@ sl_status_t sl_wfx_host_init_bus(void) USART_InitSync_TypeDef usartInit = USART_INITSYNC_DEFAULT; res = sl_wfx_host_spi_set_config(USART); - if (res != SPI_CONFIG_SUCCESS) + if (res != SPI_CONFIG_SUCESS) { return SL_STATUS_FAIL; } diff --git a/examples/platform/silabs/SiWx917/EFR32DeviceDataProvider.cpp b/examples/platform/silabs/SiWx917/SiWx917DeviceDataProvider.cpp similarity index 99% rename from examples/platform/silabs/SiWx917/EFR32DeviceDataProvider.cpp rename to examples/platform/silabs/SiWx917/SiWx917DeviceDataProvider.cpp index 6e097ffa4db0e2..9116c26f2c4607 100644 --- a/examples/platform/silabs/SiWx917/EFR32DeviceDataProvider.cpp +++ b/examples/platform/silabs/SiWx917/SiWx917DeviceDataProvider.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include "EFR32DeviceDataProvider.h" +#include "SiWx917DeviceDataProvider.h" #include #include #include diff --git a/examples/platform/silabs/SiWx917/EFR32DeviceDataProvider.h b/examples/platform/silabs/SiWx917/SiWx917DeviceDataProvider.h similarity index 100% rename from examples/platform/silabs/SiWx917/EFR32DeviceDataProvider.h rename to examples/platform/silabs/SiWx917/SiWx917DeviceDataProvider.h diff --git a/examples/platform/silabs/SiWx917/TemperatureSensor.cpp b/examples/platform/silabs/SiWx917/TemperatureSensor.cpp deleted file mode 100644 index 69ba106fd69872..00000000000000 --- a/examples/platform/silabs/SiWx917/TemperatureSensor.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "TemperatureSensor.h" - -#ifdef __cplusplus -extern "C" { -#endif -// This is a C implementation. Need the ifdef __cplusplus else we get linking issues -#include "sl_sensor_rht.h" - -#ifdef __cplusplus -} -#endif - -namespace TemperatureSensor { -constexpr uint16_t kSensorTemperatureOffset = 800; - -sl_status_t Init() -{ - return sl_sensor_rht_init(); -} - -sl_status_t GetTemp(uint32_t * relativeHumidity, int16_t * temperature) -{ - // Sensor resolution 0.001 C - // DataModel resolution 0.01 C - int32_t temp; - sl_status_t status = sl_sensor_rht_get(relativeHumidity, &temp); - *temperature = static_cast(temp / 10) - kSensorTemperatureOffset; - return status; -} -}; // namespace TemperatureSensor diff --git a/examples/platform/silabs/SiWx917/board_config.h b/examples/platform/silabs/SiWx917/board_config.h index 8c495b4fa7f513..ed92fdd145a1c7 100644 --- a/examples/platform/silabs/SiWx917/board_config.h +++ b/examples/platform/silabs/SiWx917/board_config.h @@ -28,7 +28,7 @@ /** * @file - * This file includes dev borad compile-time configuration constants for efr32. + * This file includes dev board compile-time configuration constants for SiWx917. * */ diff --git a/examples/platform/silabs/SiWx917/device/inc/system_si917.h b/examples/platform/silabs/SiWx917/device/inc/system_si917.h new file mode 100644 index 00000000000000..9c566512c5425a --- /dev/null +++ b/examples/platform/silabs/SiWx917/device/inc/system_si917.h @@ -0,0 +1,167 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ +#include +//#include "cmsis_gcc.h" + +/******************************************************************************* + * @addtogroup Parts + * @{ + ******************************************************************************/ +/******************************************************************************* + * @addtogroup EFR32 EFR32 + * @{ + ******************************************************************************/ + +/******************************************************************************* + ****************************** TYPEDEFS *********************************** + ******************************************************************************/ + +/* Interrupt vectortable entry */ +typedef union +{ + void (*VECTOR_TABLE_Type)(void); + void * topOfStack; +} tVectorEntry; + +/******************************************************************************* + ************************** GLOBAL VARIABLES ******************************* + ******************************************************************************/ +//#ifndef CCP_SI917_BRINGUP +extern uint32_t SystemCoreClock; /**< System Clock Frequency (Core Clock) */ +//#endif /* CCP_SI917_BRINGUP */ +extern uint32_t SystemHfrcoFreq; /**< System HFRCO frequency */ + +/******************************************************************************* + ***************************** PROTOTYPES ********************************** + ******************************************************************************/ + +void Reset_Handler(void); /**< Reset Handler */ +void NMI_Handler(void); /**< NMI Handler */ +void HardFault_Handler(void); /**< Hard Fault Handler */ +void MemManage_Handler(void); /**< MPU Fault Handler */ +void BusFault_Handler(void); /**< Bus Fault Handler */ +void UsageFault_Handler(void); /**< Usage Fault Handler */ +void SVC_Handler(void); /**< SVCall Handler */ +void DebugMon_Handler(void); /**< Debug Monitor Handler */ +void PendSV_Handler(void); /**< PendSV Handler */ +void SysTick_Handler(void); /**< SysTick Handler */ + +void EMU_IRQHandler(void); /**< EMU IRQ Handler */ +void FRC_PRI_IRQHandler(void); /**< FRC_PRI IRQ Handler */ +void WDOG0_IRQHandler(void); /**< WDOG0 IRQ Handler */ +void WDOG1_IRQHandler(void); /**< WDOG1 IRQ Handler */ +void FRC_IRQHandler(void); /**< FRC IRQ Handler */ +void MODEM_IRQHandler(void); /**< MODEM IRQ Handler */ +void RAC_SEQ_IRQHandler(void); /**< RAC_SEQ IRQ Handler */ +void RAC_RSM_IRQHandler(void); /**< RAC_RSM IRQ Handler */ +void BUFC_IRQHandler(void); /**< BUFC IRQ Handler */ +void LDMA_IRQHandler(void); /**< LDMA IRQ Handler */ +void GPIO_EVEN_IRQHandler(void); /**< GPIO_EVEN IRQ Handler */ +void TIMER0_IRQHandler(void); /**< TIMER0 IRQ Handler */ +void USART0_RX_IRQHandler(void); /**< USART0_RX IRQ Handler */ +void USART0_TX_IRQHandler(void); /**< USART0_TX IRQ Handler */ +void ACMP0_IRQHandler(void); /**< ACMP0 IRQ Handler */ +void ADC0_IRQHandler(void); /**< ADC0 IRQ Handler */ +void IDAC0_IRQHandler(void); /**< IDAC0 IRQ Handler */ +void I2C0_IRQHandler(void); /**< I2C0 IRQ Handler */ +void GPIO_ODD_IRQHandler(void); /**< GPIO_ODD IRQ Handler */ +void TIMER1_IRQHandler(void); /**< TIMER1 IRQ Handler */ +void USART1_RX_IRQHandler(void); /**< USART1_RX IRQ Handler */ +void USART1_TX_IRQHandler(void); /**< USART1_TX IRQ Handler */ +void LEUART0_IRQHandler(void); /**< LEUART0 IRQ Handler */ +void PCNT0_IRQHandler(void); /**< PCNT0 IRQ Handler */ +void CMU_IRQHandler(void); /**< CMU IRQ Handler */ +void MSC_IRQHandler(void); /**< MSC IRQ Handler */ +void CRYPTO0_IRQHandler(void); /**< CRYPTO IRQ Handler */ +void LETIMER0_IRQHandler(void); /**< LETIMER0 IRQ Handler */ +void AGC_IRQHandler(void); /**< AGC IRQ Handler */ +void PROTIMER_IRQHandler(void); /**< PROTIMER IRQ Handler */ +void RTCC_IRQHandler(void); /**< RTCC IRQ Handler */ +void SYNTH_IRQHandler(void); /**< SYNTH IRQ Handler */ +void CRYOTIMER_IRQHandler(void); /**< CRYOTIMER IRQ Handler */ +void RFSENSE_IRQHandler(void); /**< RFSENSE IRQ Handler */ +void FPUEH_IRQHandler(void); /**< FPUEH IRQ Handler */ +void SMU_IRQHandler(void); /**< SMU IRQ Handler */ +void WTIMER0_IRQHandler(void); /**< WTIMER0 IRQ Handler */ +void WTIMER1_IRQHandler(void); /**< WTIMER1 IRQ Handler */ +void PCNT1_IRQHandler(void); /**< PCNT1 IRQ Handler */ +void PCNT2_IRQHandler(void); /**< PCNT2 IRQ Handler */ +void USART2_RX_IRQHandler(void); /**< USART2_RX IRQ Handler */ +void USART2_TX_IRQHandler(void); /**< USART2_TX IRQ Handler */ +void I2C1_IRQHandler(void); /**< I2C1 IRQ Handler */ +void USART3_RX_IRQHandler(void); /**< USART3_RX IRQ Handler */ +void USART3_TX_IRQHandler(void); /**< USART3_TX IRQ Handler */ +void VDAC0_IRQHandler(void); /**< VDAC0 IRQ Handler */ +void CSEN_IRQHandler(void); /**< CSEN IRQ Handler */ +void LESENSE_IRQHandler(void); /**< LESENSE IRQ Handler */ +void CRYPTO1_IRQHandler(void); /**< CRYPTO1 IRQ Handler */ +void TRNG0_IRQHandler(void); /**< TRNG0 IRQ Handler */ +void SYSCFG_IRQHandler(void); /**< SYSCFG IRQ Handler */ + +uint32_t SystemCoreClockGet(void); + +/******************************************************************************* + * @brief + * Update CMSIS SystemCoreClock variable. + * + * @details + * CMSIS defines a global variable SystemCoreClock + *that shall hold the core frequency in Hz. If the + *core frequency is dynamically changed, the variable + *must be kept updated in order to be CMSIS compliant. + * + * Notice that only if changing the core clock + *frequency through the EFR CMU API, this variable + *will be kept updated. This function is only provided + * for CMSIS compliance and if a user modifies the + *the core clock outside the CMU API. + ******************************************************************************/ +#ifndef CCP_SI917_BRINGUP +static __INLINE void SystemCoreClockUpdate(void) +{ + (void) SystemCoreClockGet(); +} +#endif /* CCP_SI917_BRINGUP */ + +uint32_t SystemMaxCoreClockGet(void); + +void SystemInit(void); +uint32_t SystemHFClockGet(void); + +uint32_t SystemHFXOClockGet(void); +void SystemHFXOClockSet(uint32_t freq); + +uint32_t SystemLFRCOClockGet(void); +uint32_t SystemULFRCOClockGet(void); + +uint32_t SystemLFXOClockGet(void); +void SystemLFXOClockSet(uint32_t freq); + +/** @} End of group */ +/** @} End of group Parts */ + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c b/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c new file mode 100644 index 00000000000000..a62ea68bbbef12 --- /dev/null +++ b/examples/platform/silabs/SiWx917/device/src/startup_RS1xxxx.c @@ -0,0 +1,530 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rsi_ps_ram_func.h" +#include "system_RS1xxxx.h" +#include "system_si917.h" + +/*----------Stack Configuration-----------------------------------------------*/ +#define STACK_SIZE 0x00000C00 /*!< Stack size (in Words) */ +__attribute__((section(".co_stack"))) unsigned long pulStack[STACK_SIZE]; + +#define EXT_IRQ_COUNT 98 /**< Number of External (NVIC) interrupts */ // senthil copied from "efr32mg12p432f1024gl125.h" +#define TOTAL_INTERRUPTS (16 + EXT_IRQ_COUNT) + +#ifndef __INITIAL_SP +#define __INITIAL_SP __StackTop +#endif +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section(".vectors"))) +#endif + +/*----------Macro definition--------------------------------------------------*/ +#define WEAK __attribute__((weak)) + +/*----------Declaration of the default fault handlers-------------------------*/ +// #ifndef __START +// extern void _start(void) __attribute__((noreturn)); /* Pre Main (C library entry point) */ +// #else +// extern int __START(void) __attribute__((noreturn)); /* main entry point */ +// #endif + +/* System exception vector handler */ +__attribute__((used)) void WEAK Reset_Handler(void); +void WEAK NMI_Handler(void); +void WEAK HardFault_Handler(void); +void WEAK MemManage_Handler(void); +void WEAK BusFault_Handler(void); +void WEAK UsageFault_Handler(void); +void WEAK SVC_Handler(void); +void WEAK DebugMon_Handler(void); +void WEAK PendSV_Handler(void); +void WEAK SysTick_Handler(void); + +/*Boot up functions*/ +void RSI_Default_Reset_Handler(void); +void RSI_Default_WakeUp_Handler(void); +void RSI_PS_RestoreCpuContext(void); + +void WEAK IRQ000_Handler(void); /*!< ULP Processor Interrupt 0 */ +void WEAK IRQ001_Handler(void); /*!< ULP Processor Interrupt 1 */ +void WEAK IRQ002_Handler(void); /*!< ULP Processor Interrupt 2 */ +void WEAK IRQ003_Handler(void); /*!< ULP Processor Interrupt 3 */ +void WEAK IRQ004_Handler(void); /*!< ULP Processor Interrupt 4 */ +void WEAK IRQ005_Handler(void); /*!< ULP Processor Interrupt 5 */ +void WEAK IRQ006_Handler(void); /*!< ULP Processor Interrupt 6 */ +void WEAK IRQ007_Handler(void); /*!< ULP Processor Interrupt 7 */ +void WEAK IRQ008_Handler(void); /*!< ULP Processor Interrupt 8 */ +void WEAK IRQ009_Handler(void); /*!< ULP Processor Interrupt 9 */ +void WEAK IRQ010_Handler(void); /*!< ULP Processor Interrupt 10 */ +void WEAK IRQ011_Handler(void); /*!< ULP Processor Interrupt 11 */ +void WEAK IRQ012_Handler(void); /*!< ULP Processor Interrupt 12 */ +void WEAK IRQ013_Handler(void); /*!< ULP Processor Interrupt 13 */ +void WEAK IRQ014_Handler(void); /*!< ULP Processor Interrupt 14 */ +void WEAK IRQ015_Handler(void); /*!< ULP Processor Interrupt 15 */ +void WEAK IRQ016_Handler(void); /*!< ULP Processor Interrupt 15 */ +void WEAK IRQ017_Handler(void); /*!< ULP Processor Interrupt 17 */ +void WEAK IRQ018_Handler(void); /*!< ULP Processor Interrupt 18 */ +void WEAK IRQ019_Handler(void); /*!< ULP Processor Interrupt 19 */ +void WEAK IRQ020_Handler(void); /*!< Sleep Sensor Interrupts 0 */ /*WDT*/ +void WEAK IRQ021_Handler(void); /*!< Sleep Sensor Interrupts 1 */ +void WEAK IRQ022_Handler(void); /*!< Sleep Sensor Interrupts 2 */ +void WEAK IRQ023_Handler(void); /*!< Sleep Sensor Interrupts 3 */ +void WEAK IRQ024_Handler(void); /*!< Sleep Sensor Interrupts 4 */ +void WEAK IRQ025_Handler(void); /*!< Sleep Sensor Interrupts 5 */ +void WEAK IRQ026_Handler(void); /*!< Sleep Sensor Interrupts 6 */ +void WEAK IRQ027_Handler(void); /*!< Sleep Sensor Interrupts 7 */ +void WEAK IRQ028_Handler(void); /*!< Sleep Sensor Interrupts 8 */ /*Alarm*/ +void WEAK IRQ029_Handler(void); /*!< Sleep Sensor Interrupts 9 */ /*Msec and sec interrupt */ +void WEAK IRQ030_Handler(void); /*!< Reserved */ +void WEAK IRQ031_Handler(void); /*!< M4SS DMA interrupt */ +void WEAK IRQ032_Handler(void); /*!< Reserved */ +void WEAK IRQ033_Handler(void); /*!< M4SS DMA interrupt */ +void WEAK IRQ034_Handler(void); /*!< M4SS SCT interrupt */ +void WEAK HIF1_IRQHandler(void); /*!< HIF Interrupt 1 */ +void WEAK HIF2_IRQHandler(void); /*!< HIF Interrupt 2 */ +void WEAK IRQ037_Handler(void); /*!< SIO Interrupt */ +void WEAK IRQ038_Handler(void); /*!< USART 1 Interrupt */ +void WEAK IRQ039_Handler(void); /*!< Reserved */ +void WEAK IRQ040_Handler(void); /*!< Reserved */ +void WEAK IRQ041_Handler(void); /*!< Reserved */ +void WEAK IRQ042_Handler(void); /*!< I2C Interrupt */ +void WEAK IRQ043_Handler(void); /*!< Reserved */ +void WEAK IRQ044_Handler(void); /*!< SSI Slave Interrupt */ +void WEAK IRQ045_Handler(void); /*!< Reserved */ +void WEAK IRQ046_Handler(void); /*!< GSPI Master 1 Interrupt */ +void WEAK IRQ047_Handler(void); /*!< Reserved */ +void WEAK IRQ048_Handler(void); /*!< MCPWM Interrupt */ +void WEAK IRQ049_Handler(void); /*!< QEI Interrupt */ +void WEAK IRQ050_Handler(void); /*!< GPIO Group Interrupt 0 */ +void WEAK IRQ051_Handler(void); /*!< GPIO Group Interrupt 1 */ +void WEAK IRQ052_Handler(void); /*!< GPIO Pin Interrupt 0 */ +void WEAK IRQ053_Handler(void); /*!< GPIO Pin Interrupt 1 */ +void WEAK IRQ054_Handler(void); /*!< GPIO Pin Interrupt 2 */ +void WEAK IRQ055_Handler(void); /*!< GPIO Pin Interrupt 3 */ +void WEAK IRQ056_Handler(void); /*!< GPIO Pin Interrupt 4 */ +void WEAK IRQ057_Handler(void); /*!< GPIO Pin Interrupt 5 */ +void WEAK IRQ058_Handler(void); /*!< GPIO Pin Interrupt 6 */ +void WEAK IRQ059_Handler(void); /*!< GPIO Pin Interrupt 7 */ +void WEAK IRQ060_Handler(void); /*!< QSPI Interrupt */ +void WEAK IRQ061_Handler(void); /*!< I2C 2 Interrupt */ +void WEAK IRQ062_Handler(void); /*!< Ethernet Interrupt */ +void WEAK IRQ063_Handler(void); /*!< Reserved */ +void WEAK IRQ064_Handler(void); /*!< I2S master Interrupt */ +void WEAK IRQ065_Handler(void); /*!< Reserved */ +void WEAK IRQ066_Handler(void); /*!< Can 1 Interrupt */ +void WEAK IRQ067_Handler(void); /*!< Reserved */ +void WEAK IRQ068_Handler(void); /*!< SDMEM Interrupt */ +void WEAK IRQ069_Handler(void); /*!< PLL clock ind Interrupt */ +void WEAK IRQ070_Handler(void); /*!< Reserved */ +void WEAK IRQ071_Handler(void); /*!< CCI system Interrupt Out */ +void WEAK IRQ072_Handler(void); /*!< FPU exception */ +void WEAK IRQ073_Handler(void); /*!< USB INTR */ +void WEAK IRQ074_Handler(void); /*!< TASS_P2P_INTR */ +void WEAK IRQ075_Handler(void); /*!< WLAN Band1 intr0 */ +void WEAK IRQ076_Handler(void); /*!< WLAN Band1 intr1 */ +void WEAK IRQ077_Handler(void); /*!< Reserved */ +void WEAK IRQ078_Handler(void); /*!< Reserved */ +void WEAK IRQ079_Handler(void); /*!< BT intr */ +void WEAK IRQ080_Handler(void); /*!< ZB intr */ +void WEAK IRQ081_Handler(void); /*!< Reserved */ +void WEAK IRQ082_Handler(void); /*!< Modem disabled mode trigger intr */ +void WEAK IRQ083_Handler(void); /*!< gpio intr */ +void WEAK IRQ084_Handler(void); /*!< uart intr */ +void WEAK IRQ085_Handler(void); /*!< watch dog level intr */ +void WEAK IRQ086_Handler(void); /*!< ULP Sleep sensor interrupt */ +void WEAK IRQ087_Handler(void); /*!< ECDH intr */ +void WEAK IRQ088_Handler(void); /*!< DH intr */ +void WEAK IRQ089_Handler(void); /*!< QSPI intr */ +void WEAK IRQ090_Handler(void); /*!< ULP processor interrupt TASS */ +void WEAK IRQ091_Handler(void); /*!< Sys Tick Timer */ +void WEAK IRQ092_Handler(void); /*!< Real Timer interrupt */ +void WEAK IRQ093_Handler(void); /*!< PLL lock interrupt */ +void WEAK IRQ094_Handler(void); /*!< Reserved */ +void WEAK IRQ095_Handler(void); /*!< UART2 Interrupt */ +void WEAK IRQ096_Handler(void); /*!< I2S Interrupt */ +void WEAK IRQ097_Handler(void); /*!< I2C Interrupt */ +void WEAK IRQ098_Handler(void); /*!< RESERVED */ + +/*----------Symbols defined in linker script----------------------------------*/ +extern unsigned long _sidata; /*!< Start address for the initialization + values of the .data section. */ +extern unsigned long _sdata; /*!< Start address for the .data section */ +extern unsigned long _edata; /*!< End address for the .data section */ +extern unsigned long _sbss; /*!< Start address for the .bss section */ +extern unsigned long _ebss; /*!< End address for the .bss section */ +extern void _eram; /*!< End address for ram */ +extern uint32_t __etext; +extern unsigned long __StackTop; + +/*----------Function prototypes-----------------------------------------------*/ +extern int main(void); /*!< The entry point for the application */ +void Default_Reset_Handler(void); /*!< Default reset handler */ +static void Default_Handler(void); /*!< Default exception handler */ +/** + *@brief The minimal vector table for a Cortex M4. Note that the proper constructs + * must be placed on this to ensure that it ends up at physical address + * 0x00000000. + */ + +//(void *)0x300001 +/*CCP new */ +extern const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS]; +const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS] __attribute__((aligned(512))) __VECTOR_TABLE_ATTRIBUTE = { + /* Cortex-M Exception Handlers */ + { .topOfStack = &__INITIAL_SP }, /* Initial Stack Pointer */ + /*{ (void *)&pulStack[STACK_SIZE - 1] },*/ + { (void *) 0x300001 }, /* Reset Handler : IN CCP Platform system start + from bootloader which inturn call reset handler */ + { NMI_Handler }, /* NMI Handler */ + { HardFault_Handler }, /* Hard Fault Handler */ + { MemManage_Handler }, /* MPU Fault Handler */ + { BusFault_Handler }, /* Bus Fault Handler */ + { UsageFault_Handler }, /* Usage Fault Handler */ + { 0 }, /* Reserved */ + { 0 }, /* Reserved */ + { 0 }, /* Reserved */ + { 0 }, /* Reserved */ + { SVC_Handler }, /* SVCall Handler */ + { DebugMon_Handler }, /* Debug Monitor Handler */ + { 0 }, /* Application properties*/ + { PendSV_Handler }, /* PendSV Handler */ + { SysTick_Handler }, /* SysTick Handler */ + + /* External interrupts */ + + { IRQ000_Handler }, /* 0 */ + { IRQ001_Handler }, /* 1 */ + { IRQ002_Handler }, /* 2 */ + { IRQ003_Handler }, /* 3 */ + { IRQ004_Handler }, /* 4 */ + { IRQ005_Handler }, /* 5 */ + { IRQ006_Handler }, /* 6 */ + { IRQ007_Handler }, /* 7 */ + { IRQ008_Handler }, /* 8 */ + { IRQ009_Handler }, /* 9 */ + { IRQ010_Handler }, /* 10 */ + { IRQ011_Handler }, /* 11 */ + { IRQ012_Handler }, /* 12 */ + { IRQ013_Handler }, /* 13 */ + { IRQ014_Handler }, /* 14 */ + { IRQ015_Handler }, /* 15 */ + { IRQ016_Handler }, /* 16 */ + { IRQ017_Handler }, /* 17 */ + { IRQ018_Handler }, /* 18 */ + { IRQ019_Handler }, /* 19 */ + { IRQ020_Handler }, /* 20 */ + { IRQ021_Handler }, /* 21 */ + { IRQ022_Handler }, /* 22 */ + { IRQ023_Handler }, /* 23 */ + { IRQ024_Handler }, /* 24 */ + { IRQ025_Handler }, /* 25 */ + { IRQ026_Handler }, /* 26 */ + { IRQ027_Handler }, /* 27 */ + { IRQ028_Handler }, /* 28 */ + { IRQ029_Handler }, /* 29 */ + { (void *) &__StackTop - 0x0c }, /* 30 */ + { IRQ031_Handler }, /* 31 */ + { RSI_Default_Reset_Handler }, /* 32 */ + { IRQ033_Handler }, /* 33 */ + { IRQ034_Handler }, /* 34 */ + { HIF1_IRQHandler }, /* 35 */ + { HIF2_IRQHandler }, /* 36 */ + { IRQ037_Handler }, /* 37 */ + { IRQ038_Handler }, /* 38 */ + { IRQ039_Handler }, /* 39 */ + { RSI_PS_RestoreCpuContext }, /* 40 */ + { IRQ041_Handler }, /* 41 */ + { IRQ042_Handler }, /* 42 */ + { (void *) 0x10AD10AD }, /* 43 */ + { IRQ044_Handler }, /* 44 */ + { 0 }, /* 45 */ + { IRQ046_Handler }, /* 46 */ + { IRQ047_Handler }, /* 47 */ + { IRQ048_Handler }, /* 48 */ + { IRQ049_Handler }, /* 49 */ + { IRQ050_Handler }, /* 50 - Reserved */ + { IRQ051_Handler }, + { IRQ052_Handler }, + { IRQ053_Handler }, + { IRQ054_Handler }, + { IRQ055_Handler }, + { IRQ056_Handler }, + { IRQ057_Handler }, + { IRQ058_Handler }, + { IRQ059_Handler }, + { IRQ060_Handler }, + { IRQ061_Handler }, + { IRQ062_Handler }, + { IRQ063_Handler }, + { IRQ064_Handler }, + { 0 }, + { IRQ066_Handler }, + { 0 }, + { IRQ068_Handler }, + { IRQ069_Handler }, + { 0 }, + { IRQ071_Handler }, + { IRQ072_Handler }, + { IRQ073_Handler }, + { IRQ074_Handler }, + { IRQ075_Handler }, + { IRQ076_Handler }, + { 0 }, + { 0 }, + { IRQ079_Handler }, + { IRQ080_Handler }, + { 0 }, + { IRQ082_Handler }, + { IRQ083_Handler }, + { IRQ084_Handler }, + { IRQ085_Handler }, + { IRQ086_Handler }, + { IRQ087_Handler }, + { IRQ088_Handler }, + { IRQ089_Handler }, + { IRQ090_Handler }, + { IRQ091_Handler }, + { IRQ092_Handler }, + { IRQ093_Handler }, + { 0 }, + { IRQ095_Handler }, + { 0 }, + { IRQ097_Handler }, +}; + +/** + * @brief This is the code that gets never called, Dummy handler + * @param None + * @retval None + */ +void Default_Reset_Handler(void) +{ + /*Generic Default reset handler for CM4 */ + while (1) + ; +} + +void Copy_Table() +{ + uint32_t *pSrc, *pDest; + extern uint32_t __etext; + extern uint32_t __data_start__; + extern uint32_t __data_end__; + pSrc = &__etext; + pDest = &__data_start__; + + for (; pDest < &__data_end__;) + { + *pDest++ = *pSrc++; + } +} + +void Zero_Table() +{ + uint32_t * pDest; + extern uint32_t __bss_start__; + extern uint32_t __bss_end__; + pDest = &__bss_start__; + + for (; pDest < &__bss_end__;) + { + *pDest++ = 0UL; + } +} +void Reset_Handler(void) +{ +#ifndef __NO_SYSTEM_INIT + SystemInit(); /* CMSIS System Initialization */ +#endif + +#ifdef BOOTLOADER_ENABLE + SystemInit2(); +#endif /* BOOTLOADER_ENABLE */ + +#if defined(__GNUC__) && defined(__START) + Copy_Table(); + Zero_Table(); + __START(); +#else +#if 0 // senthil_ccp + __PROGRAM_START(); /* Enter PreMain (C library entry point) */ +#else + Copy_Table(); + Zero_Table(); + _start(); +#endif +#endif /* __GNUC__ */ +} + +void RSI_Default_Reset_Handler(void) +{ +#ifndef __NO_SYSTEM_INIT + SystemInit(); /* CMSIS System Initialization */ +#endif + +#ifdef BOOTLOADER_ENABLE + SystemInit2(); +#endif /* BOOTLOADER_ENABLE */ + +#if defined(__GNUC__) && defined(__START) + Copy_Table(); + Zero_Table(); + __START(); +#else +#if 0 // senthil_ccp + __PROGRAM_START(); /* Enter PreMain (C library entry point) */ +#else + Copy_Table(); + Zero_Table(); + _start(); +#endif +#endif /* __GNUC__ */ +} + +/** + *@brief Provide weak aliases for each Exception handler to the Default_Handler. + * As they are weak aliases, any function with the same name will override + * this definition. + */ +//#pragma weak Reset_Handler = RSI_Default_Reset_Handler +#pragma weak NMI_Handler = Default_Handler +#pragma weak HardFault_Handler = Default_Handler +#pragma weak MemManage_Handler = Default_Handler +#pragma weak BusFault_Handler = Default_Handler +#pragma weak UsageFault_Handler = Default_Handler +#pragma weak SVC_Handler = Default_Handler +#pragma weak DebugMon_Handler = Default_Handler +#pragma weak PendSV_Handler = Default_Handler +#pragma weak SysTick_Handler = Default_Handler +/*----------------------------------external interrupts------------------------------ */ +#pragma weak IRQ000_Handler = Default_Handler +#pragma weak IRQ001_Handler = Default_Handler +#pragma weak IRQ002_Handler = Default_Handler +#pragma weak IRQ003_Handler = Default_Handler +#pragma weak IRQ004_Handler = Default_Handler +#pragma weak IRQ005_Handler = Default_Handler +#pragma weak IRQ006_Handler = Default_Handler +#pragma weak IRQ007_Handler = Default_Handler +#pragma weak IRQ008_Handler = Default_Handler +#pragma weak IRQ009_Handler = Default_Handler +#pragma weak IRQ010_Handler = Default_Handler +#pragma weak IRQ011_Handler = Default_Handler +#pragma weak IRQ012_Handler = Default_Handler +#pragma weak IRQ013_Handler = Default_Handler +#pragma weak IRQ014_Handler = Default_Handler +#pragma weak IRQ015_Handler = Default_Handler +#pragma weak IRQ016_Handler = Default_Handler +#pragma weak IRQ017_Handler = Default_Handler +#pragma weak IRQ018_Handler = Default_Handler +#pragma weak IRQ019_Handler = Default_Handler +#pragma weak IRQ020_Handler = Default_Handler +#pragma weak IRQ021_Handler = Default_Handler +#pragma weak IRQ022_Handler = Default_Handler +#pragma weak IRQ023_Handler = Default_Handler +#pragma weak IRQ024_Handler = Default_Handler +#pragma weak IRQ025_Handler = Default_Handler +#pragma weak IRQ026_Handler = Default_Handler +#pragma weak IRQ027_Handler = Default_Handler +#pragma weak IRQ028_Handler = Default_Handler +#pragma weak IRQ029_Handler = Default_Handler +#pragma weak IRQ030_Handler = Default_Handler +#pragma weak IRQ031_Handler = Default_Handler +#pragma weak IRQ032_Handler = Default_Handler +#pragma weak IRQ033_Handler = Default_Handler +#pragma weak IRQ034_Handler = Default_Handler +#pragma weak HIF1_IRQHandler = Default_Handler +#pragma weak HIF2_IRQHandler = Default_Handler +#pragma weak IRQ037_Handler = Default_Handler +#pragma weak IRQ038_Handler = Default_Handler +#pragma weak IRQ039_Handler = Default_Handler +#pragma weak IRQ040_Handler = Default_Handler +#pragma weak IRQ041_Handler = Default_Handler +#pragma weak IRQ042_Handler = Default_Handler +#pragma weak IRQ043_Handler = Default_Handler +#pragma weak IRQ044_Handler = Default_Handler +#pragma weak IRQ045_Handler = Default_Handler +#pragma weak IRQ046_Handler = Default_Handler +#pragma weak IRQ047_Handler = Default_Handler +#pragma weak IRQ048_Handler = Default_Handler +#pragma weak IRQ049_Handler = Default_Handler +#pragma weak IRQ050_Handler = Default_Handler +#pragma weak IRQ051_Handler = Default_Handler +#pragma weak IRQ052_Handler = Default_Handler +#pragma weak IRQ053_Handler = Default_Handler +#pragma weak IRQ054_Handler = Default_Handler +#pragma weak IRQ055_Handler = Default_Handler +#pragma weak IRQ056_Handler = Default_Handler +#pragma weak IRQ057_Handler = Default_Handler +#pragma weak IRQ058_Handler = Default_Handler +#pragma weak IRQ059_Handler = Default_Handler +#pragma weak IRQ060_Handler = Default_Handler +#pragma weak IRQ061_Handler = Default_Handler +#pragma weak IRQ062_Handler = Default_Handler +#pragma weak IRQ063_Handler = Default_Handler +#pragma weak IRQ064_Handler = Default_Handler +#pragma weak IRQ065_Handler = Default_Handler +#pragma weak IRQ066_Handler = Default_Handler +#pragma weak IRQ067_Handler = Default_Handler +#pragma weak IRQ068_Handler = Default_Handler +#pragma weak IRQ069_Handler = Default_Handler +#pragma weak IRQ070_Handler = Default_Handler +#pragma weak IRQ071_Handler = Default_Handler +#pragma weak IRQ072_Handler = Default_Handler +#pragma weak IRQ073_Handler = Default_Handler +#pragma weak IRQ074_Handler = Default_Handler +#pragma weak IRQ075_Handler = Default_Handler +#pragma weak IRQ076_Handler = Default_Handler +#pragma weak IRQ077_Handler = Default_Handler +#pragma weak IRQ078_Handler = Default_Handler +#pragma weak IRQ079_Handler = Default_Handler +#pragma weak IRQ080_Handler = Default_Handler +#pragma weak IRQ081_Handler = Default_Handler +#pragma weak IRQ082_Handler = Default_Handler +#pragma weak IRQ083_Handler = Default_Handler +#pragma weak IRQ084_Handler = Default_Handler +#pragma weak IRQ085_Handler = Default_Handler +#pragma weak IRQ086_Handler = Default_Handler +#pragma weak IRQ087_Handler = Default_Handler +#pragma weak IRQ088_Handler = Default_Handler +#pragma weak IRQ089_Handler = Default_Handler +#pragma weak IRQ090_Handler = Default_Handler +#pragma weak IRQ091_Handler = Default_Handler +#pragma weak IRQ092_Handler = Default_Handler +#pragma weak IRQ093_Handler = Default_Handler +#pragma weak IRQ094_Handler = Default_Handler +#pragma weak IRQ095_Handler = Default_Handler +#pragma weak IRQ096_Handler = Default_Handler +#pragma weak IRQ097_Handler = Default_Handler +#pragma weak IRQ098_Handler = Default_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, + * preserving the system state for examination by a debugger. + * @param None + * @retval None + */ +static void Default_Handler(void) +{ + /* Go into an infinite loop. */ + while (1) + { + } +} + +/*********************** (C) COPYRIGHT 2009 Coocox ************END OF FILE*****/ diff --git a/examples/platform/silabs/SiWx917/device/src/startup_si917.c b/examples/platform/silabs/SiWx917/device/src/startup_si917.c new file mode 100644 index 00000000000000..03cb7fffe07744 --- /dev/null +++ b/examples/platform/silabs/SiWx917/device/src/startup_si917.c @@ -0,0 +1,403 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "system_si917.h" +#include +#include +//#include "cmsis_gcc.h" + +#ifdef BOOTLOADER_ENABLE +#include "api/btl_interface.h" + +#endif + +#ifdef SL_APP_PROPERTIES +#include "api/application_properties.h" + +#endif + +#define EXT_IRQ_COUNT 51 /**< Number of External (NVIC) interrupts */ // senthil copied from "efr32mg12p432f1024gl125.h" +#define TOTAL_INTERRUPTS (16 + EXT_IRQ_COUNT) + +#ifdef BOOTLOADER_ENABLE +extern MainBootloaderTable_t mainStageTable; + +extern void SystemInit2(void); + +/*---------------------------------------------------------------------------- + * Exception / Interrupt Handler Function Prototype + *----------------------------------------------------------------------------*/ +typedef void (*VECTOR_TABLE_Type)(void); +#endif + +#ifdef SL_APP_PROPERTIES +extern ApplicationProperties_t sl_app_properties; + +/*---------------------------------------------------------------------------- + * Exception / Interrupt Handler Function Prototype + *----------------------------------------------------------------------------*/ +typedef void (*VECTOR_TABLE_Type)(void); +#endif + +/*--------------------------------------------------------------------------- + * External References + *---------------------------------------------------------------------------*/ +extern uint32_t __INITIAL_SP; +extern uint32_t __StackTop; + +#ifndef __INITIAL_SP +#define __INITIAL_SP __StackTop +#endif +#ifndef __VECTOR_TABLE_ATTRIBUTE +#define __VECTOR_TABLE_ATTRIBUTE __attribute__((used, section(".vectors"))) +#endif + +extern void __PROGRAM_START(void); + +#if defined(__START) && defined(__GNUC__) +extern int __START(void) __attribute__((noreturn)); /* main entry point */ +void Zero_Table(); +void Copy_Table(); +#endif /* __START */ + +/*--------------------------------------------------------------------------- + * Internal References + *---------------------------------------------------------------------------*/ +void Reset_Handler(void); +void Default_Handler(void); + +#if defined(__GNUC__) +#ifndef __STACK_SIZE +#define __STACK_SIZE 0x00000400 +#endif /* __STACK_SIZE */ + +#ifndef __HEAP_SIZE +#define __HEAP_SIZE 0x00000C00 +#endif /* __HEAP_SIZE */ +#endif /* __GNUC__ */ + +/*---------------------------------------------------------------------------- + * Exception / Interrupt Handler + *----------------------------------------------------------------------------*/ +/* Cortex-M Processor Exceptions */ +void NMI_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void HardFault_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void MemManage_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void BusFault_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void UsageFault_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void DebugMon_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void SVC_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void PendSV_Handler(void) __attribute__((weak, alias("Default_Handler"))); +void SysTick_Handler(void) __attribute__((weak, alias("Default_Handler"))); +#ifndef SL_APP_PROPERTIES +/* Provide a dummy value for the sl_app_properties symbol. */ +void sl_app_properties(void); /* Prototype to please MISRA checkers. */ +void sl_app_properties(void) __attribute__((weak, alias("Default_Handler"))); +#endif + +/* Part Specific Interrupts */ + +void EMU_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void FRC_PRI_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void WDOG0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void WDOG1_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void FRC_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void MODEM_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void RAC_SEQ_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void RAC_RSM_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void BUFC_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void LDMA_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void GPIO_EVEN_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void TIMER0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART0_RX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART0_TX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void ACMP0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void ADC0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void IDAC0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void I2C0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void GPIO_ODD_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void TIMER1_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART1_RX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART1_TX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void LEUART0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void PCNT0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void CMU_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void MSC_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void CRYPTO0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void LETIMER0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void AGC_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void PROTIMER_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void RTCC_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void SYNTH_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void CRYOTIMER_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void RFSENSE_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void FPUEH_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void SMU_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void WTIMER0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void WTIMER1_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void PCNT1_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void PCNT2_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART2_RX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART2_TX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void I2C1_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART3_RX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void USART3_TX_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void VDAC0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void CSEN_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void LESENSE_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void CRYPTO1_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); +void TRNG0_IRQHandler(void) __attribute__((weak, alias("Default_Handler"))); + +#if 0 // senthil_ccp + +#ifndef __PROGRAM_START + +/** + \brief Initializes data and bss sections + \details This default implementations initialized all data and additional bss + sections relying on .copy.table and .zero.table specified properly + in the used linker script. + + */ +void __cmsis_start(void) +{ + extern void _start(void) __NO_RETURN; + + typedef struct { + uint32_t const* src; + uint32_t* dest; + uint32_t wlen; + } __copy_table_t; + + typedef struct { + uint32_t* dest; + uint32_t wlen; + } __zero_table_t; + + extern const __copy_table_t __copy_table_start__; + extern const __copy_table_t __copy_table_end__; + extern const __zero_table_t __zero_table_start__; + extern const __zero_table_t __zero_table_end__; + + for (__copy_table_t const* pTable = &__copy_table_start__; pTable < &__copy_table_end__; ++pTable) { + for(uint32_t i=0u; iwlen; ++i) { + pTable->dest[i] = pTable->src[i]; + } + } + + for (__zero_table_t const* pTable = &__zero_table_start__; pTable < &__zero_table_end__; ++pTable) { + for(uint32_t i=0u; iwlen; ++i) { + pTable->dest[i] = 0u; + } + } + + _start(); +} + +#define __PROGRAM_START __cmsis_start +#endif + +#endif / senthil_ccp +/*---------------------------------------------------------------------------- + * Exception / Interrupt Vector table + *----------------------------------------------------------------------------*/ + +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +#if defined(__ICCARM__) +#pragma data_alignment = 512 +extern const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS]; +const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS] __VECTOR_TABLE_ATTRIBUTE = { +#elif defined(__GNUC__) +extern const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS]; +// const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS] __attribute__((aligned(512))) __VECTOR_TABLE_ATTRIBUTE = { +const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS] __attribute__((aligned(512))) __VECTOR_TABLE_ATTRIBUTE = { +#else +extern const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS]; +const tVectorEntry __VECTOR_TABLE[TOTAL_INTERRUPTS] __VECTOR_TABLE_ATTRIBUTE = { +#endif + /* Cortex-M Exception Handlers */ + { .topOfStack = &__INITIAL_SP }, /* Initial Stack Pointer */ + { Reset_Handler }, /* Reset Handler */ + { NMI_Handler }, /* NMI Handler */ + { HardFault_Handler }, /* Hard Fault Handler */ + { MemManage_Handler }, /* MPU Fault Handler */ + { BusFault_Handler }, /* Bus Fault Handler */ + { UsageFault_Handler }, /* Usage Fault Handler */ + { Default_Handler }, /* Reserved */ + { Default_Handler }, /* Reserved */ + { Default_Handler }, /* Reserved */ +#ifdef BOOTLOADER_ENABLE + { (VECTOR_TABLE_Type) &mainStageTable }, +#else + { Default_Handler }, /* Reserved */ +#endif + { SVC_Handler }, /* SVCall Handler */ + { DebugMon_Handler }, /* Debug Monitor Handler */ +#ifdef SL_APP_PROPERTIES + { (VECTOR_TABLE_Type) &sl_app_properties }, /* Application properties*/ +#else + { sl_app_properties }, /* Application properties*/ +#endif + { PendSV_Handler }, /* PendSV Handler */ + { SysTick_Handler }, /* SysTick Handler */ + + /* External interrupts */ + + { EMU_IRQHandler }, /* 0 */ + { FRC_PRI_IRQHandler }, /* 1 */ + { WDOG0_IRQHandler }, /* 2 */ + { WDOG1_IRQHandler }, /* 3 */ + { FRC_IRQHandler }, /* 4 */ + { MODEM_IRQHandler }, /* 5 */ + { RAC_SEQ_IRQHandler }, /* 6 */ + { RAC_RSM_IRQHandler }, /* 7 */ + { BUFC_IRQHandler }, /* 8 */ + { LDMA_IRQHandler }, /* 9 */ + { GPIO_EVEN_IRQHandler }, /* 10 */ + { TIMER0_IRQHandler }, /* 11 */ + { USART0_RX_IRQHandler }, /* 12 */ + { USART0_TX_IRQHandler }, /* 13 */ + { ACMP0_IRQHandler }, /* 14 */ + { ADC0_IRQHandler }, /* 15 */ + { IDAC0_IRQHandler }, /* 16 */ + { I2C0_IRQHandler }, /* 17 */ + { GPIO_ODD_IRQHandler }, /* 18 */ + { TIMER1_IRQHandler }, /* 19 */ + { USART1_RX_IRQHandler }, /* 20 */ + { USART1_TX_IRQHandler }, /* 21 */ + { LEUART0_IRQHandler }, /* 22 */ + { PCNT0_IRQHandler }, /* 23 */ + { CMU_IRQHandler }, /* 24 */ + { MSC_IRQHandler }, /* 25 */ + { CRYPTO0_IRQHandler }, /* 26 */ + { LETIMER0_IRQHandler }, /* 27 */ + { AGC_IRQHandler }, /* 28 */ + { PROTIMER_IRQHandler }, /* 29 */ + { RTCC_IRQHandler }, /* 30 */ + { SYNTH_IRQHandler }, /* 31 */ + { CRYOTIMER_IRQHandler }, /* 32 */ + { RFSENSE_IRQHandler }, /* 33 */ + { FPUEH_IRQHandler }, /* 34 */ + { SMU_IRQHandler }, /* 35 */ + { WTIMER0_IRQHandler }, /* 36 */ + { WTIMER1_IRQHandler }, /* 37 */ + { PCNT1_IRQHandler }, /* 38 */ + { PCNT2_IRQHandler }, /* 39 */ + { USART2_RX_IRQHandler }, /* 40 */ + { USART2_TX_IRQHandler }, /* 41 */ + { I2C1_IRQHandler }, /* 42 */ + { USART3_RX_IRQHandler }, /* 43 */ + { USART3_TX_IRQHandler }, /* 44 */ + { VDAC0_IRQHandler }, /* 45 */ + { CSEN_IRQHandler }, /* 46 */ + { LESENSE_IRQHandler }, /* 47 */ + { CRYPTO1_IRQHandler }, /* 48 */ + { TRNG0_IRQHandler }, /* 49 */ + { Default_Handler }, /* 50 - Reserved */ +}; + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + +//#if defined (__START) && defined (__GNUC__) //senthil_ccp +void Copy_Table() +{ + uint32_t *pSrc, *pDest; + extern uint32_t __etext; + extern uint32_t __data_start__; + extern uint32_t __data_end__; + pSrc = &__etext; + pDest = &__data_start__; + + for (; pDest < &__data_end__;) + { + *pDest++ = *pSrc++; + } +} + +void Zero_Table() +{ + uint32_t * pDest; + extern uint32_t __bss_start__; + extern uint32_t __bss_end__; + pDest = &__bss_start__; + + for (; pDest < &__bss_end__;) + { + *pDest++ = 0UL; + } +} +//#endif /* __START */ + +/*--------------------------------------------------------------------------- + * Reset Handler called on controller reset + *---------------------------------------------------------------------------*/ +#if 0 + void SysTick_Handler(void) +{ + SysTick_Handler(); +} +#endif + +void Reset_Handler(void) +{ +#ifndef __NO_SYSTEM_INIT + SystemInit(); /* CMSIS System Initialization */ +#endif + +#ifdef BOOTLOADER_ENABLE + SystemInit2(); +#endif /* BOOTLOADER_ENABLE */ + +#if defined(__GNUC__) && defined(__START) + Copy_Table(); + Zero_Table(); + __START(); +#else +#if 0 // senthil_ccp + __PROGRAM_START(); /* Enter PreMain (C library entry point) */ +#else + Copy_Table(); + Zero_Table(); + _start(); +#endif +#endif /* __GNUC__ */ +} + +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-noreturn" +#endif + +/*---------------------------------------------------------------------------- + * Default Handler for Exceptions / Interrupts + *----------------------------------------------------------------------------*/ +void Default_Handler(void) +{ + while (true) + { + } +} + +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +#pragma clang diagnostic pop +#endif diff --git a/examples/platform/silabs/SiWx917/TemperatureSensor.h b/examples/platform/silabs/SiWx917/init_ccpPlatform.cpp similarity index 64% rename from examples/platform/silabs/SiWx917/TemperatureSensor.h rename to examples/platform/silabs/SiWx917/init_ccpPlatform.cpp index 116287e9a37155..0d5bb78bea9e7c 100644 --- a/examples/platform/silabs/SiWx917/TemperatureSensor.h +++ b/examples/platform/silabs/SiWx917/init_ccpPlatform.cpp @@ -17,12 +17,30 @@ * limitations under the License. */ -#pragma once +#include "AppConfig.h" +#include +#include -#include "sl_status.h" -#include +#ifdef __cplusplus +extern "C" { +#endif +#include +#include -namespace TemperatureSensor { -sl_status_t Init(); -sl_status_t GetTemp(uint32_t * relativeHumidity, int16_t * temperature); -}; // namespace TemperatureSensor +#include + +#include "init_ccpPlatform.h" + +void initAntenna(void); + +void init_ccpPlatform(void) +{ + +#if SILABS_LOG_ENABLED + silabsInitLog(); +#endif +} + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/silabs/SiWx917/init_efrPlatform.h b/examples/platform/silabs/SiWx917/init_ccpPlatform.h similarity index 96% rename from examples/platform/silabs/SiWx917/init_efrPlatform.h rename to examples/platform/silabs/SiWx917/init_ccpPlatform.h index aeb47b8aaed3d1..986e2fecb18dd9 100644 --- a/examples/platform/silabs/SiWx917/init_efrPlatform.h +++ b/examples/platform/silabs/SiWx917/init_ccpPlatform.h @@ -22,8 +22,7 @@ extern "C" { #endif -void init_efrPlatform(void); - +void init_ccpPlatform(void); #ifdef __cplusplus } #endif diff --git a/examples/platform/silabs/SiWx917/init_efrPlatform.cpp b/examples/platform/silabs/SiWx917/init_efrPlatform.cpp deleted file mode 100644 index 993b4fefe069f8..00000000000000 --- a/examples/platform/silabs/SiWx917/init_efrPlatform.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "AppConfig.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include - -#include - -#if CHIP_ENABLE_OPENTHREAD -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "platform-efr32.h" - -#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE -#include "openthread/heap.h" -#endif // OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE -#endif // CHIP_ENABLE_OPENTHREAD - -#include "init_efrPlatform.h" -#include "sl_component_catalog.h" -#include "sl_mbedtls.h" -#include "sl_system_init.h" - -#if SL_SYSTEM_VIEW -#include "SEGGER_SYSVIEW.h" -#endif - -void initAntenna(void); - -void init_efrPlatform(void) -{ - sl_system_init(); - sl_mbedtls_init(); -#if SL_SYSTEM_VIEW - SEGGER_SYSVIEW_Conf(); - SEGGER_SYSVIEW_Start(); -#endif - -#if SILABS_LOG_ENABLED - silabsInitLog(); -#endif - -#if CHIP_ENABLE_OPENTHREAD - efr32RadioInit(); - efr32AlarmInit(); -#endif // CHIP_ENABLE_OPENTHREAD -} - -#ifdef __cplusplus -} -#endif diff --git a/examples/platform/silabs/SiWx917/ldscripts/efr32mg12.ld b/examples/platform/silabs/SiWx917/ldscripts/SiWx917.ld similarity index 74% rename from examples/platform/silabs/SiWx917/ldscripts/efr32mg12.ld rename to examples/platform/silabs/SiWx917/ldscripts/SiWx917.ld index f9f4f55f8b9a73..13f0b226a4d9f6 100644 --- a/examples/platform/silabs/SiWx917/ldscripts/efr32mg12.ld +++ b/examples/platform/silabs/SiWx917/ldscripts/SiWx917.ld @@ -1,7 +1,6 @@ /* * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. + * Copyright (c) 2022 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,40 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/***************************************************************************//** - * Linker script for Silicon Labs EFR32MG12P devices - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1048576 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 262144 + FLASH (rx) : ORIGIN = 0x08012000, LENGTH = 0x200000 + RAM (rwx) : ORIGIN = 0xC, LENGTH = 262144 } /* Linker script to place sections and symbol values. Should be used together @@ -146,10 +117,13 @@ SECTIONS } > FLASH __etext = ALIGN (4); + _sidata = __etext; .data : AT (__etext) { __data_start__ = .; + _sdata = __data_start__; + *(vtable) *(.data*) . = ALIGN (4); @@ -181,6 +155,7 @@ SECTIONS . = ALIGN(4); /* All data end */ __data_end__ = .; + _edata = __data_end__; } > RAM @@ -188,11 +163,13 @@ SECTIONS { . = ALIGN(4); __bss_start__ = .; + _sbss = __bss_start__; *(.bss) *(.bss.*) *(COMMON) . = ALIGN(4); __bss_end__ = .; + _ebss = __bss_end__; } > RAM .heap (COPY) : @@ -237,6 +214,6 @@ SECTIONS ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= __main_flash_end__, "NVM3 is excessing the flash size !") /* Check if FLASH usage exceeds FLASH size */ - ASSERT( LENGTH(FLASH) >= (__etext), "FLASH memory overflowed !") +/* ASSERT( LENGTH(FLASH) >= (__etext), "FLASH memory overflowed !") */ /* Build error need to be checked for CCP */ ASSERT((__etext + SIZEOF(.data)) <= __nvm3Base, "FLASH memory overlapped with NVM section.") } diff --git a/examples/platform/silabs/SiWx917/ldscripts/efr32mg21.ld b/examples/platform/silabs/SiWx917/ldscripts/efr32mg21.ld deleted file mode 100644 index 2c9de0ddede7d7..00000000000000 --- a/examples/platform/silabs/SiWx917/ldscripts/efr32mg21.ld +++ /dev/null @@ -1,289 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/***************************************************************************//** - * Linker script for Silicon Labs EFR32MG21 devices - * @version 5.7.2 - ******************************************************************************* - * # License - * Copyright 2018 Silicon Laboratories Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1048576 - 8192 /* 8K is reserved at top of flash on MG21 */ - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 98304 -} - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __copy_table_start__ - * __copy_table_end__ - * __zero_table_start__ - * __zero_table_end__ - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapBase - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - * __Vectors_End - * __Vectors_Size - */ -ENTRY(Reset_Handler) - -SECTIONS -{ - .text : - { - KEEP(*(.vectors)) - __Vectors_End = .; - __Vectors_Size = __Vectors_End - __Vectors; - __end__ = .; - - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - KEEP(*(.application_properties)) - KEEP(*(.gecko_configuration)) - KEEP(*(.xo_configuration)) - KEEP(*(.gatt_header)) - KEEP(*(.gatt_data)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - - KEEP(*(.eh_frame*)) - } > FLASH - - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - - - /* To copy multiple ROM to RAM sections, - * uncomment .copy.table section and, - * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ - /* - .copy.table : - { - . = ALIGN(4); - __copy_table_start__ = .; - LONG (__etext) - LONG (__data_start__) - LONG (__data_end__ - __data_start__) - LONG (__etext2) - LONG (__data2_start__) - LONG (__data2_end__ - __data2_start__) - __copy_table_end__ = .; - } > FLASH - */ - - /* To clear multiple BSS sections, - * uncomment .zero.table section and, - * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ - /* - .zero.table : - { - . = ALIGN(4); - __zero_table_start__ = .; - LONG (__bss_start__) - LONG (__bss_end__ - __bss_start__) - LONG (__bss2_start__) - LONG (__bss2_end__ - __bss2_start__) - __zero_table_end__ = .; - } > FLASH - */ - - __etext = .; - - /*******************************************************************/ - /* Define flash block for BLE-simee & CHIP-nvm3 */ - /* simee: 9000H (36k) bytes for BLE nvm3 */ - /* chipNvm3_section: 4000H (16k) bytes for CHIP nvm3. */ - /* 8K is reserved for OpenThread's NVM which is mapped directly at */ - /* the top of flash */ - /*******************************************************************/ - - OPENTHREAD_NVM_SIZE = 8192; - - .nvm_dummy (DSECT): - { - __nvm3_dummy_begin = .; - . = ALIGN (8192); - __nvm3_dummy_simee = .; - KEEP(*(.simee)); - . = ALIGN (8192); - __nvm3_dummy_chip = .; - KEEP(*(chipNvm3_section)); - . = ALIGN (8192); - . += OPENTHREAD_NVM_SIZE; - . = ALIGN (8192); - } > FLASH - - /* Set NVM to end of FLASH */ - __nvm3Base = LENGTH(FLASH) - SIZEOF(.nvm_dummy) + (__nvm3_dummy_simee - __nvm3_dummy_begin); - __nvm3ChipBase = LENGTH(FLASH) - SIZEOF(.nvm_dummy) + (__nvm3_dummy_chip - __nvm3_dummy_begin); - - - /*******************************************************************/ - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - . = ALIGN (4); - PROVIDE (__ram_func_section_start = .); - *(.ram) - PROVIDE (__ram_func_section_end = .); - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - end = __end__; - _end = __end__; - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") - - - /* Check if FLASH usage exceeds FLASH size */ - ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !") - ASSERT((__etext + SIZEOF(.data)) <= __nvm3Base, "FLASH memory overlapped with NVM section.") -} \ No newline at end of file diff --git a/examples/platform/silabs/SiWx917/ldscripts/efr32mg24.ld b/examples/platform/silabs/SiWx917/ldscripts/efr32mg24.ld deleted file mode 100644 index b057a9af720a7a..00000000000000 --- a/examples/platform/silabs/SiWx917/ldscripts/efr32mg24.ld +++ /dev/null @@ -1,243 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/***************************************************************************//** - * @file gcc_EFR32MG24.ld - * @brief GNU Linker Script for Cortex-M based device - * @version V2.2.0 - * @date 16. December 2020 - * Linker script for Silicon Labs EFR32MG24 devices - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories, Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08006000, LENGTH = 0x17A000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000 -} - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __copy_table_start__ - * __copy_table_end__ - * __zero_table_start__ - * __zero_table_end__ - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - * __StackSeal (only if ARMv8-M stack sealing is used) - */ - -ENTRY(Reset_Handler) - -SECTIONS -{ - .text : - { - KEEP(*(.vectors)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - .copy.table : - { - . = ALIGN(4); - __copy_table_start__ = .; - - LONG (__etext) - LONG (__data_start__) - LONG ((__data_end__ - __data_start__) / 4) - - __copy_table_end__ = .; - } > FLASH - - .zero.table : - { - . = ALIGN(4); - __zero_table_start__ = .; - __zero_table_end__ = .; - __etext = ALIGN(4); - } > FLASH - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - . = ALIGN (4); - PROVIDE (__ram_func_section_start = .); - *(.ram) - PROVIDE (__ram_func_section_end = .); - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM AT > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - end = __end__; - _end = __end__; - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - __main_flash_end__ = ORIGIN(FLASH) + LENGTH(FLASH); - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - /* KEEP(*(.stackseal*))*/ - } > RAM - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - .nvm (DSECT) : { - KEEP(*(.simee*)) - } > FLASH - - /* Last page of flash is reserved for the manufacturing token space */ - linker_nvm_end = __main_flash_end__ - 8192; - linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); - linker_nvm_size = SIZEOF(.nvm); - __nvm3Base = linker_nvm_begin; - __attestation_credentials_base = linker_nvm_end; - - /* Check if data + heap + stack exceeds RAM limit */ - /*ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")*/ - ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= __main_flash_end__, "NVM3 is excessing the flash size !") - - /* Check if FLASH usage exceeds FLASH size */ - ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !") -} diff --git a/examples/platform/silabs/SiWx917/ldscripts/mgm24.ld b/examples/platform/silabs/SiWx917/ldscripts/mgm24.ld deleted file mode 100644 index b057a9af720a7a..00000000000000 --- a/examples/platform/silabs/SiWx917/ldscripts/mgm24.ld +++ /dev/null @@ -1,243 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/***************************************************************************//** - * @file gcc_EFR32MG24.ld - * @brief GNU Linker Script for Cortex-M based device - * @version V2.2.0 - * @date 16. December 2020 - * Linker script for Silicon Labs EFR32MG24 devices - ******************************************************************************* - * # License - * Copyright 2022 Silicon Laboratories, Inc. www.silabs.com - ******************************************************************************* - * - * SPDX-License-Identifier: Zlib - * - * The licensor of this software is Silicon Laboratories Inc. - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - * - ******************************************************************************/ - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x08006000, LENGTH = 0x17A000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000 -} - -/* Linker script to place sections and symbol values. Should be used together - * with other linker script that defines memory regions FLASH and RAM. - * It references following symbols, which must be defined in code: - * Reset_Handler : Entry of reset handler - * - * It defines following symbols, which code can use without definition: - * __exidx_start - * __exidx_end - * __copy_table_start__ - * __copy_table_end__ - * __zero_table_start__ - * __zero_table_end__ - * __etext - * __data_start__ - * __preinit_array_start - * __preinit_array_end - * __init_array_start - * __init_array_end - * __fini_array_start - * __fini_array_end - * __data_end__ - * __bss_start__ - * __bss_end__ - * __end__ - * end - * __HeapLimit - * __StackLimit - * __StackTop - * __stack - * __StackSeal (only if ARMv8-M stack sealing is used) - */ - -ENTRY(Reset_Handler) - -SECTIONS -{ - .text : - { - KEEP(*(.vectors)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - .copy.table : - { - . = ALIGN(4); - __copy_table_start__ = .; - - LONG (__etext) - LONG (__data_start__) - LONG ((__data_end__ - __data_start__) / 4) - - __copy_table_end__ = .; - } > FLASH - - .zero.table : - { - . = ALIGN(4); - __zero_table_start__ = .; - __zero_table_end__ = .; - __etext = ALIGN(4); - } > FLASH - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - . = ALIGN (4); - PROVIDE (__ram_func_section_start = .); - *(.ram) - PROVIDE (__ram_func_section_end = .); - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM AT > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - end = __end__; - _end = __end__; - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - __main_flash_end__ = ORIGIN(FLASH) + LENGTH(FLASH); - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - /* KEEP(*(.stackseal*))*/ - } > RAM - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - .nvm (DSECT) : { - KEEP(*(.simee*)) - } > FLASH - - /* Last page of flash is reserved for the manufacturing token space */ - linker_nvm_end = __main_flash_end__ - 8192; - linker_nvm_begin = linker_nvm_end - SIZEOF(.nvm); - linker_nvm_size = SIZEOF(.nvm); - __nvm3Base = linker_nvm_begin; - __attestation_credentials_base = linker_nvm_end; - - /* Check if data + heap + stack exceeds RAM limit */ - /*ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")*/ - ASSERT( (linker_nvm_begin + SIZEOF(.nvm)) <= __main_flash_end__, "NVM3 is excessing the flash size !") - - /* Check if FLASH usage exceeds FLASH size */ - ASSERT( LENGTH(FLASH) >= (__etext + SIZEOF(.data)), "FLASH memory overflowed !") -} diff --git a/examples/platform/silabs/SiWx917/matter_config.cpp b/examples/platform/silabs/SiWx917/matter_config.cpp index 83e909588d9811..caa6a34b218482 100644 --- a/examples/platform/silabs/SiWx917/matter_config.cpp +++ b/examples/platform/silabs/SiWx917/matter_config.cpp @@ -25,9 +25,15 @@ #include +#ifdef __cplusplus +extern "C" { +#endif #ifdef SL_WIFI #include "wfx_host_events.h" #endif /* SL_WIFI */ +#ifdef __cplusplus +} +#endif #if PW_RPC_ENABLED #include "Rpc.h" @@ -46,89 +52,34 @@ using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; #include -// If building with the EFR32-provided crypto backend, we can use the -// opaque keystore -#if CHIP_CRYPTO_PLATFORM -#include -static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeystore; -#endif - -#include "EFR32DeviceDataProvider.h" - -#if CHIP_ENABLE_OPENTHREAD -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +// If building with the SiWx917-provided crypto backend, we can use the -// ================================================================================ -// Matter Networking Callbacks -// ================================================================================ -void LockOpenThreadTask(void) -{ - chip::DeviceLayer::ThreadStackMgr().LockThreadStack(); -} - -void UnlockOpenThreadTask(void) -{ - chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack(); -} - -// ================================================================================ -// EFR32MatterConfig Methods -// ================================================================================ - -CHIP_ERROR EFR32MatterConfig::InitOpenThread(void) -{ - SILABS_LOG("Initializing OpenThread stack"); - ReturnErrorOnFailure(ThreadStackMgr().InitThreadStack()); - -#if CHIP_DEVICE_CONFIG_THREAD_FTD - ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router)); -#else // CHIP_DEVICE_CONFIG_THREAD_FTD -#if CHIP_DEVICE_CONFIG_ENABLE_SED - ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice)); -#else // CHIP_DEVICE_CONFIG_ENABLE_SED - ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice)); -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED -#endif // CHIP_DEVICE_CONFIG_THREAD_FTD - - SILABS_LOG("Starting OpenThread task"); - return ThreadStackMgrImpl().StartThreadTask(); -} -#endif // CHIP_ENABLE_OPENTHREAD +#include "SiWx917DeviceDataProvider.h" #if EFR32_OTA_ENABLED void EFR32MatterConfig::InitOTARequestorHandler(System::Layer * systemLayer, void * appState) { +#if 0 // TODO : OTA is not planned now for CCP OTAConfig::Init(); +#endif } #endif -void EFR32MatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event, intptr_t arg) -{ +void SI917MatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event, intptr_t arg){ // Initialize OTA only when Thread or WiFi connectivity is established - if (((event->Type == DeviceEventType::kThreadConnectivityChange) && + /*if (((event->Type == DeviceEventType::kThreadConnectivityChange) && (event->ThreadConnectivityChange.Result == kConnectivity_Established)) || ((event->Type == DeviceEventType::kInternetConnectivityChange) && (event->InternetConnectivityChange.IPv6 == kConnectivity_Established))) { -#if EFR32_OTA_ENABLED SILABS_LOG("Scheduling OTA Requestor initialization") chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); -#endif - } + }*/ + SILABS_LOG("Scheduling OTA Requestor initialization") } -CHIP_ERROR EFR32MatterConfig::InitMatter(const char * appName) +CHIP_ERROR SI917MatterConfig::InitMatter(const char * appName) { CHIP_ERROR err; @@ -154,39 +105,27 @@ CHIP_ERROR EFR32MatterConfig::InitMatter(const char * appName) SILABS_LOG("Init CHIP Stack"); // Init Chip memory management before the stack ReturnErrorOnFailure(chip::Platform::MemoryInit()); + + SILABS_LOG("Init RSI 911x Platform"); + int32_t deviceInit = wfx_rsi_platform(); + if (deviceInit != SL_STATUS_OK) + { + SILABS_LOG("RSI init failed"); + return CHIP_ERROR_INTERNAL; + } ReturnErrorOnFailure(PlatformMgr().InitChipStack()); chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(appName); -#if CHIP_ENABLE_OPENTHREAD - ReturnErrorOnFailure(InitOpenThread()); -#endif - // Stop Matter event handling while setting up resources chip::DeviceLayer::PlatformMgr().LockChipStack(); // Create initParams with SDK example defaults here static chip::CommonCaseDeviceServerInitParams initParams; -#if CHIP_CRYPTO_PLATFORM - // When building with EFR32 crypto, use the opaque key store - // instead of the default (insecure) one. - gOperationalKeystore.Init(); - initParams.operationalKeystore = &gOperationalKeystore; -#endif - // Initialize the remaining (not overridden) providers to the SDK example defaults (void) initParams.InitializeStaticResourcesBeforeServerInit(); -#if CHIP_ENABLE_OPENTHREAD - // Set up OpenThread configuration when OpenThread is included - chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; - nativeParams.lockCb = LockOpenThreadTask; - nativeParams.unlockCb = UnlockOpenThreadTask; - nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance(); - initParams.endpointNativeParams = static_cast(&nativeParams); -#endif - // Init Matter Server and Start Event Loop err = chip::Server::GetInstance().Init(initParams); chip::DeviceLayer::PlatformMgr().UnlockChipStack(); @@ -194,7 +133,8 @@ CHIP_ERROR EFR32MatterConfig::InitMatter(const char * appName) ReturnErrorOnFailure(err); // OTA Requestor initialization will be triggered by the connectivity events - PlatformMgr().AddEventHandler(ConnectivityEventCallback, reinterpret_cast(nullptr)); + // TODO + // PlatformMgr().AddEventHandler(ConnectivityEventCallback, reinterpret_cast(nullptr)); SILABS_LOG("Starting Platform Manager Event Loop"); ReturnErrorOnFailure(PlatformMgr().StartEventLoopTask()); @@ -211,16 +151,8 @@ CHIP_ERROR EFR32MatterConfig::InitMatter(const char * appName) } #ifdef SL_WIFI -void EFR32MatterConfig::InitWiFi(void) +void SI917MatterConfig::InitWiFi(void) { -#ifdef WF200_WIFI - // Start wfx bus communication task. - wfx_bus_start(); -#ifdef SL_WFX_USE_SECURE_LINK - wfx_securelink_task_start(); // start securelink key renegotiation task -#endif // SL_WFX_USE_SECURE_LINK -#endif /* WF200_WIFI */ - #ifdef RS911X_WIFI /* * Start up any RSI interface stuff diff --git a/examples/platform/silabs/SiWx917/matter_config.h b/examples/platform/silabs/SiWx917/matter_config.h index e0af60356becf9..6b3bb622a075a2 100644 --- a/examples/platform/silabs/SiWx917/matter_config.h +++ b/examples/platform/silabs/SiWx917/matter_config.h @@ -22,7 +22,7 @@ #include #include -class EFR32MatterConfig +class SI917MatterConfig { public: static CHIP_ERROR InitMatter(const char * appName); diff --git a/examples/platform/silabs/SiWx917/project_include/OpenThreadConfig.h b/examples/platform/silabs/SiWx917/project_include/OpenThreadConfig.h deleted file mode 100644 index dccf3c816b7b66..00000000000000 --- a/examples/platform/silabs/SiWx917/project_include/OpenThreadConfig.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Overrides to default OpenThread configuration. - * - */ - -#pragma once - -#include - -// Disable the SiLabs-supplied OpenThread logging facilities and use -// the facilities provided by the Device Layer (see -// src/platform/silabs/Logging.cpp). -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_APP - -// Turn on a moderate level of logging in OpenThread -// Enable use of external heap allocator (calloc/free) for OpenThread. -#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 - -// EFR32MG21A020F1024IM32 has 96k of RAM. Reduce the number of buffers to -// conserve RAM for this Series 2 part. -#if defined(EFR32MG21) -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22 -#define OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE 512 -#define OPENTHREAD_CONFIG_CLI_UART_RX_BUFFER_SIZE 512 -#endif - -#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1 -#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 - -#define OPENTHREAD_CONFIG_DNS_CLIENT_ENABLE 1 -#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 -#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 - -// disable unused features -#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0 -#define OPENTHREAD_CONFIG_JOINER_ENABLE 0 -#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 -#define OPENTHREAD_CONFIG_UDP_FORWARD_ENABLE 0 -#define OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE 0 -#define OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE 0 -#define OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE 0 -#define OPENTHREAD_CONFIG_TCP_ENABLE 0 - -// Support udp multicast by enabling Multicast Listener Registration (MLR) -#define OPENTHREAD_CONFIG_MLR_ENABLE 1 - -// Define as 1 to stay awake between fragments while transmitting a large packet, -// and to stay awake after receiving a packet with frame pending set to true. -#define OPENTHREAD_CONFIG_MAC_STAY_AWAKE_BETWEEN_FRAGMENTS 1 - -// Use the SiLabs-supplied default platform configuration for remainder -// of OpenThread config options. -// -// NB: This file gets included during the build of OpenThread. Hence -// it cannot use "openthread" in the path to the included file. -// -#include "openthread-core-efr32-config.h" diff --git a/examples/platform/silabs/SiWx917/pw_sys_io/BUILD.gn b/examples/platform/silabs/SiWx917/pw_sys_io/BUILD.gn index 722d2a7cad24e6..20547c3b7beabc 100644 --- a/examples/platform/silabs/SiWx917/pw_sys_io/BUILD.gn +++ b/examples/platform/silabs/SiWx917/pw_sys_io/BUILD.gn @@ -17,7 +17,7 @@ import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" +examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" config("default_config") { include_dirs = [ "public" ] diff --git a/examples/platform/silabs/SiWx917/pw_sys_io/sys_io_efr32.cc b/examples/platform/silabs/SiWx917/pw_sys_io/sys_io_siwx917.cc similarity index 100% rename from examples/platform/silabs/SiWx917/pw_sys_io/sys_io_efr32.cc rename to examples/platform/silabs/SiWx917/pw_sys_io/sys_io_siwx917.cc diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/efx_spi.c b/examples/platform/silabs/SiWx917/rs911x/hal/efx_spi.c deleted file mode 100644 index f01cac3b657c7c..00000000000000 --- a/examples/platform/silabs/SiWx917/rs911x/hal/efx_spi.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Includes - */ -#include -#include -#include - -#include "dmadrv.h" -#include "em_chip.h" -#include "em_cmu.h" -#include "em_core.h" -#include "em_device.h" -#include "em_gpio.h" -#include "em_ldma.h" -#if defined(EFR32MG12) -#include "em_usart.h" -#elif defined(EFR32MG24) -#include "em_eusart.h" -#endif -#include "spidrv.h" - -#include "gpiointerrupt.h" -#include "sl_device_init_clocks.h" -#include "sl_status.h" - -#include "FreeRTOS.h" -#include "event_groups.h" -#include "task.h" - -#include "wfx_host_events.h" -#include "wfx_rsi.h" - -#include "rsi_board_configuration.h" -#include "rsi_driver.h" -#include "sl_device_init_dpll.h" -#include "sl_device_init_hfxo.h" - -StaticSemaphore_t xEfxSpiIntfSemaBuffer; -static SemaphoreHandle_t spi_sem; - -#if defined(EFR32MG12) -#include "sl_spidrv_exp_config.h" -extern SPIDRV_Handle_t sl_spidrv_exp_handle; -#endif - -#if defined(EFR32MG24) -#include "sl_spidrv_eusart_exp_config.h" -extern SPIDRV_Handle_t sl_spidrv_eusart_exp_handle; -#endif - -static unsigned int tx_dma_channel; -static unsigned int rx_dma_channel; - -static uint32_t dummy_data; /* Used for DMA - when results don't matter */ -extern void rsi_gpio_irq_cb(uint8_t irqnum); -//#define RS911X_USE_LDMA - -/******************************************************** - * @fn sl_wfx_host_gpio_init(void) - * @brief - * Deal with the PINS that are not associated with SPI - - * Ie. RESET, Wakeup - * @return - * None - **********************************************************/ -void sl_wfx_host_gpio_init(void) -{ - // Enable GPIO clock. - CMU_ClockEnable(cmuClock_GPIO, true); - - GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, PINOUT_SET); - GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModePushPull, PINOUT_CLEAR); - - CMU_OscillatorEnable(cmuOsc_LFXO, true, true); - - // Set up interrupt based callback function - trigger on both edges. - GPIOINT_Init(); - GPIO_PinModeSet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin, gpioModeInputPull, PINOUT_CLEAR); - GPIO_ExtIntConfig(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin, SL_WFX_HOST_PINOUT_SPI_IRQ, true, false, true); - GPIOINT_CallbackRegister(SL_WFX_HOST_PINOUT_SPI_IRQ, rsi_gpio_irq_cb); - GPIO_IntDisable(1 << SL_WFX_HOST_PINOUT_SPI_IRQ); /* Will be enabled by RSI */ - - // Change GPIO interrupt priority (FreeRTOS asserts unless this is done here!) - NVIC_SetPriority(GPIO_EVEN_IRQn, WFX_SPI_NVIC_PRIORITY); - NVIC_SetPriority(GPIO_ODD_IRQn, WFX_SPI_NVIC_PRIORITY); -} - -/***************************************************************** - * @fn void sl_wfx_host_reset_chip(void) - * @brief - * To reset the WiFi CHIP - * @return - * None - ****************************************************************/ -void sl_wfx_host_reset_chip(void) -{ - // Pull it low for at least 1 ms to issue a reset sequence - GPIO_PinOutClear(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); - - // Delay for 10ms - vTaskDelay(pdMS_TO_TICKS(10)); - - // Hold pin high to get chip out of reset - GPIO_PinOutSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); - - // Delay for 3ms - vTaskDelay(pdMS_TO_TICKS(3)); -} - -/***************************************************************** - * @fn void rsi_hal_board_init(void) - * @brief - * Initialize the board - * @return - * None - ****************************************************************/ -void rsi_hal_board_init(void) -{ - spi_sem = xSemaphoreCreateBinaryStatic(&xEfxSpiIntfSemaBuffer); - xSemaphoreGive(spi_sem); - - /* Assign DMA channel from Handle*/ -#if defined(EFR32MG12) - /* MG12 + rs9116 combination uses USART driver */ - tx_dma_channel = sl_spidrv_exp_handle->txDMACh; - rx_dma_channel = sl_spidrv_exp_handle->rxDMACh; - -#elif defined(EFR32MG24) - /* MG24 + rs9116 combination uses EUSART driver */ - tx_dma_channel = sl_spidrv_eusart_exp_handle->txDMACh; - rx_dma_channel = sl_spidrv_eusart_exp_handle->rxDMACh; -#endif - - /* GPIO INIT of MG12 & MG24 : Reset, Wakeup, Interrupt */ - WFX_RSI_LOG("RSI_HAL: init GPIO"); - sl_wfx_host_gpio_init(); - - /* Reset of Wifi chip */ - WFX_RSI_LOG("RSI_HAL: Reset Wifi"); - sl_wfx_host_reset_chip(); - WFX_RSI_LOG("RSI_HAL: Init done"); -} - -/***************************************************************************** - *@fn static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void *userParam) - * - *@brief - * complete dma - * - * @param[in] channel: - * @param[in] sequenceNO: sequence number - * @param[in] userParam :user parameter - * - * @return - * None - ******************************************************************************/ -static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void * userParam) -{ - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - // uint8_t *buf = (void *)userParam; - - (void) channel; - (void) sequenceNo; - (void) userParam; - - // WFX_RSI_LOG ("SPI: DMA done [%x,%x,%x,%x]", buf [0], buf [1], buf [2], buf [3]); - xSemaphoreGiveFromISR(spi_sem, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - - return true; -} - -/************************************************************* - * @fn static void receiveDMA(uint8_t *rx_buf, uint16_t xlen) - * @brief - * RX buf was specified - * TX buf was not specified by caller - so we - * transmit dummy data (typically 0) - * @param[in] rx_buf: - * @param[in] xlen: - * @return - * None - *******************************************************************/ -static void receiveDMA(uint8_t * rx_buf, uint16_t xlen) -{ - /* - * The caller wants to receive data - - * The xmit can be dummy data (no src increment for tx) - */ - dummy_data = 0; - DMADRV_PeripheralMemory(rx_dma_channel, MY_USART_RX_SIGNAL, (void *) rx_buf, (void *) &(MY_USART->RXDATA), true, xlen, - dmadrvDataSize1, rx_dma_complete, NULL); - - // Start transmit DMA. - DMADRV_MemoryPeripheral(tx_dma_channel, MY_USART_TX_SIGNAL, (void *) &(MY_USART->TXDATA), (void *) &(dummy_data), false, xlen, - dmadrvDataSize1, NULL, NULL); -} - -/***************************************************************************** - *@fn static void transmitDMA(void *rx_buf, void *tx_buf, uint8_t xlen) - *@brief - * we have a tx_buf. There are some instances where - * a rx_buf is not specified. If one is specified then - * the caller wants results (auto increment src) - * @param[in] rx_buf: - * @param[in] tx_buf: - * @param[in] xlen: - * @return - * None - ******************************************************************************/ -static void transmitDMA(uint8_t * rx_buf, uint8_t * tx_buf, uint16_t xlen) -{ - void * buf; - bool srcinc; - /* - * we have a tx_buf. There are some instances where - * a rx_buf is not specified. If one is specified then - * the caller wants results (auto increment src) - * TODO - the caller specified 8/32 bit - we should use this - * instead of dmadrvDataSize1 always - */ - if (rx_buf == NULL) - { - buf = &dummy_data; - srcinc = false; - } - else - { - buf = rx_buf; - srcinc = true; - /* DEBUG */ rx_buf[0] = 0xAA; - rx_buf[1] = 0x55; - } - DMADRV_PeripheralMemory(rx_dma_channel, MY_USART_RX_SIGNAL, buf, (void *) &(MY_USART->RXDATA), srcinc, xlen, dmadrvDataSize1, - rx_dma_complete, buf); - // Start transmit DMA. - DMADRV_MemoryPeripheral(tx_dma_channel, MY_USART_TX_SIGNAL, (void *) &(MY_USART->TXDATA), (void *) tx_buf, true, xlen, - dmadrvDataSize1, NULL, NULL); -} - -/********************************************************************* - * @fn int16_t rsi_spi_transfer(uint8_t *tx_buf, uint8_t *rx_buf, uint16_t xlen, uint8_t mode) - * @brief - * Do a SPI transfer - Mode is 8/16 bit - But every 8 bit is aligned - * @param[in] tx_buf: - * @param[in] rx_buf: - * @param[in] xlen: - * @param[in] mode: - * @return - * None - **************************************************************************/ -int16_t rsi_spi_transfer(uint8_t * tx_buf, uint8_t * rx_buf, uint16_t xlen, uint8_t mode) -{ - // WFX_RSI_LOG ("SPI: Xfer: tx=%x,rx=%x,len=%d",(uint32_t)tx_buf, (uint32_t)rx_buf, xlen); - if (xlen > MIN_XLEN) - { - MY_USART->CMD = USART_CMD_CLEARRX | USART_CMD_CLEARTX; - if (xSemaphoreTake(spi_sem, portMAX_DELAY) != pdTRUE) - { - return RSI_FALSE; - } - if (tx_buf == NULL) - { - receiveDMA(rx_buf, xlen); - } - else - { - transmitDMA(rx_buf, tx_buf, xlen); - } - - /* - * receiveDMA() and transmitDMA() are asynchronous - * Our application design assumes that this function is synchronous - * To make it synchronous, we wait to re-acquire the semaphore before exiting this function - * rx_dma_complete() gives back the semaphore when the SPI transfer is done - */ - if (xSemaphoreTake(spi_sem, pdMS_TO_TICKS(RSI_SEM_BLOCK_MIN_TIMER_VALUE_MS)) == pdTRUE) - { - // Transfer complete - // Give back the semaphore before exiting, so that it may be re-acquired - // in this function, just before the next transfer - xSemaphoreGive(spi_sem); - } - // Temporary patch - // Sometimes the xSemaphoreTake() above is getting stuck indefinitely - // As a workaround, if the transfer is not done within RSI_SEM_BLOCK_MIN_TIMER_VALUE_MS - // stop and start it again - // No need to re-acquire the semaphore since this is the function that acquired it - // TODO: Remove this after a permanent solution is found to the problem of the transfer getting stuck - else - { - uint32_t ldma_flags = 0; - uint32_t rem_len = 0; - rem_len = LDMA_TransferRemainingCount(RSI_LDMA_TRANSFER_CHANNEL_NUM); - LDMA_StopTransfer(RSI_LDMA_TRANSFER_CHANNEL_NUM); - ldma_flags = LDMA_IntGet(); - LDMA_IntClear(ldma_flags); - receiveDMA(rx_buf, rem_len); - if (xSemaphoreTake(spi_sem, portMAX_DELAY) == pdTRUE) - { - xSemaphoreGive(spi_sem); - } - } - } - - return RSI_ERROR_NONE; -} diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_board_configuration.h b/examples/platform/silabs/SiWx917/rs911x/hal/rsi_board_configuration.h deleted file mode 100644 index 204e7519d29b5b..00000000000000 --- a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_board_configuration.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _RSI_BOARD_CONFIGURATION_H_ -#define _RSI_BOARD_CONFIGURATION_H_ - -typedef struct -{ - unsigned char port; - unsigned char pin; -} rsi_pin_t; - -#define PIN(port_id, pin_id) \ - (rsi_pin_t) { .port = gpioPort##port_id, .pin = pin_id } - -#if defined(EFR32MG12_BRD4161A) || defined(BRD4161A) || defined(EFR32MG12_BRD4162A) || defined(BRD4162A) || \ - defined(EFR32MG12_BRD4163A) || defined(BRD4163A) || defined(EFR32MG12_BRD4164A) || defined(BRD4164A) || \ - defined(EFR32MG12_BRD4170A) || defined(BRD4170A) -// BRD4161-63-64 are pin to pin compatible for SPI -#include "brd4161a.h" -#elif defined(EFR32MG24_BRD4186C) || defined(BRD4186C) -#include "brd4186c.h" -#elif defined(EFR32MG24_BRD4187C) || defined(BRD4187C) -#include "brd4187c.h" -#else -#error "Need SPI Pins" -#endif /* EFR32MG12_BRD4161A */ - -#endif /* _RSI_BOARD_CONFIGURATION_H_ */ diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_interrupt.c b/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_interrupt.c deleted file mode 100644 index 40e4189635d71c..00000000000000 --- a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_interrupt.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include "dmadrv.h" -#include "em_chip.h" -#include "em_cmu.h" -#include "em_core.h" -#include "em_device.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" -#include "gpiointerrupt.h" -#include "sl_device_init_clocks.h" -#include "sl_status.h" - -#include "FreeRTOS.h" -#include "event_groups.h" -#include "task.h" - -#include "wfx_host_events.h" -#include "wfx_rsi.h" - -#include "rsi_board_configuration.h" -#include "rsi_driver.h" - -typedef void (*UserIntCallBack_t)(void); -UserIntCallBack_t call_back, gpio_callback; -#ifdef LOGGING_STATS -uint8_t current_pin_set, prev_pin_set; -#endif /* LOGGING_STATS */ - -/* ARGSUSED */ -void rsi_gpio_irq_cb(uint8_t irqnum) -{ - - // WFX_RSI_LOG ("RSI: Got Int=%d", irqnum) - if (irqnum != SL_WFX_HOST_PINOUT_SPI_IRQ) - return; - GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ); - - // WFX_RSI_LOG ("Got SPI intr, cb=%x", (uint32_t)call_back); - if (call_back != NULL) - (*call_back)(); -} - -/*===================================================*/ -/** - * @fn void rsi_hal_intr_config(void (* rsi_interrupt_handler)()) - * @brief Starts and enables the SPI interrupt - * @param[in] rsi_interrupt_handler() ,call back function to handle interrupt - * @param[out] none - * @return none - * @description This HAL API should contain the code to initialize the register/pins - * related to interrupts and enable the interrupts. - */ -void rsi_hal_intr_config(void (*rsi_interrupt_handler)(void)) -{ - call_back = rsi_interrupt_handler; - WFX_RSI_LOG("RSI:Set SPI intr CB to=%x", (uint32_t) call_back); -} - -/*===================================================*/ -/** - * @fn void rsi_hal_log_stats_intr_config(void (* rsi_give_wakeup_indication)()) - * @brief Checks the interrupt and map/set gpio callback function - * @param[in] rsi_give_wakeup_indication() ,gpio call back function to handle interrupt - * @param[out] none - * @return none - * @description This HAL API should contain the code - * related to mapping of gpio callback function. - */ -#ifdef LOGGING_STATS -void rsi_hal_log_stats_intr_config(void (*rsi_give_wakeup_indication)()) -{ - gpio_callback = rsi_give_wakeup_indication; -} -#endif - -/*===================================================*/ -/** - * @fn void rsi_hal_intr_mask(void) - * @brief Disables the SPI Interrupt - * @param[in] none - * @param[out] none - * @return none - * @description This HAL API should contain the code to mask/disable interrupts. - */ -void rsi_hal_intr_mask(void) -{ - // WFX_RSI_LOG ("RSI:Disable IRQ"); - // NVIC_DisableIRQ(GPIO_ODD_IRQn); - GPIO_IntDisable(1 << SL_WFX_HOST_PINOUT_SPI_IRQ); -} - -/*===================================================*/ -/** - * @fn void rsi_hal_intr_unmask(void) - * @brief Enables the SPI interrupt - * @param[in] none - * @param[out] none - * @return none - * @description This HAL API should contain the code to enable interrupts. - */ -void rsi_hal_intr_unmask(void) -{ - // Unmask/Enable the interrupt - NVIC_EnableIRQ(GPIO_ODD_IRQn); - NVIC_EnableIRQ(GPIO_EVEN_IRQn); - GPIO_IntEnable(1 << SL_WFX_HOST_PINOUT_SPI_IRQ); - // WFX_RSI_LOG ("RSI:Enable IRQ (mask=%x)", GPIO_IntGetEnabled ()); -} - -/*===================================================*/ -/** - * @fn void rsi_hal_intr_clear(void) - * @brief Clears the pending interrupt - * @param[in] none - * @param[out] none - * @return none - * @description This HAL API should contain the code to clear the handled interrupts. - */ -void rsi_hal_intr_clear(void) -{ - GPIO_IntClear(1 << SL_WFX_HOST_PINOUT_SPI_IRQ); -} - -/*===================================================*/ -/** - * @fn void rsi_hal_intr_pin_status(void) - * @brief Checks the SPI interrupt at pin level - * @param[in] none - * @param[out] uint8_t, interrupt status - * @return none - * @description This API is used to check interrupt pin status(pin level whether it is high/low). - */ -uint8_t rsi_hal_intr_pin_status(void) -{ - uint32_t mask; - // Return interrupt pin status(high(1) /low (0)) - mask = GPIO_PinInGet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin); - - return !!mask; -} diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_ioports.c b/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_ioports.c deleted file mode 100644 index 1ff5bc5fedf4f2..00000000000000 --- a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_ioports.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include "dmadrv.h" -#include "em_chip.h" -#include "em_cmu.h" -#include "em_core.h" -#include "em_device.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" -#include "gpiointerrupt.h" -#include "sl_device_init_clocks.h" -#include "sl_status.h" - -#include "FreeRTOS.h" -#include "event_groups.h" -#include "task.h" - -#include "wfx_host_events.h" -#include "wfx_rsi.h" - -#include "rsi_board_configuration.h" -#include "rsi_driver.h" - -/*===========================================================*/ -/** - * @fn void rsi_hal_config_gpio(uint8_t gpio_number,uint8_t mode,uint8_t value) - * @brief Configures gpio pin in output mode,with a value - * @param[in] uint8_t gpio_number, gpio pin number to be configured - * @param[in] uint8_t mode , input/output mode of the gpio pin to configure - * 0 - input mode - * 1 - output mode - * @param[in] uint8_t value, default value to be driven if gpio is configured in output mode - * 0 - low - * 1 - high - * @param[out] none - * @return none - * @description This API is used to configure host gpio pin in output mode. - */ -void rsi_hal_config_gpio(uint8_t gpio_number, uint8_t mode, uint8_t value) -{ - - CMU_ClockEnable(cmuClock_GPIO, true); - - // WFX_RSI_LOG ("RSI: CFG GPIO: 0x%x", gpio_number); - switch (gpio_number) - { - case RSI_HAL_RESET_PIN: - GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, PINOUT_SET); - break; - default: - break; - } -} - -/*===========================================================*/ -/** - * @fn void rsi_hal_set_gpio(uint8_t gpio_number) - * @brief Makes/drives the gpio value high - * @param[in] uint8_t gpio_number, gpio pin number - * @param[out] none - * @return none - * @description This API is used to drives or makes the host gpio value high. - */ -void rsi_hal_set_gpio(uint8_t gpio_number) -{ - // WFX_RSI_LOG ("RSI: SET GPIO: 0x%x", gpio_number); - switch (gpio_number) - { - case RSI_HAL_RESET_PIN: - GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModeWiredOrPullDown, PINOUT_SET); - break; - default: - break; - } -} - -/*===========================================================*/ -/** - * @fn uint8_t rsi_hal_get_gpio(void) - * @brief get the gpio pin value - * @param[in] uint8_t gpio_number, gpio pin number - * @param[out] none - * @return gpio pin value - * @description This API is used to configure get the gpio pin value. - */ -uint8_t rsi_hal_get_gpio(uint8_t gpio_number) -{ - // WFX_RSI_LOG ("RSI: GET GPIO: 0x%x", gpio_number); - switch (gpio_number) - { - case RSI_HAL_RESET_PIN: - return GPIO_PinInGet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); - case RSI_HAL_MODULE_INTERRUPT_PIN: - return GPIO_PinInGet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin); - default: - break; - } - - return 0; -} - -/*===========================================================*/ -/** - * @fn void rsi_hal_set_gpio(uint8_t gpio_number) - * @brief Makes/drives the gpio value to low - * @param[in] uint8_t gpio_number, gpio pin number - * @param[out] none - * @return none - * @description This API is used to drives or makes the host gpio value low. - */ -void rsi_hal_clear_gpio(uint8_t gpio_number) -{ - // WFX_RSI_LOG ("RSI: CLR GPIO: 0x%x", gpio_number); - switch (gpio_number) - { - case RSI_HAL_RESET_PIN: - return GPIO_PinOutClear(WFX_RESET_PIN.port, WFX_RESET_PIN.pin); - default: - break; - } -} diff --git a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_rtc.c b/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_rtc.c deleted file mode 100644 index f57d47a4439bc5..00000000000000 --- a/examples/platform/silabs/SiWx917/rs911x/hal/rsi_hal_mcu_rtc.c +++ /dev/null @@ -1,326 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Includes - */ -#include "em_cmu.h" -#include "em_core.h" -#include "em_rtcc.h" -#include "sl_sleeptimer_config.h" -#include "sl_status.h" -#include -#include - -#define ZONE0 0 -#define CH_SELECTOR 1u -#define RTC_DEFAULT_COUNTER_VALUE 0u -#define RSI_RTC_FREQ_VALUE 0 -#define TIME_ZONE_OFFSET 0u - -#define SLEEPTIMER_EVENT_OF (0x01) -#define SLEEPTIMER_EVENT_COMP (0x02) -#define SLEEPTIMER_ENUM(name) \ - typedef uint8_t name; \ - enum name##_enum -#define TIME_UNIX_EPOCH (1970u) -#define TIME_NTP_EPOCH (1900u) -#define TIME_ZIGBEE_EPOCH (2000u) -#define TIME_NTP_UNIX_EPOCH_DIFF (TIME_UNIX_EPOCH - TIME_NTP_EPOCH) -#define TIME_ZIGBEE_UNIX_EPOCH_DIFF (TIME_ZIGBEE_EPOCH - TIME_UNIX_EPOCH) -#define TIME_DAY_COUNT_NTP_TO_UNIX_EPOCH (TIME_NTP_UNIX_EPOCH_DIFF * 365u + 17u) ///< 70 years and 17 leap days -#define TIME_DAY_COUNT_ZIGBEE_TO_UNIX_EPOCH (TIME_ZIGBEE_UNIX_EPOCH_DIFF * 365u + 7u) ///< 30 years and 7 leap days -#define TIME_SEC_PER_DAY (60u * 60u * 24u) -#define TIME_NTP_EPOCH_OFFSET_SEC (TIME_DAY_COUNT_NTP_TO_UNIX_EPOCH * TIME_SEC_PER_DAY) -#define TIME_ZIGBEE_EPOCH_OFFSET_SEC (TIME_DAY_COUNT_ZIGBEE_TO_UNIX_EPOCH * TIME_SEC_PER_DAY) -#define TIME_DAY_PER_YEAR (365u) -#define TIME_SEC_PER_YEAR (TIME_SEC_PER_DAY * TIME_DAY_PER_YEAR) -#define TIME_UNIX_TIMESTAMP_MAX (0x7FFFFFFF) - -/// Time zone offset from UTC(second). -typedef int32_t sl_sleeptimer_time_zone_offset_t; -/// Timestamp, wall clock time in seconds. -typedef uint32_t sl_sleeptimer_timestamp_t; -/// @brief Time Format. -SLEEPTIMER_ENUM(sl_sleeptimer_time_format_t){ - TIME_FORMAT_UNIX = 0, ///< Number of seconds since January 1, 1970, 00:00. - ///< Type is signed, so represented on 31 bit. - TIME_FORMAT_NTP = 1, ///< Number of seconds since January 1, 1900, 00:00. - ///< Type is unsigned, so represented on 32 bit. - TIME_FORMAT_ZIGBEE_CLUSTER = 2, ///< Number of seconds since January 1, 2000, 00:00. Type is - ///< unsigned, so represented on 32 bit. -}; - -// Initialization flag. -static bool is_sleeptimer_initialized = false; -// Timer frequency in Hz. -static uint32_t timer_frequency; -#if SL_SLEEPTIMER_WALLCLOCK_CONFIG -// Current time count. -static sl_sleeptimer_timestamp_t second_count; -// Tick rest when the frequency is not a divider of the timer width. -static uint32_t overflow_tick_rest = 0; -#endif - -/******************************************************************************* - * Checks if the time stamp, format and time zone are - * within the supported range. - * - * @param time Time stamp to check. - * @param format Format of the time. - * @param time_zone Time zone offset in second. - * - * @return true if the time is valid. False otherwise. - ******************************************************************************/ -static bool is_valid_time(sl_sleeptimer_timestamp_t time, sl_sleeptimer_time_format_t format, - sl_sleeptimer_time_zone_offset_t time_zone) -{ - bool valid_time = false; - - // Check for overflow. - if ((time_zone < ZONE0 && time > (uint32_t) abs(time_zone)) || (time_zone >= ZONE0 && (time <= UINT32_MAX - time_zone))) - { - valid_time = true; - } - if (format == TIME_FORMAT_UNIX) - { - if (time > TIME_UNIX_TIMESTAMP_MAX) - { // Check if Unix time stamp is an - // unsigned 31 bits. - valid_time = false; - } - } - else - { - if ((format == TIME_FORMAT_NTP) && (time >= TIME_NTP_EPOCH_OFFSET_SEC)) - { - valid_time &= true; - } - else if ((format == TIME_FORMAT_ZIGBEE_CLUSTER) && (time <= TIME_UNIX_TIMESTAMP_MAX - TIME_ZIGBEE_EPOCH_OFFSET_SEC)) - { - valid_time &= true; - } - else - { - valid_time = false; - } - } - return valid_time; -} - -/******************************************************************************* - * Gets RTCC timer frequency. - ******************************************************************************/ -uint32_t rsi_rtc_get_hal_timer_frequency(void) -{ - /* CMU_PrescToLog2 converts prescaler dividend to a logarithmic value. It only works for even - * numbers equal to 2^n. - * An unscaled dividend (dividend = argument + 1). - * So we need to send argument subtracted by 1 - */ - return (CMU_ClockFreqGet(cmuClock_RTCC) >> (CMU_PrescToLog2(SL_SLEEPTIMER_FREQ_DIVIDER - 1))); -} - -/****************************************************************************** - * Initializes RTCC sleep timer. - *****************************************************************************/ -void rsi_rtc_init_timer(void) -{ - RTCC_Init_TypeDef rtcc_init = RTCC_INIT_DEFAULT; - RTCC_CCChConf_TypeDef channel = RTCC_CH_INIT_COMPARE_DEFAULT; - - CMU_ClockEnable(cmuClock_RTCC, true); - - rtcc_init.enable = false; - - /* CMU_PrescToLog2 converts prescaler dividend to a logarithmic value. It only works for even - * numbers equal to 2^n. - * An unscaled dividend (dividend = argument + 1). - * So we need to send argument subtracted by 1 - */ - rtcc_init.presc = (RTCC_CntPresc_TypeDef)(CMU_PrescToLog2(SL_SLEEPTIMER_FREQ_DIVIDER - 1)); - - RTCC_Init(&rtcc_init); - - // Compare channel starts disabled and is enabled only when compare match - // interrupt is enabled. - channel.chMode = rtccCapComChModeOff; - RTCC_ChannelInit(CH_SELECTOR, &channel); - - RTCC_IntDisable(_RTCC_IEN_MASK); - RTCC_IntClear(_RTCC_IF_MASK); - RTCC_CounterSet(RTC_DEFAULT_COUNTER_VALUE); - - RTCC_Enable(true); - - NVIC_ClearPendingIRQ(RTCC_IRQn); - NVIC_EnableIRQ(RTCC_IRQn); -} - -/****************************************************************************** - * Enables RTCC interrupts. - *****************************************************************************/ -void rsi_rtc_enable_int(uint8_t local_flag) -{ - uint32_t rtcc_ien = 0u; - - if (local_flag & SLEEPTIMER_EVENT_OF) - { - rtcc_ien |= RTCC_IEN_OF; - } - - if (local_flag & SLEEPTIMER_EVENT_COMP) - { - rtcc_ien |= RTCC_IEN_CC1; - } - - RTCC_IntEnable(rtcc_ien); -} - -/******************************************************************************* - * Get timer frequency. - ******************************************************************************/ -uint32_t rsi_rtc_get_timer_frequency(void) -{ - return timer_frequency; -} - -/****************************************************************************** - * Gets RTCC counter value. - *****************************************************************************/ -uint32_t rsi_rtc_get_counter(void) -{ - return RTCC_CounterGet(); -} - -sl_status_t rsi_rtc_init(void) -{ - CORE_DECLARE_IRQ_STATE; - CORE_ENTER_ATOMIC(); - - if (!is_sleeptimer_initialized) - { - rsi_rtc_init_timer(); - rsi_rtc_enable_int(SLEEPTIMER_EVENT_OF); - timer_frequency = rsi_rtc_get_hal_timer_frequency(); - if (timer_frequency == RSI_RTC_FREQ_VALUE) - { - CORE_EXIT_ATOMIC(); - return SL_STATUS_INVALID_PARAMETER; - } - -#if SL_SLEEPTIMER_WALLCLOCK_CONFIG - second_count = 0; -#endif - - is_sleeptimer_initialized = true; - } - CORE_EXIT_ATOMIC(); - - return SL_STATUS_OK; -} - -#if SL_SLEEPTIMER_WALLCLOCK_CONFIG -/******************************************************************************* - * Retrieves current time. - ******************************************************************************/ -uint32_t rsi_rtc_get_time(void) -{ - uint32_t cnt = 0u; - uint32_t freq = 0u; - sl_sleeptimer_timestamp_t time; - CORE_DECLARE_IRQ_STATE; - - cnt = rsi_rtc_get_counter(); - freq = rsi_rtc_get_timer_frequency(); - - CORE_ENTER_ATOMIC(); - time = second_count + cnt / freq; - if (cnt % freq + overflow_tick_rest >= freq) - { - time++; - } - CORE_EXIT_ATOMIC(); - - return time; -} - -/******************************************************************************* - * Sets current time. - ******************************************************************************/ -sl_status_t rsi_rtc_settime(sl_sleeptimer_timestamp_t time) -{ - uint32_t freq = 0u; - uint32_t counter_sec = 0u; - uint32_t cnt = 0; - CORE_DECLARE_IRQ_STATE; - - if (!is_valid_time(time, TIME_FORMAT_UNIX, TIME_ZONE_OFFSET)) - { - return SL_STATUS_INVALID_CONFIGURATION; - } - - freq = rsi_rtc_get_timer_frequency(); - cnt = rsi_rtc_get_counter(); - - CORE_ENTER_ATOMIC(); - second_count = time; - overflow_tick_rest = 0; - counter_sec = cnt / freq; - - if (second_count >= counter_sec) - { - second_count -= counter_sec; - } - else - { - CORE_EXIT_ATOMIC(); - return SL_STATUS_INVALID_CONFIGURATION; - } - - CORE_EXIT_ATOMIC(); - - return SL_STATUS_OK; -} - -/******************************************************************************* - * @fn int32_t rsi_rtc_set_time(uint32_t time) - * @brief - * Init Sleeptimer and Set current time. - * @param[in] time: - * @return - * None - ******************************************************************************/ -int32_t rsi_rtc_set_time(uint32_t time) -{ - sl_status_t ret_val = SL_STATUS_OK; - ret_val = rsi_rtc_init(); - if (ret_val != SL_STATUS_OK) - { - return -1; - } - else - { - ret_val = rsi_rtc_settime(time); - if (ret_val != SL_STATUS_OK) - { - return -1; - } - } - return 0; -} -#endif // SL_SLEEPTIMER_WALLCLOCK_CONFIG diff --git a/examples/platform/silabs/SiWx917/efr32_utils.cpp b/examples/platform/silabs/SiWx917/siwx917_utils.cpp similarity index 91% rename from examples/platform/silabs/SiWx917/efr32_utils.cpp rename to examples/platform/silabs/SiWx917/siwx917_utils.cpp index bd2bf771c60152..49a23255cd93c5 100644 --- a/examples/platform/silabs/SiWx917/efr32_utils.cpp +++ b/examples/platform/silabs/SiWx917/siwx917_utils.cpp @@ -17,9 +17,8 @@ * limitations under the License. */ -#include "efr32_utils.h" -#include "init_efrPlatform.h" -#include "sl_system_kernel.h" +#include "siwx917_utils.h" +#include "init_ccpPlatform.h" #include diff --git a/examples/platform/silabs/SiWx917/efr32_utils.h b/examples/platform/silabs/SiWx917/siwx917_utils.h similarity index 98% rename from examples/platform/silabs/SiWx917/efr32_utils.h rename to examples/platform/silabs/SiWx917/siwx917_utils.h index b0d508de5f8fe8..2223275d841733 100644 --- a/examples/platform/silabs/SiWx917/efr32_utils.h +++ b/examples/platform/silabs/SiWx917/siwx917_utils.h @@ -19,7 +19,7 @@ #pragma once -// EFR Logging +// SiWx917 Logging #ifdef __cplusplus extern "C" { #endif diff --git a/examples/platform/silabs/SiWx917/uart.cpp b/examples/platform/silabs/SiWx917/uart.cpp index 76dbca22ce52d5..d264e9644e9f08 100644 --- a/examples/platform/silabs/SiWx917/uart.cpp +++ b/examples/platform/silabs/SiWx917/uart.cpp @@ -22,217 +22,21 @@ extern "C" { #endif #include "assert.h" -#include "em_core.h" -#include "em_usart.h" -#include "sl_board_control.h" -#include "sl_uartdrv_instances.h" -#if (defined(EFR32MG24) || defined(MGM24)) -#include "sl_uartdrv_eusart_vcom_config.h" -#else -#include "sl_uartdrv_usart_vcom_config.h" -#endif // EFR32MG24 +#include "rsi_board.h" #include "uart.h" #include "uartdrv.h" #include #include -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) -#include "sl_power_manager.h" -#endif - #if !defined(MIN) #define MIN(A, B) ((A) < (B) ? (A) : (B)) #endif -#if (defined(EFR32MG24) || defined(MGM24)) -#define HELPER1(x) EUSART##x##_RX_IRQn -#else -#define HELPER1(x) USART##x##_RX_IRQn -#endif - -#define HELPER2(x) HELPER1(x) - -#if (defined(EFR32MG24) || defined(MGM24)) -#define HELPER3(x) EUSART##x##_RX_IRQHandler -#else -#define HELPER3(x) USART##x##_RX_IRQHandler -#endif - -#define HELPER4(x) HELPER3(x) - -// On MG24 boards VCOM runs on the EUSART device, MG12 uses the UART device -#if (defined(EFR32MG24) || defined(MGM24)) -#define USART_IRQ HELPER2(SL_UARTDRV_EUSART_VCOM_PERIPHERAL_NO) -#define USART_IRQHandler HELPER4(SL_UARTDRV_EUSART_VCOM_PERIPHERAL_NO) -#define vcom_handle sl_uartdrv_eusart_vcom_handle -#else -#define USART_IRQ HELPER2(SL_UARTDRV_USART_VCOM_PERIPHERAL_NO) -#define USART_IRQHandler HELPER4(SL_UARTDRV_USART_VCOM_PERIPHERAL_NO) -#define vcom_handle sl_uartdrv_usart_vcom_handle -#endif // EFR32MG24 - -typedef struct -{ - // The data buffer - uint8_t * pBuffer; - // The offset of the first item written to the list. - volatile uint16_t Head; - // The offset of the next item to be written to the list. - volatile uint16_t Tail; - // Maxium size of data that can be hold in buffer before overwriting - uint16_t MaxSize; -} Fifo_t; - #define UART_CONSOLE_ERR -1 // Negative value in case of UART Console action failed. Triggers a failure for PW_RPC -#define MAX_BUFFER_SIZE 256 -#define MAX_DMA_BUFFER_SIZE (MAX_BUFFER_SIZE / 2) -// In order to reduce the probability of data loss during the dmaFull callback handler we use -// two duplicate receive buffers so we can always have one "active" receive queue. -static uint8_t sRxDmaBuffer[MAX_DMA_BUFFER_SIZE]; -static uint8_t sRxDmaBuffer2[MAX_DMA_BUFFER_SIZE]; -static uint16_t lastCount; // Nb of bytes already processed from the active dmaBuffer -// Rx buffer for the receive Fifo -static uint8_t sRxFifoBuffer[MAX_BUFFER_SIZE]; -static Fifo_t sReceiveFifo; - -static void UART_rx_callback(UARTDRV_Handle_t handle, Ecode_t transferStatus, uint8_t * data, UARTDRV_Count_t transferCount); - -static bool InitFifo(Fifo_t * fifo, uint8_t * pDataBuffer, uint16_t bufferSize) -{ - if (fifo == NULL || pDataBuffer == NULL) - { - return false; - } - - fifo->pBuffer = pDataBuffer; - fifo->MaxSize = bufferSize; - fifo->Tail = fifo->Head = 0; - - return true; -} - -/* - * @brief Get the amount of unprocessed bytes in the fifo buffer - * @param Ptr to the fifo - * @return Nb of "unread" bytes available in the fifo - */ -static uint16_t AvailableDataCount(Fifo_t * fifo) -{ - uint16_t size = 0; - - // if equal there is no data return 0 directly - if (fifo->Tail != fifo->Head) - { - // determine if a wrap around occurred to get the right data size available. - size = (fifo->Tail < fifo->Head) ? (fifo->MaxSize - fifo->Head + fifo->Tail) : (fifo->Tail - fifo->Head); - } - - return size; -} - -/* - * @brief Get the available space in the fifo buffer to insert new data - * @param Ptr to the fifo - * @return Nb of free bytes left in te buffer - */ -static uint16_t RemainingSpace(Fifo_t * fifo) -{ - return fifo->MaxSize - AvailableDataCount(fifo); -} - -/* - * @brief Write data in the fifo as a circular buffer - * @param Ptr to the fifo, ptr of the data to write, nb of bytes to write - */ -static void WriteToFifo(Fifo_t * fifo, uint8_t * pDataToWrite, uint16_t SizeToWrite) -{ - assert(fifo); - assert(pDataToWrite); - assert(SizeToWrite <= fifo->MaxSize); - - // Overwrite is not allowed - if (RemainingSpace(fifo) >= SizeToWrite) - { - uint16_t nBytesBeforWrap = (fifo->MaxSize - fifo->Tail); - if (SizeToWrite > nBytesBeforWrap) - { - // The number of bytes to write is bigger than the remaining bytes - // in the buffer, we have to wrap around - memcpy(fifo->pBuffer + fifo->Tail, pDataToWrite, nBytesBeforWrap); - memcpy(fifo->pBuffer, pDataToWrite + nBytesBeforWrap, SizeToWrite - nBytesBeforWrap); - } - else - { - memcpy(fifo->pBuffer + fifo->Tail, pDataToWrite, SizeToWrite); - } - - fifo->Tail = (fifo->Tail + SizeToWrite) % fifo->MaxSize; // increment tail with wraparound - } -} - -/* - * @brief Write data in the fifo as a circular buffer - * @param Ptr to the fifo, ptr to contain the data to process, nb of bytes to pull from the fifo - * @return Nb of bytes that were retrieved. - */ -static uint8_t RetrieveFromFifo(Fifo_t * fifo, uint8_t * pData, uint16_t SizeToRead) -{ - assert(fifo); - assert(pData); - assert(SizeToRead <= fifo->MaxSize); - - uint16_t ReadSize = MIN(SizeToRead, AvailableDataCount(fifo)); - uint16_t nBytesBeforWrap = (fifo->MaxSize - fifo->Head); - - if (ReadSize > nBytesBeforWrap) - { - memcpy(pData, fifo->pBuffer + fifo->Head, nBytesBeforWrap); - memcpy(pData + nBytesBeforWrap, fifo->pBuffer, ReadSize - nBytesBeforWrap); - } - else - { - memcpy(pData, (fifo->pBuffer + fifo->Head), ReadSize); - } - - fifo->Head = (fifo->Head + ReadSize) % fifo->MaxSize; // increment tail with wraparound - - return ReadSize; -} - -/* - * @brief Init the the UART for serial communication, Start DMA reception - * and init Fifo to handle the received data from this uart - * - * @Note This UART is used for pigweed rpc - */ void uartConsoleInit(void) { - sl_board_enable_vcom(); - // Init a fifo for the data received on the uart - InitFifo(&sReceiveFifo, sRxFifoBuffer, MAX_BUFFER_SIZE); - - // Activate 2 dma queues to always have one active - - UARTDRV_Receive(vcom_handle, sRxDmaBuffer, MAX_DMA_BUFFER_SIZE, UART_rx_callback); - UARTDRV_Receive(vcom_handle, sRxDmaBuffer2, MAX_DMA_BUFFER_SIZE, UART_rx_callback); - - // Enable USART0/EUSART0 interrupt to wake OT task when data arrives - NVIC_ClearPendingIRQ(USART_IRQ); - NVIC_EnableIRQ(USART_IRQ); - -#if (defined(EFR32MG24) || defined(MGM24)) - // Clear previous RX interrupts - EUSART_IntClear(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, EUSART_IF_RXFL); - - // Enable RX interrupts - EUSART_IntEnable(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, EUSART_IF_RXFL); - - // Enable EUSART - EUSART_Enable(SL_UARTDRV_EUSART_VCOM_PERIPHERAL, eusartEnable); -#else - USART_IntEnable(SL_UARTDRV_USART_VCOM_PERIPHERAL, USART_IF_RXDATAV); -#endif // EFR32MG24 + // UART init is already done } void USART_IRQHandler(void) @@ -289,25 +93,12 @@ int16_t uartConsoleWrite(const char * Buf, uint16_t BufLength) return UART_CONSOLE_ERR; } -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); -#endif + // Add Terminating char at the end of buffer + Buf[BufLength] = '\0'; - // Use of ForceTransmit here. Transmit with DMA was causing errors with PW_RPC - // TODO Use DMA and find/fix what causes the issue with PW - if (UARTDRV_ForceTransmit(vcom_handle, (uint8_t *) Buf, BufLength) == ECODE_EMDRV_UARTDRV_OK) - { -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); -#endif - return BufLength; - } - -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); -#endif + Board_UARTPutSTR((uint8_t *) Buf); - return UART_CONSOLE_ERR; + return BufLength; } /* @@ -317,25 +108,20 @@ int16_t uartConsoleWrite(const char * Buf, uint16_t BufLength) */ int16_t uartConsoleRead(char * Buf, uint16_t NbBytesToRead) { - uint8_t * data; - UARTDRV_Count_t count, remaining; + uint32_t data; if (Buf == NULL || NbBytesToRead < 1) { return UART_CONSOLE_ERR; } - if (NbBytesToRead > AvailableDataCount(&sReceiveFifo)) + while (--NbBytesToRead >= 0) { - // Not enough data available in the fifo for the read size request - // If there is data available in dma buffer, get it now. - CORE_ATOMIC_SECTION(UARTDRV_GetReceiveStatus(vcom_handle, &data, &count, &remaining); if (count > lastCount) { - WriteToFifo(&sReceiveFifo, data + lastCount, count - lastCount); - lastCount = count; - }) + data = Board_UARTGetChar(); + *Buf++ = (char) data; } - return (int16_t) RetrieveFromFifo(&sReceiveFifo, (uint8_t *) Buf, NbBytesToRead); + return NbBytesToRead; } #ifdef __cplusplus diff --git a/examples/platform/silabs/SiWx917/uart.h b/examples/platform/silabs/SiWx917/uart.h index f708030223b2f7..035d5b3b0ede7d 100644 --- a/examples/platform/silabs/SiWx917/uart.h +++ b/examples/platform/silabs/SiWx917/uart.h @@ -28,13 +28,6 @@ void uartConsoleInit(void); int16_t uartConsoleWrite(const char * Buf, uint16_t BufLength); int16_t uartConsoleRead(char * Buf, uint16_t NbBytesToRead); -// Implemented by in openthread code -#ifndef PW_RPC_ENABLED -extern void otPlatUartReceived(const uint8_t * aBuf, uint16_t aBufLength); -extern void otPlatUartSendDone(void); -extern void otSysEventSignalPending(void); -#endif - #ifdef __cplusplus } // extern "C" #endif diff --git a/examples/platform/silabs/SiWx917/wf200/efr_spi.c b/examples/platform/silabs/SiWx917/wf200/efr_spi.c deleted file mode 100644 index fb35093797679d..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/efr_spi.c +++ /dev/null @@ -1,426 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "sl_wfx_configuration_defaults.h" - -#include "sl_wfx.h" -#include "sl_wfx_board.h" -#include "sl_wfx_host_api.h" - -#include "dmadrv.h" -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" -#include "spidrv.h" - -#include -#include -#include - -#include "FreeRTOS.h" -#include "semphr.h" -#ifdef SLEEP_ENABLED -#include "sl_power_manager.h" -#endif -#include "AppConfig.h" - -#include "gpiointerrupt.h" - -#include "sl_spidrv_exp_config.h" -#include "sl_wfx_board.h" -#include "sl_wfx_host.h" -#include "sl_wfx_task.h" -#include "wfx_host_events.h" - -extern SPIDRV_Handle_t sl_spidrv_exp_handle; - -#define USART SL_WFX_HOST_PINOUT_SPI_PERIPHERAL - -StaticSemaphore_t xEfrSpiSemaBuffer; -static SemaphoreHandle_t spi_sem; - -static unsigned int tx_dma_channel; -static unsigned int rx_dma_channel; - -static uint32_t dummy_rx_data; -static uint32_t dummy_tx_data; -static bool spi_enabled = false; - -#if defined(EFR32MG12) -uint8_t wirq_irq_nb = SL_WFX_HOST_PINOUT_SPI_IRQ; -#elif defined(EFR32MG24) -uint8_t wirq_irq_nb = SL_WFX_HOST_PINOUT_SPI_WIRQ_PIN; // SL_WFX_HOST_PINOUT_SPI_WIRQ_PIN; -#endif - -#define PIN_OUT_SET 1 -#define PIN_OUT_CLEAR 0 - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_init_bus(void) - * @brief - * Initialize SPI peripheral - * @param[in] None - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_init_bus(void) -{ - spi_enabled = true; - - /* Assign allocated DMA channel */ - tx_dma_channel = sl_spidrv_exp_handle->txDMACh; - rx_dma_channel = sl_spidrv_exp_handle->rxDMACh; - - /* - * Route EUSART1 MOSI, MISO, and SCLK to the specified pins. CS is - * not controlled by EUSART so there is no write to the corresponding - * EUSARTROUTE register to do this. - */ - MY_USART->CTRL |= (1u << _USART_CTRL_SMSDELAY_SHIFT); - -#if defined(EFR32MG12) - MY_USART->ROUTEPEN = USART_ROUTEPEN_TXPEN | USART_ROUTEPEN_RXPEN | USART_ROUTEPEN_CLKPEN; -#endif - -#if defined(EFR32MG24) - GPIO->USARTROUTE[0].ROUTEEN = GPIO_USART_ROUTEEN_RXPEN | // MISO - GPIO_USART_ROUTEEN_TXPEN | // MOSI - GPIO_USART_ROUTEEN_CLKPEN; -#endif - - spi_sem = xSemaphoreCreateBinaryStatic(&xEfrSpiSemaBuffer); - xSemaphoreGive(spi_sem); - - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_deinit_bus(void) - * @brief - * De-initialize SPI peripheral and DMAs - * @param[in] None - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_deinit_bus(void) -{ - vSemaphoreDelete(spi_sem); - // Stop DMAs. - DMADRV_StopTransfer(rx_dma_channel); - DMADRV_StopTransfer(tx_dma_channel); - DMADRV_FreeChannel(tx_dma_channel); - DMADRV_FreeChannel(rx_dma_channel); - DMADRV_DeInit(); - USART_Reset(MY_USART); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_spi_cs_assert() - * @brief - * Assert chip select. - * @param[in] None - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_spi_cs_assert() -{ - GPIO_PinOutClear(SL_SPIDRV_EXP_CS_PORT, SL_SPIDRV_EXP_CS_PIN); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_spi_cs_deassert() - * @brief - * De-Assert chip select. - * @param[in] None - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_spi_cs_deassert() -{ - GPIO_PinOutSet(SL_SPIDRV_EXP_CS_PORT, SL_SPIDRV_EXP_CS_PIN); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void *userParam) - * @brief - * function called when the DMA complete - * @param[in] channel: - * @param[in] sequenceNo: sequence number - * @param[in] userParam: user parameter - * @return returns true if suucessful, - * false otherwise - *****************************************************************************/ -static bool rx_dma_complete(unsigned int channel, unsigned int sequenceNo, void * userParam) -{ - (void) channel; - (void) sequenceNo; - (void) userParam; - - BaseType_t xHigherPriorityTaskWoken = pdFALSE; - xSemaphoreGiveFromISR(spi_sem, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - - return true; -} - -/**************************************************************************** - * @fn void receiveDMA(uint8_t *buffer, uint16_t buffer_length) - * @brief - * start receive DMA - * @param[in] buffer: - * @param[in] buffer_length: - * @return None - *****************************************************************************/ -void receiveDMA(uint8_t * buffer, uint16_t buffer_length) -{ - // Start receive DMA. - DMADRV_PeripheralMemory(rx_dma_channel, MY_USART_RX_SIGNAL, (void *) buffer, (void *) &(MY_USART->RXDATA), true, buffer_length, - dmadrvDataSize1, rx_dma_complete, NULL); - - // Start transmit DMA. - DMADRV_MemoryPeripheral(tx_dma_channel, MY_USART_TX_SIGNAL, (void *) &(MY_USART->TXDATA), (void *) &(dummy_tx_data), false, - buffer_length, dmadrvDataSize1, NULL, NULL); -} - -/**************************************************************************** - * @fn void transmitDMA(uint8_t *buffer, uint16_t buffer_length) - * @brief - * start transmit DMA - * @param[in] buffer: - * @param[in] buffer_length: - * @return None - *****************************************************************************/ -void transmitDMA(uint8_t * buffer, uint16_t buffer_length) -{ - // Receive DMA runs only to initiate callback - // Start receive DMA. - DMADRV_PeripheralMemory(rx_dma_channel, MY_USART_RX_SIGNAL, &dummy_rx_data, (void *) &(MY_USART->RXDATA), false, buffer_length, - dmadrvDataSize1, rx_dma_complete, NULL); - // Start transmit DMA. - DMADRV_MemoryPeripheral(tx_dma_channel, MY_USART_TX_SIGNAL, (void *) &(MY_USART->TXDATA), (void *) buffer, true, buffer_length, - dmadrvDataSize1, NULL, NULL); -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_spi_transfer_no_cs_assert(sl_wfx_host_bus_transfer_type_t type, - uint8_t *header, - uint16_t header_length, - uint8_t *buffer, - uint16_t buffer_length) - * @brief - * WFX SPI transfer implementation - * @param[in] type: - * @param[in] header: - * @param[in] header_length: - * @param[in] buffer: - * @param[in] buffer_length: - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_spi_transfer_no_cs_assert(sl_wfx_host_bus_transfer_type_t type, uint8_t * header, uint16_t header_length, - uint8_t * buffer, uint16_t buffer_length) -{ - sl_status_t result = SL_STATUS_FAIL; - const bool is_read = (type == SL_WFX_BUS_READ); - - while (!(MY_USART->STATUS & USART_STATUS_TXBL)) - { - } - MY_USART->CMD = USART_CMD_CLEARRX | USART_CMD_CLEARTX; - - /* header length should be greater than 0 */ - if (header_length > 0) - { - for (uint8_t * buffer_ptr = header; header_length > 0; --header_length, ++buffer_ptr) - { - MY_USART->TXDATA = (uint32_t)(*buffer_ptr); - - while (!(MY_USART->STATUS & USART_STATUS_TXC)) - { - } - } - while (!(MY_USART->STATUS & USART_STATUS_TXBL)) - { - } - } - - /* buffer length should be greater than 0 */ - if (buffer_length > 0) - { - MY_USART->CMD = USART_CMD_CLEARRX | USART_CMD_CLEARTX; - if (xSemaphoreTake(spi_sem, portMAX_DELAY) == pdTRUE) - { - if (is_read) - { - receiveDMA(buffer, buffer_length); - result = SL_STATUS_OK; - } - else - { - transmitDMA(buffer, buffer_length); - result = SL_STATUS_OK; - } - - if (xSemaphoreTake(spi_sem, portMAX_DELAY) == pdTRUE) - { - xSemaphoreGive(spi_sem); - } - } - else - { - result = SL_STATUS_TIMEOUT; - } - } - - return result; -} - -/**************************************************************************** - * @fn void sl_wfx_host_start_platform_interrupt(void) - * @brief - * Enable WFX interrupt - * @param[in] none - * @return None - *****************************************************************************/ -void sl_wfx_host_start_platform_interrupt(void) -{ - // Enable (and clear) the bus interrupt - GPIO_ExtIntConfig(SL_WFX_HOST_PINOUT_SPI_WIRQ_PORT, SL_WFX_HOST_PINOUT_SPI_WIRQ_PIN, wirq_irq_nb, true, false, true); -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_disable_platform_interrupt(void) - * @brief - * Disable WFX interrupt - * @param[in] None - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_disable_platform_interrupt(void) -{ - GPIO_IntDisable(1 << wirq_irq_nb); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_enable_platform_interrupt(void) - * @brief - * enable the platform interrupt - * @param[in] None - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_enable_platform_interrupt(void) -{ - GPIO_IntEnable(1 << wirq_irq_nb); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_enable_spi(void) - * @brief - * enable spi - * @param[in] None - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_enable_spi(void) -{ - if (spi_enabled == false) - { -#ifdef SLEEP_ENABLED - // Prevent the host to use lower EM than EM1 - sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); -#endif - spi_enabled = true; - } - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_disable_spi(void) - * @brief - * disable spi - * @param[in] None - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_disable_spi(void) -{ - if (spi_enabled == true) - { - spi_enabled = false; -#ifdef SLEEP_ENABLED - // Allow the host to use the lowest allowed EM - sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); -#endif - } - return SL_STATUS_OK; -} - -/* - * IRQ for SPI callback - * Clear the Interrupt and wake up the task that - * handles the actions of the interrupt (typically - wfx_bus_task ()) - */ -static void sl_wfx_spi_wakeup_irq_callback(uint8_t irqNumber) -{ - BaseType_t bus_task_woken; - uint32_t interrupt_mask; - - if (irqNumber != wirq_irq_nb) - return; - // Get and clear all pending GPIO interrupts - interrupt_mask = GPIO_IntGet(); - GPIO_IntClear(interrupt_mask); - bus_task_woken = pdFALSE; - xSemaphoreGiveFromISR(wfx_wakeup_sem, &bus_task_woken); - vTaskNotifyGiveFromISR(wfx_bus_task_handle, &bus_task_woken); - portYIELD_FROM_ISR(bus_task_woken); -} - -/**************************************************************************** - * Init some actions pins to the WF-200 expansion board - *****************************************************************************/ -void sl_wfx_host_gpio_init(void) -{ - SILABS_LOG("WIFI: GPIO Init:IRQ=%d", wirq_irq_nb); - // Enable GPIO clock. - CMU_ClockEnable(cmuClock_GPIO, true); - - // Configure WF200 reset pin. - GPIO_PinModeSet(SL_WFX_HOST_PINOUT_RESET_PORT, SL_WFX_HOST_PINOUT_RESET_PIN, gpioModePushPull, 0); - // Configure WF200 WUP pin. - GPIO_PinModeSet(SL_WFX_HOST_PINOUT_WUP_PORT, SL_WFX_HOST_PINOUT_WUP_PIN, gpioModePushPull, 0); - - // GPIO used as IRQ. - GPIO_PinModeSet(SL_WFX_HOST_PINOUT_SPI_WIRQ_PORT, SL_WFX_HOST_PINOUT_SPI_WIRQ_PIN, gpioModeInputPull, 0); - CMU_OscillatorEnable(cmuOsc_LFXO, true, true); - - // Set up interrupt based callback function - trigger on both edges. - GPIOINT_Init(); - GPIO_ExtIntConfig(SL_WFX_HOST_PINOUT_SPI_WIRQ_PORT, SL_WFX_HOST_PINOUT_SPI_WIRQ_PIN, wirq_irq_nb, true, false, - false); /* Don't enable it */ - - GPIOINT_CallbackRegister(wirq_irq_nb, sl_wfx_spi_wakeup_irq_callback); - - // Change GPIO interrupt priority (FreeRTOS asserts unless this is done here!) - NVIC_ClearPendingIRQ(1 << wirq_irq_nb); - NVIC_SetPriority(GPIO_EVEN_IRQn, 5); - NVIC_SetPriority(GPIO_ODD_IRQn, 5); -} diff --git a/examples/platform/silabs/SiWx917/wf200/host_if.cpp b/examples/platform/silabs/SiWx917/wf200/host_if.cpp deleted file mode 100644 index 26bd7886654700..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/host_if.cpp +++ /dev/null @@ -1,1270 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Includes */ - -#include -#include -#include - -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" -#include "gpiointerrupt.h" - -#include "wifi_config.h" - -#include "AppConfig.h" -#include "sl_wfx_board.h" -#include "sl_wfx_host.h" -#include "sl_wfx_task.h" -#include "wfx_host_events.h" - -#include "FreeRTOS.h" -#include "event_groups.h" -#include "task.h" - -#include "dhcp_client.h" -#include "ethernetif.h" -#include - -using namespace ::chip; -using namespace ::chip::DeviceLayer; - -/* wfxRsi Task will use as its stack */ -StackType_t wfxEventTaskStack[1024] = { 0 }; - -/* Structure that will hold the TCB of the wfxRsi Task being created. */ -StaticTask_t wfxEventTaskBuffer; - -/* Declare a variable to hold the data associated with the created event group. */ -StaticEventGroup_t wfxEventGroup; - -EventGroupHandle_t sl_wfx_event_group; -TaskHandle_t wfx_events_task_handle; -static sl_wfx_mac_address_t ap_mac; -static uint32_t sta_ip; -static wfx_wifi_scan_result_t ap_info; - -// Set Scan Parameters -#define ACTIVE_CHANNEL_TIME 110 -#define PASSIVE_CHANNEL_TIME 0 -#define NUM_PROBE_REQUEST 2 - -// wfx_fmac_driver context -sl_wfx_context_t wifiContext; -static uint8_t wifi_extra; - -/***************************************************************************** - * macros - ******************************************************************************/ -#define WE_ST_STARTED 1 -#define WE_ST_STA_CONN 2 -#define WE_ST_HW_STARTED 4 - -#ifdef SL_WFX_CONFIG_SOFTAP -// Connection parameters -char softap_ssid[32] = SOFTAP_SSID_DEFAULT; -char softap_passkey[64] = SOFTAP_PASSKEY_DEFAULT; -sl_wfx_security_mode_t softap_security = SOFTAP_SECURITY_DEFAULT; -uint8_t softap_channel = SOFTAP_CHANNEL_DEFAULT; -#endif - -/* station network interface structures */ -struct netif * sta_netif; -wfx_wifi_provision_t wifi_provision; -sl_wfx_get_counters_cnf_t * counters; -sl_wfx_get_counters_cnf_t * Tempcounters; -#define PUT_COUNTER(name) SILABS_LOG("%-24s %lu\r\n", #name, (unsigned long) counters->body.count_##name); - -bool hasNotifiedIPV6 = false; -bool hasNotifiedIPV4 = false; -bool hasNotifiedWifiConnectivity = false; -static uint8_t retryJoin = 0; -bool retryInProgress = false; - -#ifdef SL_WFX_CONFIG_SCAN -static struct scan_result_holder -{ - struct scan_result_holder * next; - wfx_wifi_scan_result scan; -} * scan_save; -static uint8_t scan_count = 0; -static void (*scan_cb)(wfx_wifi_scan_result_t *); /* user-callback - when scan is done */ -static char * scan_ssid; /* Which one are we scanning for */ -static void sl_wfx_scan_result_callback(sl_wfx_scan_result_ind_body_t * scan_result); -static void sl_wfx_scan_complete_callback(uint32_t status); -#endif /* SL_WFX_CONFIG_SCAN */ - -static void wfx_events_task(void * p_arg); - -/* WF200 host callbacks */ -static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication_body); -static void sl_wfx_disconnect_callback(uint8_t * mac, uint16_t reason); -static void sl_wfx_generic_status_callback(sl_wfx_generic_ind_t * frame); - -#ifdef SL_WFX_CONFIG_SOFTAP -static void sl_wfx_start_ap_callback(uint32_t status); -static void sl_wfx_stop_ap_callback(void); -static void sl_wfx_client_connected_callback(uint8_t * mac); -static void sl_wfx_ap_client_disconnected_callback(uint32_t status, uint8_t * mac); -static void sl_wfx_ap_client_rejected_callback(uint32_t status, uint8_t * mac); -#endif - -extern uint32_t gOverrunCount; - -/*************************************************************************** - * @brief - * Creates WFX events processing task. - ******************************************************************************/ -static void wfx_events_task_start() -{ - /* create an event group to track Wi-Fi events */ - sl_wfx_event_group = xEventGroupCreateStatic(&wfxEventGroup); - - wfx_events_task_handle = xTaskCreateStatic(wfx_events_task, "wfx_events", WLAN_TASK_STACK_SIZE, NULL, WLAN_TASK_PRIORITY, - wfxEventTaskStack, &wfxEventTaskBuffer); - if (NULL == wfx_events_task_handle) - { - SILABS_LOG("Failed to create WFX wfx_events"); - } -} - -/**************************************************************************** - * @brief - * Called when the driver needs to post an event - * @param[in] event_payload: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload) -{ - switch (event_payload->header.id) - { - /******** INDICATION ********/ - case SL_WFX_STARTUP_IND_ID: { - SILABS_LOG("WFX Startup Completed\r\n"); - PlatformMgrImpl().HandleWFXSystemEvent(WIFI_EVENT, event_payload); - break; - } - case SL_WFX_CONNECT_IND_ID: { - sl_wfx_connect_ind_t * connect_indication = (sl_wfx_connect_ind_t *) event_payload; - sl_wfx_connect_callback(connect_indication->body); - break; - } - case SL_WFX_DISCONNECT_IND_ID: { - sl_wfx_disconnect_ind_t * disconnect_indication = (sl_wfx_disconnect_ind_t *) event_payload; - sl_wfx_disconnect_callback(disconnect_indication->body.mac, disconnect_indication->body.reason); - break; - } - case SL_WFX_RECEIVED_IND_ID: { - sl_wfx_received_ind_t * ethernet_frame = (sl_wfx_received_ind_t *) event_payload; - if (ethernet_frame->body.frame_type == ETH_FRAME) - { - sl_wfx_host_received_frame_callback(ethernet_frame); - } - break; - } -#ifdef SL_WFX_CONFIG_SCAN - case SL_WFX_SCAN_RESULT_IND_ID: { - sl_wfx_scan_result_ind_t * scan_result = (sl_wfx_scan_result_ind_t *) event_payload; - sl_wfx_scan_result_callback(&scan_result->body); - break; - } - case SL_WFX_SCAN_COMPLETE_IND_ID: { - sl_wfx_scan_complete_ind_t * scan_complete = (sl_wfx_scan_complete_ind_t *) event_payload; - sl_wfx_scan_complete_callback(scan_complete->body.status); - break; - } -#endif /* SL_WFX_CONFIG_SCAN */ -#ifdef SL_WFX_CONFIG_SOFTAP - case SL_WFX_START_AP_IND_ID: { - sl_wfx_start_ap_ind_t * start_ap_indication = (sl_wfx_start_ap_ind_t *) event_payload; - sl_wfx_start_ap_callback(start_ap_indication->body.status); - break; - } - case SL_WFX_STOP_AP_IND_ID: { - sl_wfx_stop_ap_callback(); - break; - } - case SL_WFX_AP_CLIENT_CONNECTED_IND_ID: { - sl_wfx_ap_client_connected_ind_t * client_connected_indication = (sl_wfx_ap_client_connected_ind_t *) event_payload; - sl_wfx_client_connected_callback(client_connected_indication->body.mac); - break; - } - case SL_WFX_AP_CLIENT_REJECTED_IND_ID: { - sl_wfx_ap_client_rejected_ind_t * ap_client_rejected_indication = (sl_wfx_ap_client_rejected_ind_t *) event_payload; - sl_wfx_ap_client_rejected_callback(ap_client_rejected_indication->body.reason, ap_client_rejected_indication->body.mac); - break; - } - case SL_WFX_AP_CLIENT_DISCONNECTED_IND_ID: { - sl_wfx_ap_client_disconnected_ind_t * ap_client_disconnected_indication = - (sl_wfx_ap_client_disconnected_ind_t *) event_payload; - sl_wfx_ap_client_disconnected_callback(ap_client_disconnected_indication->body.reason, - ap_client_disconnected_indication->body.mac); - break; - } -#endif /* SL_WFX_CONFIG_SOFTAP */ -#ifdef SL_WFX_USE_SECURE_LINK - case SL_WFX_SECURELINK_EXCHANGE_PUB_KEYS_IND_ID: { - if (host_context.waited_event_id != SL_WFX_SECURELINK_EXCHANGE_PUB_KEYS_IND_ID) - { - memcpy((void *) &sl_wfx_context->secure_link_exchange_ind, (void *) event_payload, event_payload->header.length); - } - break; - } -#endif - case SL_WFX_GENERIC_IND_ID: { - sl_wfx_generic_ind_t * generic_status = (sl_wfx_generic_ind_t *) event_payload; - sl_wfx_generic_status_callback(generic_status); - break; - } - case SL_WFX_EXCEPTION_IND_ID: { - sl_wfx_exception_ind_t * firmware_exception = (sl_wfx_exception_ind_t *) event_payload; - uint8_t * exception_tmp = (uint8_t *) firmware_exception; - SILABS_LOG("firmware exception\r\n"); - for (uint16_t i = 0; i < firmware_exception->header.length; i += 16) - { - SILABS_LOG("hif: %.8x:", i); - for (uint8_t j = 0; (j < 16) && ((i + j) < firmware_exception->header.length); j++) - { - SILABS_LOG(" %.2x", *exception_tmp); - exception_tmp++; - } - SILABS_LOG("\r\n"); - } - break; - } - case SL_WFX_ERROR_IND_ID: { - sl_wfx_error_ind_t * firmware_error = (sl_wfx_error_ind_t *) event_payload; - uint8_t * error_tmp = (uint8_t *) firmware_error; - SILABS_LOG("firmware error %lu\r\n", firmware_error->body.type); - for (uint16_t i = 0; i < firmware_error->header.length; i += 16) - { - SILABS_LOG("hif: %.8x:", i); - for (uint8_t j = 0; (j < 16) && ((i + j) < firmware_error->header.length); j++) - { - SILABS_LOG(" %.2x", *error_tmp); - error_tmp++; - } - SILABS_LOG("\r\n"); - } - break; - } - } - - return SL_STATUS_OK; -} - -#ifdef SL_WFX_CONFIG_SCAN -/**************************************************************************** - * @brief - * Callback for individual scan result - * @param[in] scan_result: Scan result of all SSID's - *****************************************************************************/ -static void sl_wfx_scan_result_callback(sl_wfx_scan_result_ind_body_t * scan_result) -{ - struct scan_result_holder * ap; - - SILABS_LOG("# %2d %2d %03d %02X:%02X:%02X:%02X:%02X:%02X %s", scan_count, scan_result->channel, - ((int16_t)(scan_result->rcpi - 220) / 2), scan_result->mac[0], scan_result->mac[1], scan_result->mac[2], - scan_result->mac[3], scan_result->mac[4], scan_result->mac[5], scan_result->ssid_def.ssid); - /*Report one AP information*/ - SILABS_LOG("\r\n"); - /* don't save if filter only wants specific ssid */ - if (scan_ssid != (char *) 0) - { - if (strcmp(scan_ssid, (char *) &scan_result->ssid_def.ssid[0]) != CMP_SUCCESS) - return; - } - if ((ap = (struct scan_result_holder *) pvPortMalloc(sizeof(*ap))) == (struct scan_result_holder *) 0) - { - SILABS_LOG("*ERR*Scan: No Mem"); - } - else - { - ap->next = scan_save; - scan_save = ap; - /* Not checking if scan_result->ssid_length is < 33 */ - memcpy(ap->scan.ssid, scan_result->ssid_def.ssid, scan_result->ssid_def.ssid_length); - ap->scan.ssid[scan_result->ssid_def.ssid_length] = 0; /* make sure about null terminate */ - /* We do it in this order WPA3 first */ - /* No EAP supported - Is this required */ - if (scan_result->security_mode.wpa3) - { - ap->scan.security = WFX_SEC_WPA3; - } - else if (scan_result->security_mode.wpa2) - { - ap->scan.security = WFX_SEC_WPA2; - } - else if (scan_result->security_mode.wpa) - { - ap->scan.security = WFX_SEC_WPA; - } - else if (scan_result->security_mode.wep) - { - ap->scan.security = WFX_SEC_WEP; - } - else - { - ap->scan.security = WFX_SEC_NONE; - } - ap->scan.chan = scan_result->channel; - ap->scan.rssi = scan_result->rcpi; - memcpy(&ap->scan.bssid[0], &scan_result->mac[0], BSSID_MAX_STR_LEN); - scan_count++; - } -} - -/**************************************************************************** - * @brief - * Callback for scan complete - * @param[in] status:Status of WLAN scan api - *****************************************************************************/ -/* ARGSUSED */ -static void sl_wfx_scan_complete_callback(uint32_t status) -{ - (void) (status); - /* Use scan_count value and reset it */ - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_SCAN_COMPLETE); -} -#endif /* SL_WFX_CONFIG_SCAN */ - -/**************************************************************************** - * @brief - * Callback when station connects - * @param[in] mac: MAC address of device - * @param[in] status: Status of connect call - *****************************************************************************/ -static void sl_wfx_connect_callback(sl_wfx_connect_ind_body_t connect_indication_body) -{ - uint8_t * mac = connect_indication_body.mac; - uint32_t status = connect_indication_body.status; - switch (status) - { - case WFM_STATUS_SUCCESS: { - SILABS_LOG("STA-Connected\r\n"); - memcpy(&ap_mac.octet[0], mac, MAC_ADDRESS_FIRST_OCTET); - sl_wfx_context->state = - static_cast(static_cast(sl_wfx_context->state) | static_cast(SL_WFX_STA_INTERFACE_CONNECTED)); - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_CONNECT); - break; - } - case WFM_STATUS_NO_MATCHING_AP: { - SILABS_LOG("WFX Connection failed, access point not found\r\n"); - break; - } - case WFM_STATUS_CONNECTION_ABORTED: { - SILABS_LOG("WFX Connection aborted\r\n"); - break; - } - case WFM_STATUS_CONNECTION_TIMEOUT: { - SILABS_LOG("WFX Connection timeout\r\n"); - break; - } - case WFM_STATUS_CONNECTION_REJECTED_BY_AP: { - SILABS_LOG("WFX Connection rejected by the access point\r\n"); - break; - } - case WFM_STATUS_CONNECTION_AUTH_FAILURE: { - SILABS_LOG("WFX Connection authentication failure\r\n"); - break; - } - default: { - SILABS_LOG("WF Connection attempt error\r\n"); - } - } - - if ((status != WFM_STATUS_SUCCESS) && retryJoin < MAX_JOIN_RETRIES_COUNT) - { - retryJoin += 1; - retryInProgress = false; - SILABS_LOG("WFX Retry to connect to network count: %d", retryJoin); - sl_wfx_context->state = - static_cast(static_cast(sl_wfx_context->state) & ~static_cast(SL_WFX_STARTED)); - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_RETRY_CONNECT); - } -} - -/**************************************************************************** - * @brief - * Callback for station disconnect - * @param[in] mac: MAC address of device - * @param[in] reason: Reason code of disconnection - *****************************************************************************/ -static void sl_wfx_disconnect_callback(uint8_t * mac, uint16_t reason) -{ - (void) (mac); - SILABS_LOG("WFX Disconnected %d\r\n", reason); - sl_wfx_context->state = - static_cast(static_cast(sl_wfx_context->state) & ~static_cast(SL_WFX_STA_INTERFACE_CONNECTED)); - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_DISCONNECT); -} - -#ifdef SL_WFX_CONFIG_SOFTAP -/**************************************************************************** - * @brief - * Callback for AP started - * @param[in] status: Status of wfx start ap api - *****************************************************************************/ -static void sl_wfx_start_ap_callback(uint32_t status) -{ - if (status == AP_START_SUCCESS) - { - SILABS_LOG("AP started\r\n"); - sl_wfx_context->state = - static_cast(static_cast(sl_wfx_context->state) | static_cast(SL_WFX_AP_INTERFACE_UP)); - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_START_AP); - } - else - { - SILABS_LOG("AP start failed\r\n"); - strcpy(event_log, "AP start failed"); - } -} - -/**************************************************************************** - * @brief - * Callback for AP stopped - *****************************************************************************/ -static void sl_wfx_stop_ap_callback(void) -{ - // TODO - // dhcpserver_clear_stored_mac(); - SILABS_LOG("SoftAP stopped\r\n"); - sl_wfx_context->state = - static_cast(static_cast(sl_wfx_context->state) & ~static_cast(SL_WFX_AP_INTERFACE_UP)); - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_STOP_AP); -} - -/**************************************************************************** - * @brief - * Callback for client connect to AP - * @param[in] mac: MAC address of device - *****************************************************************************/ -static void sl_wfx_client_connected_callback(uint8_t * mac) -{ - SILABS_LOG("Client connected, MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - // TODO - SILABS_LOG("Open a web browser and go to http://%d.%d.%d.%d\r\n", ap_ip_addr0, ap_ip_addr1, ap_ip_addr2, ap_ip_addr3); -} - -/**************************************************************************** - * @brief - * Callback for client rejected from AP - * @param[in] status: Status of ap rejected - * @param[in] mac: MAC address of device - *****************************************************************************/ -static void sl_wfx_ap_client_rejected_callback(uint32_t status, uint8_t * mac) -{ - SILABS_LOG("Client rejected, reason: %d, MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", (int) status, mac[0], mac[1], mac[2], mac[3], - mac[4], mac[5]); -} - -/**************************************************************************** - * @brief - * Callback for AP client disconnect - * @param[in] status: Status of ap dissconnect - * @param[in] mac: - *****************************************************************************/ -static void sl_wfx_ap_client_disconnected_callback(uint32_t status, uint8_t * mac) -{ - // TODO - SILABS_LOG("Client disconnected, reason: %d, MAC: %02X:%02X:%02X:%02X:%02X:%02X\r\n", (int) status, mac[0], mac[1], mac[2], - mac[3], mac[4], mac[5]); -} -#endif /* SL_WFX_CONFIG_SOFTAP */ - -/**************************************************************************** - * @brief - * Callback for generic status received - * @param[in] farme: - *****************************************************************************/ -static void sl_wfx_generic_status_callback(sl_wfx_generic_ind_t * frame) -{ - (void) (frame); - SILABS_LOG("WFX Generic status received\r\n"); -} - -/*************************************************************************** - * @brief - * WFX events processing task. - * @param[in] p_arg: - * ******************************************************************************/ -static void wfx_events_task(void * p_arg) -{ - TickType_t last_dhcp_poll, now; - EventBits_t flags; - (void) p_arg; - - sta_netif = wfx_get_netif(SL_WFX_STA_INTERFACE); - last_dhcp_poll = xTaskGetTickCount(); - while (true) - { - flags = xEventGroupWaitBits(sl_wfx_event_group, - SL_WFX_CONNECT | SL_WFX_DISCONNECT -#ifdef SL_WFX_CONFIG_SOFTAP - | SL_WFX_START_AP | SL_WFX_STOP_AP -#endif /* SL_WFX_CONFIG_SOFTAP */ -#ifdef SL_WFX_CONFIG_SCAN - | SL_WFX_SCAN_START | SL_WFX_SCAN_COMPLETE -#endif /* SL_WFX_CONFIG_SCAN */ - | BITS_TO_WAIT, - pdTRUE, pdFALSE, pdMS_TO_TICKS(250)); /* 250 msec delay converted to ticks */ - if (flags & SL_WFX_RETRY_CONNECT) - { - if (!retryInProgress) - { - SILABS_LOG("WFX sending the connect command"); - wfx_connect_to_ap(); - retryInProgress = true; - } - } - - if (wifi_extra & WE_ST_STA_CONN) - { - if ((now = xTaskGetTickCount()) > (last_dhcp_poll + pdMS_TO_TICKS(250))) - { -#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4) - uint8_t dhcp_state = dhcpclient_poll(&sta_netif); - - if ((dhcp_state == DHCP_ADDRESS_ASSIGNED) && !hasNotifiedIPV4) - { - wfx_dhcp_got_ipv4((uint32_t) sta_netif->ip_addr.u_addr.ip4.addr); - hasNotifiedIPV4 = true; - if (!hasNotifiedWifiConnectivity) - { - SILABS_LOG("WIFI: Has Notified Wifi Connectivity"); - wfx_connected_notify(CONNECTION_STATUS_SUCCESS, &ap_mac); - hasNotifiedWifiConnectivity = true; - } - } - else if (dhcp_state == DHCP_OFF) - { - wfx_ip_changed_notify(IP_STATUS_FAIL); - hasNotifiedIPV4 = false; - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_IPV4 - if ((ip6_addr_ispreferred(netif_ip6_addr_state(sta_netif, 0))) && !hasNotifiedIPV6) - { - wfx_ipv6_notify(1); - hasNotifiedIPV6 = true; - if (!hasNotifiedWifiConnectivity) - { - wfx_connected_notify(CONNECTION_STATUS_SUCCESS, &ap_mac); - hasNotifiedWifiConnectivity = true; - } - } - last_dhcp_poll = now; - } - } - - if (flags & SL_WFX_CONNECT) - { -#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4) - wfx_ip_changed_notify(IP_STATUS_FAIL); - hasNotifiedIPV4 = false; -#endif // CHIP_DEVICE_CONFIG_ENABLE_IPV4 - wfx_ipv6_notify(GET_IPV6_FAIL); - hasNotifiedIPV6 = false; - hasNotifiedWifiConnectivity = false; - SILABS_LOG("WIFI: Connected to AP"); - wifi_extra |= WE_ST_STA_CONN; - wfx_lwip_set_sta_link_up(); -#ifdef SLEEP_ENABLED - if (!(wfx_get_wifi_state() & SL_WFX_AP_INTERFACE_UP)) - { - // Enable the power save - sl_wfx_set_power_mode(WFM_PM_MODE_PS, WFM_PM_POLL_UAPSD, BEACON_1); - sl_wfx_enable_device_power_save(); - } -#endif // SLEEP_ENABLED - } - - if (flags & SL_WFX_DISCONNECT) - { - -#if (CHIP_DEVICE_CONFIG_ENABLE_IPV4) - wfx_ip_changed_notify(IP_STATUS_FAIL); - hasNotifiedIPV4 = false; -#endif // CHIP_DEVICE_CONFIG_ENABLE_IPV4 - wfx_ipv6_notify(GET_IPV6_FAIL); - hasNotifiedIPV6 = false; - hasNotifiedWifiConnectivity = false; - wifi_extra &= ~WE_ST_STA_CONN; - wfx_lwip_set_sta_link_down(); - } - -#ifdef SL_WFX_CONFIG_SCAN - if (flags & SL_WFX_SCAN_START) - { - /* - * Start the Scan - */ - sl_wfx_ssid_def_t ssid, *sp; - uint16_t num_ssid, slen; - if (scan_ssid) - { - memset(&ssid, 0, sizeof(ssid)); - slen = strlen(scan_ssid); - memcpy(&ssid.ssid[0], scan_ssid, slen); - ssid.ssid_length = slen; - num_ssid = 1; - sp = &ssid; - } - else - { - num_ssid = 0; - sp = (sl_wfx_ssid_def_t *) 0; - } - - SILABS_LOG("WIFI Scan Parameter set to Active channel time %d, Passive " - "Channel Time: %d, Number of prob: %d", - ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); - (void) sl_wfx_set_scan_parameters(ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); - (void) sl_wfx_send_scan_command(WFM_SCAN_MODE_ACTIVE, CHANNEL_LIST, /* Channel list */ - CHANNEL_COUNT, /* Scan all chans */ - sp, num_ssid, IE_DATA, /* IE we're looking for */ - IE_DATA_LENGTH, BSSID_SCAN); - } - if (flags & SL_WFX_SCAN_COMPLETE) - { - struct scan_result_holder *hp, *next; - - SILABS_LOG("WIFI: Return %d scan results", scan_count); - for (hp = scan_save; hp; hp = next) - { - next = hp->next; - (*scan_cb)(&hp->scan); - vPortFree(hp); - } - (*scan_cb)((wfx_wifi_scan_result *) 0); - scan_save = (struct scan_result_holder *) 0; - scan_count = 0; - if (scan_ssid) - { - vPortFree(scan_ssid); - scan_ssid = (char *) 0; - } - /* Terminate scan */ - scan_cb = 0; - } -#endif /* SL_WFX_CONFIG_SCAN */ - } -} - -/**************************************************************************** - * @brief - * Initialize the WF200 used by the two interfaces - *****************************************************************************/ -static sl_status_t wfx_init(void) -{ - /* Initialize the WF200 used by the two interfaces */ - wfx_events_task_start(); - sl_status_t status = sl_wfx_init(&wifiContext); - SILABS_LOG("FMAC Driver version %s", FMAC_DRIVER_VERSION_STRING); - switch (status) - { - case SL_STATUS_OK: - SILABS_LOG("WF200 FW ver:%d.%d.%d [MAC %02x:%02x:%02x-%02x:%02x:%02x]", wifiContext.firmware_major, - wifiContext.firmware_minor, wifiContext.firmware_build, wifiContext.mac_addr_0.octet[0], - wifiContext.mac_addr_0.octet[1], wifiContext.mac_addr_0.octet[2], wifiContext.mac_addr_0.octet[3], - wifiContext.mac_addr_0.octet[4], wifiContext.mac_addr_0.octet[5]); - SILABS_LOG("WF200 Init OK"); - - if (wifiContext.state == SL_WFX_STA_INTERFACE_CONNECTED) - { - sl_wfx_send_disconnect_command(); - } - - break; - case SL_STATUS_WIFI_INVALID_KEY: - SILABS_LOG("*ERR*WF200: F/W keyset invalid"); - break; - case SL_STATUS_WIFI_FIRMWARE_DOWNLOAD_TIMEOUT: - SILABS_LOG("*ERR*WF200: F/W download timo"); - break; - case SL_STATUS_TIMEOUT: - SILABS_LOG("*ERR*WF200: Poll for value timo"); - break; - case SL_STATUS_FAIL: - SILABS_LOG("*ERR*WF200: Error"); - break; - default: - SILABS_LOG("*ERR*WF200: Unknown"); - } - - return status; -} - -/***************************************************************************** - * @brief - * tcp ip, wfx and lwip stack and start dhcp client. - * @return - * sl_status_t Shows init succes or error. - ******************************************************************************/ -static void wfx_wifi_hw_start(void) -{ - sl_status_t status; - - if (wifi_extra & WE_ST_HW_STARTED) - return; - SILABS_LOG("STARTING WF200\n"); - wifi_extra |= WE_ST_HW_STARTED; - - sl_wfx_host_gpio_init(); - if ((status = wfx_init()) == SL_STATUS_OK) - { - /* Initialize the LwIP stack */ - SILABS_LOG("WF200:Start LWIP"); - wfx_lwip_start(); - wifiContext.state = SL_WFX_STARTED; /* Really this is a bit mask */ - SILABS_LOG("WF200:ready.."); - } - else - { - SILABS_LOG("*ERR*WF200:init failed"); - } -} - -/*********************************************************************** - * @brief - * Get AP info - * @param[in] ap: access point information - * @return returns -1 - **************************************************************************/ -int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap) -{ - int32_t signal_strength; - SILABS_LOG("WIFI:SSID:: %s", &ap_info.ssid[0]); - memcpy(ap->ssid, ap_info.ssid, sizeof(ap_info.ssid)); - SILABS_LOG("WIFI:Mac addr:: %02x:%02x:%02x:%02x:%02x:%02x", ap_info.bssid[0], ap_info.bssid[1], ap_info.bssid[2], - ap_info.bssid[3], ap_info.bssid[4], ap_info.bssid[5]); - memcpy(ap->bssid, ap_info.bssid, sizeof(ap_info.bssid)); - ap->security = ap_info.security; - SILABS_LOG("WIFI:security:: %d", ap->security); - ap->chan = ap_info.chan; - SILABS_LOG("WIFI:Channel:: to %d", ap->chan); - - sl_status_t status = sl_wfx_get_signal_strength((uint32_t *) &signal_strength); - - if (status == SL_STATUS_OK) - { - SILABS_LOG("status SL_STATUS_OK & signal_strength:: %d", signal_strength); - ap->rssi = (signal_strength - 220) / 2; - } - return status; -} - -/************************************************************************ - * @brief - * Get AP extra info - * @param[in] extra_info: access point extra information - * @return returns -1 - **************************************************************************/ -int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info) -{ - int32_t status; - status = get_all_counters(); - if (status != SL_STATUS_OK) - { - SILABS_LOG("Failed to get the couters"); - } - else - { - extra_info->beacon_lost_count = counters->body.count_miss_beacon; - extra_info->beacon_rx_count = counters->body.count_rx_beacon; - extra_info->mcast_rx_count = counters->body.count_rx_multicast_frames; - extra_info->mcast_tx_count = counters->body.count_tx_multicast_frames; - extra_info->ucast_rx_count = counters->body.count_rx_packets; - extra_info->ucast_tx_count = counters->body.count_tx_packets; - extra_info->overrun_count = gOverrunCount; - } - return status; -} - -sl_status_t get_all_counters(void) -{ - sl_status_t result; - uint8_t command_id = 0x05; - uint16_t mib_id = 0x2035; - sl_wfx_mib_req_t * request = NULL; - uint32_t request_length = SL_WFX_ROUND_UP_EVEN(sizeof(sl_wfx_header_mib_t) + sizeof(sl_wfx_mib_req_body_t)); - - result = - sl_wfx_allocate_command_buffer((sl_wfx_generic_message_t **) &request, command_id, SL_WFX_CONTROL_BUFFER, request_length); - - if (request == NULL) - { - } - - request->body.mib_id = mib_id; - request->header.interface = 0x2; - request->header.encrypted = 0x0; - - result = sl_wfx_send_request(command_id, (sl_wfx_generic_message_t *) request, request_length); - SL_WFX_ERROR_CHECK(result); - - result = sl_wfx_host_wait_for_confirmation(command_id, SL_WFX_DEFAULT_REQUEST_TIMEOUT_MS, (void **) &counters); - SL_WFX_ERROR_CHECK(result); - - SILABS_LOG("%-24s %12s \r\n", "", "Debug Counters Content"); - SILABS_LOG("%-24s %lu\r\n", "rcpi", (unsigned long) counters->body.rcpi); - PUT_COUNTER(plcp_errors); - PUT_COUNTER(fcs_errors); - PUT_COUNTER(tx_packets); - PUT_COUNTER(rx_packets); - PUT_COUNTER(rx_packet_errors); - PUT_COUNTER(rx_decryption_failures); - PUT_COUNTER(rx_mic_failures); - PUT_COUNTER(rx_no_key_failures); - PUT_COUNTER(tx_multicast_frames); - PUT_COUNTER(tx_frames_success); - PUT_COUNTER(tx_frame_failures); - PUT_COUNTER(tx_frames_retried); - PUT_COUNTER(tx_frames_multi_retried); - PUT_COUNTER(rx_frame_duplicates); - PUT_COUNTER(rts_success); - PUT_COUNTER(rts_failures); - PUT_COUNTER(ack_failures); - PUT_COUNTER(rx_multicast_frames); - PUT_COUNTER(rx_frames_success); - PUT_COUNTER(rx_cmacicv_errors); - PUT_COUNTER(rx_cmac_replays); - PUT_COUNTER(rx_mgmt_ccmp_replays); - PUT_COUNTER(rx_bipmic_errors); - PUT_COUNTER(rx_beacon); - PUT_COUNTER(miss_beacon); - -error_handler: - - if (result == SL_STATUS_TIMEOUT) - { - if (sl_wfx_context->used_buffers > 0) - { - sl_wfx_context->used_buffers--; - } - } - if (request != NULL) - { - sl_wfx_free_command_buffer((sl_wfx_generic_message_t *) request, command_id, SL_WFX_CONTROL_BUFFER); - } - - return result; -} - -/************************************************************************ - * @brief - * reset the count - * @return returns -1 - **************************************************************************/ -int32_t wfx_reset_counts() -{ - /* TODO */ - return -1; -} - -/************************************************************************* - * @brief - * I think that this is getting called before FreeRTOS threads are ready - * @return returns SL_STATUS_OK - **************************************************************************/ -sl_status_t wfx_wifi_start(void) -{ - if (wifi_extra & WE_ST_STARTED) - { - SILABS_LOG("WIFI: Already started"); - return SL_STATUS_OK; - } - wifi_extra |= WE_ST_STARTED; - wfx_soft_init(); - wfx_wifi_hw_start(); - - return SL_STATUS_OK; -} - -/**************************************************************************** - * @brief - * get the wifi state - * @return returns wificonetext state - *****************************************************************************/ -sl_wfx_state_t wfx_get_wifi_state(void) -{ - return wifiContext.state; -} - -/**************************************************************************** - * @brief - * getnetif using interface - * @param[in] interface: - * @return returns selectedNetif - *****************************************************************************/ -struct netif * wfx_GetNetif(sl_wfx_interface_t interface) -{ - struct netif * SelectedNetif = NULL; - if (interface == SL_WFX_STA_INTERFACE) - { - SelectedNetif = sta_netif; - } -#ifdef SL_WFX_CONFIG_SOFTAP - else if (interface == SL_WFX_SOFTAP_INTERFACE) - { - // no ap currently - } -#endif - return SelectedNetif; -} - -/**************************************************************************** - * @brief - * get the wifi mac address using interface - * @param[in] interface: - * @return returns wificontext.mac_addr_o if successful, - * wificontext.mac_addr_1 otherwise - *****************************************************************************/ -sl_wfx_mac_address_t wfx_get_wifi_mac_addr(sl_wfx_interface_t interface) -{ - // return Mac address used by WFX SL_WFX_STA_INTERFACE or SL_WFX_SOFTAP_INTERFACE, - return (interface == SL_WFX_STA_INTERFACE) ? wifiContext.mac_addr_0 : wifiContext.mac_addr_1; -} - -/**************************************************************************** - * @brief - * set the wifi provision - * @param[in] wifiConfig: configuration of wifi - *****************************************************************************/ -void wfx_set_wifi_provision(wfx_wifi_provision_t * wifiConfig) -{ - memcpy(wifi_provision.ssid, wifiConfig->ssid, sizeof(wifiConfig->ssid)); - memcpy(wifi_provision.passkey, wifiConfig->passkey, sizeof(wifiConfig->passkey)); - SILABS_LOG("WIFI: Provision SSID=%s", &wifi_provision.ssid[0]); - - /* Not very good - To be improved */ - switch (wifiConfig->security) - { - case WFX_SEC_WPA: - wifi_provision.security = static_cast(sl_wfx_security_mode_e::WFM_SECURITY_MODE_WPA2_WPA1_PSK); - break; - case WFX_SEC_WPA3: - wifi_provision.security = WFM_SECURITY_MODE_WPA3_SAE; - break; - case WFX_SEC_WPA2: - wifi_provision.security = static_cast(sl_wfx_security_mode_e::WFM_SECURITY_MODE_WPA2_WPA1_PSK); - break; - case WFX_SEC_WPA_WPA2_MIXED: - wifi_provision.security = static_cast(sl_wfx_security_mode_e::WFM_SECURITY_MODE_WPA2_WPA1_PSK); - break; - default: - wifi_provision.security = WFM_SECURITY_MODE_WPA2_PSK; - break; - } -} - -/**************************************************************************** - * @brief - * get the wifi provision - * @param[in] wifiConfig: configuration of wifi - * @return returns true if successful, - * false otherwise - *****************************************************************************/ -bool wfx_get_wifi_provision(wfx_wifi_provision_t * wifiConfig) -{ - if (wifiConfig == NULL) - { - return false; - } - memcpy(wifiConfig, &wifi_provision, sizeof(wfx_wifi_provision_t)); - - return true; -} - -/**************************************************************************** - * @brief - * clear the wifi provision - * @return returns true if successful, - * false otherwise - *****************************************************************************/ -void wfx_clear_wifi_provision(void) -{ - memset(&wifi_provision, 0, sizeof(wifi_provision)); -} - -/**************************************************************************** - * @brief - * driver STA provisioned - * @return returns true if successful, - * false otherwise - *****************************************************************************/ -bool wfx_is_sta_provisioned(void) -{ - return (wifi_provision.ssid[0]) ? true : false; -} - -/**************************************************************************** - * @fn sl_status_t wfx_connect_to_ap(void) - * @brief - * driver connect to ap - * @return returns SL_STATUS_NOT_AVAILABLE - *****************************************************************************/ -sl_status_t wfx_connect_to_ap(void) -{ - sl_status_t result; - - if (wifi_provision.ssid[0] == 0) - { - return SL_STATUS_NOT_AVAILABLE; - } - SILABS_LOG("WIFI:JOIN to %s", &wifi_provision.ssid[0]); - - SILABS_LOG("WIFI Scan Parameter set to Active channel time %d, Passive Channel " - "Time: %d, Number of prob: %d", - ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); - (void) sl_wfx_set_scan_parameters(ACTIVE_CHANNEL_TIME, PASSIVE_CHANNEL_TIME, NUM_PROBE_REQUEST); - result = - sl_wfx_send_join_command((uint8_t *) wifi_provision.ssid, strlen(wifi_provision.ssid), NULL, CHANNEL_0, - static_cast(wifi_provision.security), PREVENT_ROAMING, DISABLE_PMF_MODE, - (uint8_t *) wifi_provision.passkey, strlen(wifi_provision.passkey), NULL, IE_DATA_LENGTH); - - return result; -} - -/**************************************************************************** - * @brief - * get the wifi mac addresss - * @param[in] interface: - * @param[in] addr : address - *****************************************************************************/ -void wfx_get_wifi_mac_addr(sl_wfx_interface_t interface, sl_wfx_mac_address_t * addr) -{ - sl_wfx_mac_address_t * mac; - -#ifdef SL_WFX_CONFIG_SOFTAP - mac = (interface == SL_WFX_SOFTAP_INTERFACE) ? &wifiContext.mac_addr_1 : &wifiContext.mac_addr_0; -#else - mac = &wifiContext.mac_addr_0; -#endif - *addr = *mac; - SILABS_LOG("WLAN:Get WiFi Mac addr %02x:%02x:%02x:%02x:%02x:%02x", mac->octet[0], mac->octet[1], mac->octet[2], mac->octet[3], - mac->octet[4], mac->octet[5]); - memcpy(&ap_info.bssid[0], &mac->octet[0], 6); -} - -/**************************************************************************** - * @brief - * function called when driver have ipv4 address - * @param[in] which_if: - * @return returns false if successful, - * true otherwise - *****************************************************************************/ -bool wfx_have_ipv4_addr(sl_wfx_interface_t which_if) -{ - if (which_if == SL_WFX_STA_INTERFACE) - { - return (sta_ip == STA_IP_FAIL) ? false : true; - } - else - { - return false; /* TODO */ - } -} - -/**************************************************************************** - * @brief - * function called when driver have ipv6 address - * @param[in] which_if: - * @return returns false if successful, - * true otherwise - *****************************************************************************/ -bool wfx_have_ipv6_addr(sl_wfx_interface_t which_if) -{ - SILABS_LOG("%s: started.", __func__); - bool status = false; - if (which_if == SL_WFX_STA_INTERFACE) - { - status = wfx_is_sta_connected(); - } - else - { - status = false; /* TODO */ - } - SILABS_LOG("%s: status: %d", __func__, status); - return status; -} - -/**************************************************************************** - * @brief - * Disconnect station mode from connected AP - * @returns Returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t wfx_sta_discon(void) -{ - SILABS_LOG("STA-Disconnecting"); - int32_t status = sl_wfx_send_disconnect_command(); - wifi_extra &= ~WE_ST_STA_CONN; - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_RETRY_CONNECT); - return status; -} - -/**************************************************************************** - * @brief - * enable the STA mode - * @return returns true - *****************************************************************************/ -bool wfx_is_sta_mode_enabled(void) -{ - return true; /* It always is */ -} - -/**************************************************************************** - * @brief - * fuction called when driver is STA connected - * @return returns true if successful, - * false otherwise - *****************************************************************************/ -bool wfx_is_sta_connected(void) -{ - bool val; - - val = (wifi_extra & WE_ST_STA_CONN) ? true : false; - - SILABS_LOG("WLAN: STA %s connected", (val ? "IS" : "NOT")); - - return val; -} - -/**************************************************************************** - * @brief - * It is automatically done when lwip link up - * @return returns true if successful, - * false otherwise - *****************************************************************************/ -void wfx_setup_ip6_link_local(sl_wfx_interface_t whichif) -{ - SILABS_LOG("Setup-IP6: TODO"); /* It is automatically done when lwip link up */ -} - -/**************************************************************************** - * @brief - * get the wifi mode - * @return returns WIFI_MODE_NULL if successful, - * WIFI_MODE_STA otherwise - *****************************************************************************/ -wifi_mode_t wfx_get_wifi_mode() -{ - if (wifiContext.state & SL_WFX_STARTED) - return WIFI_MODE_STA; - return WIFI_MODE_NULL; -} - -/***************************************************************************** - * @brief - * This is called from the context of AppTask - * For WF200 - Start WIFI here - * @return returns true if successful, - * false otherwise - ******************************************************************************/ -bool wfx_hw_ready(void) -{ - return (wifiContext.state & SL_WFX_STARTED) ? true : false; -} - -#if CHIP_DEVICE_CONFIG_ENABLE_IPV4 -/***************************************************************************** - * @brief - * function called when dhcp got ipv4 - * @param[in] ip : internet protocol - ******************************************************************************/ -void wfx_dhcp_got_ipv4(uint32_t ip) -{ - /* Acquire the new IP address - */ - sta_ip = ip; - wfx_ip_changed_notify(IP_STATUS_SUCCESS); -} -#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */ - -/***************************************************************************** - * @brief - * function called from connectivityManager - ******************************************************************************/ -void wfx_enable_sta_mode(void) -{ - /* Nothing to do - default is that it is - place holder */ -} - -/**************************************************************************** - * @brief - * driver scan start - * @param[in] callback: Callback from the wifi scan results - * @return returns true if successful, - * false otherwise - *****************************************************************************/ -#ifdef SL_WFX_CONFIG_SCAN -bool wfx_start_scan(char * ssid, void (*callback)(wfx_wifi_scan_result_t *)) -{ - int sz; - - if (scan_cb) - return false; /* Already in progress */ - if (ssid) - { - sz = strlen(ssid); - if ((scan_ssid = (char *) pvPortMalloc(sz + 1)) == (char *) 0) - { - return false; - } - strcpy(scan_ssid, ssid); - } - scan_cb = callback; - xEventGroupSetBits(sl_wfx_event_group, SL_WFX_SCAN_START); - - return true; -} - -/**************************************************************************** - * @brief - * driver scan cancelation - *****************************************************************************/ -void wfx_cancel_scan(void) -{ - struct scan_result_holder *hp, *next; - /* Not possible */ - if (!scan_cb) - { - return; - } - sl_wfx_send_stop_scan_command(); - for (hp = scan_save; hp; hp = next) - { - next = hp->next; - vPortFree(hp); - } - scan_save = (struct scan_result_holder *) 0; - scan_count = 0; - if (scan_ssid) - { - vPortFree(scan_ssid); - scan_ssid = (char *) 0; - } - scan_cb = 0; -} -#endif /* SL_WFX_CONFIG_SCAN */ diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_board.h b/examples/platform/silabs/SiWx917/wf200/sl_wfx_board.h deleted file mode 100644 index 96ab9681745fdc..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_board.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _SL_WFX_BOARD_H_ -#define _SL_WFX_BOARD_H_ -/* - * Pull in the right board PINS - */ -#if defined(EFR32MG12_BRD4161A) || defined(BRD4161A) || defined(EFR32MG12_BRD4162A) || defined(BRD4162A) || \ - defined(EFR32MG12_BRD4163A) || defined(BRD4163A) || defined(EFR32MG12_BRD4164A) || defined(BRD4164A) || \ - defined(EFR32MG12_BRD4170A) || defined(BRD4170A) -#include "brd4161a.h" -#elif defined(EFR32MG24_BRD4186C) || defined(BRD4186C) || defined(EFR32MG24_BRD4186A) || defined(BRD4186A) -#include "brd4186c.h" -#elif defined(EFR32MG24_BRD4187C) || defined(BRD4187C) || defined(EFR32MG24_BRD4187A) || defined(BRD4187A) -#include "brd4187c.h" -#else -#error "Need SPI Pins" -#endif /* EFR32MG12_BRD4161A */ -#endif /* _SL_WFX_BOARD_H_ */ diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_configuration.h b/examples/platform/silabs/SiWx917/wf200/sl_wfx_configuration.h deleted file mode 100644 index deb468d1a6af73..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_configuration.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// SL_WFX_DEFAULT_REQUEST_TIMEOUT_MS> Timeout period in milliseconds<250-10000> -// Default: 5000 -// Timeout period in milliseconds for requests. -#define SL_WFX_DEFAULT_REQUEST_TIMEOUT_MS (5000) - -// WFx Secure Link configuration - -// SL_WFX_SLK_CURVE25519> Use crypto curves -// Default: 1 -// If this option is enabled ECDH crypto is used, KDF otherwise. -#define SL_WFX_SLK_CURVE25519 (1) diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_crypto.c b/examples/platform/silabs/SiWx917/wf200/sl_wfx_crypto.c deleted file mode 100644 index ddad3ec5b95dde..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_crypto.c +++ /dev/null @@ -1,409 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef SL_WFX_USE_SECURE_LINK - -/* Includes */ - -#include "sl_wfx.h" -#include - -#include "mbedtls/ccm.h" -#include "mbedtls/ctr_drbg.h" -#include "mbedtls/ecdh.h" -#include "mbedtls/entropy.h" -#include "mbedtls/md.h" -#include "mbedtls/sha256.h" - -#include "FreeRTOS.h" -#include "queue.h" -#include "semphr.h" -#include "task.h" - -// Secure link MAC key location for WGM160P (in DI page in flash) -#ifdef EFM32GG11B820F2048GM64 // WGM160PX22KGA2 -#define SL_WFX_FCCC_BASE_ADDR ((void *) 0x0fe08000ul) -#define SL_WFX_FCCC_DI_OFFSET 0x1B0ul -#define SL_WFX_FCCC_DI_ADDR ((void *) (SL_WFX_FCCC_BASE_ADDR + SL_WFX_FCCC_DI_OFFSET)) -#define SL_WFX_SECURE_LINK_MAC_KEY_LOCATION ((void *) (SL_WFX_FCCC_BASE_ADDR + 0x3D0)) -#endif -/****************************************************** - * Macros - ******************************************************/ -#define MAC_KEY_FAIL_BYTE 0XFF -#define KEY_DIGEST_SIZE 92 -#define MEMCMP_FAIL 0 -#define MPI_SET 1 -#define SUCCESS_STATUS_WIFI_SECURE_LINK_EXCHANGE 0 -#define SHA224_0 0 -#define HMAC_SIZE 92 -#define MEMSET_LEN 1 -#define LABLE_LEN 24 -#define ADDRESS_LENGTH 0 -#define CCM_STATUS_SUCCESS 0 -/****************************************************** - * Constants - ******************************************************/ - -/* Semaphore to signal wfx driver available */ -extern TaskHandle_t wfx_securelink_task; -extern SemaphoreHandle_t wfx_securelink_rx_mutex; - -/****************************************************** - * Enumerations - ******************************************************/ - -/****************************************************** - * Type Definitions - ******************************************************/ - -/****************************************************** - * Structures - ******************************************************/ - -/****************************************************** - * Function Declarations - ******************************************************/ - -static inline void reverse_bytes(uint8_t * src, uint8_t length); - -/****************************************************** - * Variable Definitions - ******************************************************/ - -#if SL_WFX_SLK_CURVE25519 -static mbedtls_ecdh_context mbedtls_host_context; -static mbedtls_ctr_drbg_context host_drbg_context; -#endif -static mbedtls_entropy_context entropy; -uint8_t temp_key_location[SL_WFX_HOST_PUB_KEY_MAC_SIZE]; -#ifdef EFM32GG11B820F2048GM64 // WGM160PX22KGA2 -static const uint8_t * const secure_link_mac_key = (uint8_t *) SL_WFX_SECURE_LINK_MAC_KEY_LOCATION; -#else -static const uint8_t secure_link_mac_key[SL_WFX_SECURE_LINK_MAC_KEY_LENGTH] = { 0x2B, 0x49, 0xFD, 0x66, 0xCB, 0x74, 0x6D, 0x6B, - 0x4F, 0xDC, 0xC3, 0x79, 0x4E, 0xC5, 0x9A, 0x86, - 0xE5, 0x48, 0x2A, 0x41, 0x22, 0x87, 0x8B, 0x12, - 0x1A, 0x7C, 0x3E, 0xEF, 0xB7, 0x04, 0x9E, 0xB3 }; -#endif -/****************************************************** - * Function Definitions - ******************************************************/ -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_get_secure_link_mac_key(uint8_t *sl_mac_key) - * @brief - * Get secure link mac key - * @param[in] sl_mac_key: - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_get_secure_link_mac_key(uint8_t * sl_mac_key) -{ - sl_status_t result = SL_STATUS_WIFI_SECURE_LINK_MAC_KEY_ERROR; - - memcpy(sl_mac_key, secure_link_mac_key, SL_WFX_SECURE_LINK_MAC_KEY_LENGTH); - - for (uint8_t index = 0; index < SL_WFX_SECURE_LINK_MAC_KEY_LENGTH; ++index) - { - // Assuming 0xFF... when not written - if (sl_mac_key[index] != MAC_KEY_FAIL_BYTE) - { - result = SL_STATUS_OK; - break; - } - } - - return result; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_compute_pub_key(sl_wfx_securelink_exchange_pub_keys_req_body_t *request, - const uint8_t *sl_mac_key) - * @brief - * compute host public key - * @param[in] request : - * @param[in] sl_mac_key : - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_compute_pub_key(sl_wfx_securelink_exchange_pub_keys_req_body_t * request, const uint8_t * sl_mac_key) -{ - sl_status_t status = SL_STATUS_OK; - -#if SL_WFX_SLK_CURVE25519 - const char identifier[] = "ecdh"; - - mbedtls_ecdh_init(&mbedtls_host_context); - mbedtls_ctr_drbg_init(&host_drbg_context); - mbedtls_entropy_init(&entropy); - status = mbedtls_ctr_drbg_seed(&host_drbg_context, mbedtls_entropy_func, &entropy, (const unsigned char *) identifier, - sizeof(identifier)); - status += mbedtls_ecp_group_load(&mbedtls_host_context.grp, MBEDTLS_ECP_DP_CURVE25519); - status += mbedtls_ecdh_gen_public(&mbedtls_host_context.grp, &mbedtls_host_context.d, &mbedtls_host_context.Q, - mbedtls_ctr_drbg_random, &host_drbg_context); - status += mbedtls_mpi_write_binary(&mbedtls_host_context.Q.X, request->host_pub_key, SL_WFX_HOST_PUB_KEY_SIZE); -#else - mbedtls_entropy_init(&entropy); - status = mbedtls_entropy_func(&entropy, request->host_pub_key, SL_WFX_HOST_PUB_KEY_SIZE); -#endif - reverse_bytes(request->host_pub_key, SL_WFX_HOST_PUB_KEY_SIZE); - SL_WFX_ERROR_CHECK(status); - - // Generate SHA512 digest of public key - status = mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA512), sl_mac_key, SL_WFX_HOST_PUB_KEY_SIZE, - request->host_pub_key, SL_WFX_HOST_PUB_KEY_SIZE, request->host_pub_key_mac); - SL_WFX_ERROR_CHECK(status); - -error_handler: - if (status != SL_STATUS_OK) - { - return SL_STATUS_WIFI_SECURE_LINK_EXCHANGE_FAILED; - } - return status; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_verify_pub_key(sl_wfx_securelink_exchange_pub_keys_ind_t *response_packet, - const uint8_t *sl_mac_key, - uint8_t *sl_host_pub_key) - * @brief - * verify host public key - * @param[in] response_packet: - * @param[in] sl_mac_key: - * @param[in] sl_host_pub_key: - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_verify_pub_key(sl_wfx_securelink_exchange_pub_keys_ind_t * response_packet, const uint8_t * sl_mac_key, - uint8_t * sl_host_pub_key) -{ - sl_status_t status = SL_STATUS_OK; - uint8_t shared_key_digest[KEY_DIGEST_SIZE]; - - if (xSemaphoreTake(wfx_securelink_rx_mutex, portMAX_DELAY) != pdTRUE) - { - return SL_STATUS_WIFI_SECURE_LINK_EXCHANGE_FAILED; - } - - // Compute the Hash and verify the public key/hashing - status = mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA512), sl_mac_key, SL_WFX_NCP_PUB_KEY_SIZE, - response_packet->body.ncp_pub_key, SL_WFX_NCP_PUB_KEY_SIZE, temp_key_location); - SL_WFX_ERROR_CHECK(status); - - // Calculate session key if public key/SHA512 digest matches - if (memcmp(temp_key_location, response_packet->body.ncp_pub_key_mac, SL_WFX_HOST_PUB_KEY_MAC_SIZE) != MEMCMP_FAIL) - { - status = SL_STATUS_WIFI_SECURE_LINK_EXCHANGE_FAILED; - goto error_handler; - } - -#if SL_WFX_SLK_CURVE25519 - SL_WFX_UNUSED_PARAMETER(sl_host_pub_key); - - mbedtls_mpi_lset(&mbedtls_host_context.Qp.Z, MPI_SET); - - // Read Ineo public key - reverse_bytes(response_packet->body.ncp_pub_key, SL_WFX_NCP_PUB_KEY_SIZE); - mbedtls_mpi_read_binary(&mbedtls_host_context.Qp.X, response_packet->body.ncp_pub_key, SL_WFX_NCP_PUB_KEY_SIZE); - - // Calculate shared secret - if (mbedtls_ecdh_compute_shared(&mbedtls_host_context.grp, &mbedtls_host_context.z, &mbedtls_host_context.Qp, - &mbedtls_host_context.d, mbedtls_ctr_drbg_random, - &host_drbg_context) != SUCCESS_STATUS_WIFI_SECURE_LINK_EXCHANGE) - { - status = SL_STATUS_WIFI_SECURE_LINK_EXCHANGE_FAILED; - goto error_handler; - } - - // Generate session key - mbedtls_mpi_write_binary(&mbedtls_host_context.z, temp_key_location, SL_WFX_HOST_PUB_KEY_SIZE); - reverse_bytes(temp_key_location, SL_WFX_HOST_PUB_KEY_SIZE); - mbedtls_sha256(temp_key_location, SL_WFX_HOST_PUB_KEY_SIZE, shared_key_digest, SHA224_0); -#else - uint8_t hmac_input[HMAC_SIZE] = { 0 }; - char label[LABLE_LEN] = "SecureLink!KeyDerivation"; - - memset((uint16_t *) &hmac_input[0], (uint16_t) sl_wfx_htole16(1), MEMSET_LEN); - memcpy((uint8_t *) &hmac_input[2], (uint8_t *) label, LABLE_LEN); - memcpy((uint8_t *) &hmac_input[26], sl_host_pub_key, SL_WFX_NCP_PUB_KEY_SIZE); - memcpy((uint8_t *) &hmac_input[58], (uint8_t *) response_packet->body.ncp_pub_key, SL_WFX_NCP_PUB_KEY_SIZE); - memset((uint16_t *) &hmac_input[90], (uint16_t) sl_wfx_htole16(128), 1); - - // Generate SHA256 digest of hmac_input - status = mbedtls_md_hmac(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256), sl_mac_key, SL_WFX_HOST_PUB_KEY_SIZE, - (uint8_t *) hmac_input, HMAC_SIZE, shared_key_digest); -#endif - - memcpy(sl_wfx_context->secure_link_session_key, shared_key_digest, - SL_WFX_SECURE_LINK_SESSION_KEY_LENGTH); // Use the lower 16 bytes of the sha256 - sl_wfx_context->secure_link_nonce.hp_packet_count = 0; - sl_wfx_context->secure_link_nonce.rx_packet_count = 0; - sl_wfx_context->secure_link_nonce.tx_packet_count = 0; - -error_handler: - if (xSemaphoreGive(wfx_securelink_rx_mutex) != pdTRUE) - { - printf("ERROR: sl_wfx_securelink_rx_mutex. unable to post.\n"); - } - return status; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_free_crypto_context(void) - * @brief - * Free host crypto context - * @param[in] None - * @return returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_free_crypto_context(void) -{ -#if SL_WFX_SLK_CURVE25519 - mbedtls_ecdh_free(&mbedtls_host_context); - mbedtls_ctr_drbg_free(&host_drbg_context); -#endif - mbedtls_entropy_free(&entropy); - - return SL_STATUS_OK; -} - -/******************************************************************************** - * @fn sl_status_t sl_wfx_host_decode_secure_link_data(uint8_t *buffer, uint32_t length, uint8_t *session_key) - * @brief - * Decode receive data - * Length excludes size of CCM tag and secure link header - * @param[in] buffer: - * @param[in] length: - * @param[in] session_key: - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - ********************************************************************************/ -sl_status_t sl_wfx_host_decode_secure_link_data(uint8_t * buffer, uint32_t length, uint8_t * session_key) -{ - mbedtls_ccm_context ccm_context; - sl_status_t status = SL_STATUS_SECURITY_DECRYPT_ERROR; - int crypto_status; - sl_wfx_nonce_t nonce = { 0, 0, 0 }; - - if (xSemaphoreTake(wfx_securelink_rx_mutex, portMAX_DELAY) != pdTRUE) - { - return SL_STATUS_FAIL; - } - - // Nonce for decryption should have TX and HP counters 0, only use RX counter - nonce.rx_packet_count = sl_wfx_context->secure_link_nonce.rx_packet_count; - - // Init context - mbedtls_ccm_init(&ccm_context); - - // Set the crypto key - crypto_status = mbedtls_ccm_setkey(&ccm_context, MBEDTLS_CIPHER_ID_AES, session_key, SL_WFX_SECURE_LINK_SESSION_KEY_BIT_COUNT); - SL_WFX_ERROR_CHECK(crypto_status); - - // Decrypt the data - if (!mbedtls_ccm_auth_decrypt(&ccm_context, length, (uint8_t *) &nonce, SL_WFX_SECURE_LINK_NONCE_SIZE_BYTES, NULL, - ADDRESS_LENGTH, (uint8_t *) buffer, (uint8_t *) buffer, (uint8_t *) buffer + length, - SL_WFX_SECURE_LINK_CCM_TAG_SIZE)) - { - status = SL_STATUS_OK; - } - -error_handler: - mbedtls_ccm_free(&ccm_context); - if (xSemaphoreGive(wfx_securelink_rx_mutex) != pdTRUE) - { - printf("ERROR: sl_wfx_securelink_rx_mutex. unable to post.\n"); - } - return status; -} - -/********************************************************************* - * @fn sl_status_t sl_wfx_host_encode_secure_link_data(sl_wfx_generic_message_t *buffer, - uint32_t data_length, - uint8_t *session_key, - uint8_t *nonce) - * @brief - * Encode transmit data - * Length excludes size of CCM tag and secure link header - * @param[in] buffer: - * @param[in] data_length: - * @param[in] session_key: - * @param[in] nonce: - * @return returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise -*************************************************************************/ -sl_status_t sl_wfx_host_encode_secure_link_data(sl_wfx_generic_message_t * buffer, uint32_t data_length, uint8_t * session_key, - uint8_t * nonce) -{ - mbedtls_ccm_context ccm_context; - sl_status_t status = SL_STATUS_FAIL; - - mbedtls_ccm_init(&ccm_context); - if (mbedtls_ccm_setkey(&ccm_context, MBEDTLS_CIPHER_ID_AES, session_key, SL_WFX_SECURE_LINK_SESSION_KEY_BIT_COUNT) == - CCM_STATUS_SUCCESS) - { - mbedtls_ccm_encrypt_and_tag(&ccm_context, data_length, nonce, SL_WFX_SECURE_LINK_NONCE_SIZE_BYTES, NULL, ADDRESS_LENGTH, - (uint8_t *) &buffer->header.id, (uint8_t *) &buffer->header.id, - (uint8_t *) &buffer->header.id + data_length, SL_WFX_SECURE_LINK_CCM_TAG_SIZE); - status = SL_STATUS_OK; - } - - mbedtls_ccm_free(&ccm_context); - - return status; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_schedule_secure_link_renegotiation(void) - * @brief - * Called when the driver needs to schedule secure link renegotiation - * @param[in] None - * @returns Returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_schedule_secure_link_renegotiation(void) -{ - // call sl_wfx_secure_link_renegotiate_session_key() as soon as it makes sense for the host to do so - xTaskNotifyGive(wfx_securelink_task); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn static inline void reverse_bytes(uint8_t *src, uint8_t length) - * @brief - * reverse the bytes - * @param[in] src: source - * @param[in] length: - * @returns None - *****************************************************************************/ -static inline void reverse_bytes(uint8_t * src, uint8_t length) -{ - uint8_t * lo = src; - uint8_t * hi = src + length - 1; - uint8_t swap; - - while (lo < hi) - { - swap = *lo; - *lo++ = *hi; - *hi-- = swap; - } -} - -/******************************************************************************************************** - ******************************************************************************************************** - * DEPENDENCIES & AVAIL CHECK(S) - ******************************************************************************************************** - *******************************************************************************************************/ - -#endif // SL_WFX_USE_SECURE_LINK diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_host.h b/examples/platform/silabs/SiWx917/wf200/sl_wfx_host.h deleted file mode 100644 index dc9bcd28524623..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_host.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "FreeRTOS.h" -#include "queue.h" -#include "semphr.h" -#include "sl_wfx.h" -#include "task.h" - -#ifdef __cplusplus -extern "C" { -#endif -uint8_t sl_wfx_host_get_waited_event(void); -sl_status_t wfx_soft_init(void); - -#ifdef SLEEP_ENABLED -sl_status_t sl_wfx_host_switch_to_wirq(void); -#endif -#ifdef __cplusplus -} -#endif - -#define SL_WFX_MAX_STATIONS 8 -#define SL_WFX_MAX_SCAN_RESULTS 50 - -typedef struct __attribute__((__packed__)) scan_result_list_s -{ - sl_wfx_ssid_def_t ssid_def; - uint8_t mac[SL_WFX_MAC_ADDR_SIZE]; - uint16_t channel; - sl_wfx_security_mode_bitmask_t security_mode; - uint16_t rcpi; -} scan_result_list_t; - -void sl_wfx_host_start_platform_interrupt(void); -extern SemaphoreHandle_t wfx_wakeup_sem; diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_securelink_task.c b/examples/platform/silabs/SiWx917/wf200/sl_wfx_securelink_task.c deleted file mode 100644 index 28ffdda2c3852f..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_securelink_task.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifdef SL_WFX_USE_SECURE_LINK -#include "secure_link/sl_wfx_secure_link.h" - -#include "FreeRTOS.h" -#include "queue.h" -#include "semphr.h" -#include "task.h" -#include -#include -#include - -// Securelink Task Configurations -#define WFX_SECURELINK_TASK_PRIO 1u -#define WFX_SECURELINK_TASK_STK_SIZE 512u - -TaskHandle_t secureLinkTaskHandle; -SemaphoreHandle_t s_xSLSemaphore; -StackType_t secureLinkStack[WFX_SECURELINK_TASK_STK_SIZE]; -StaticTask_t secureLinkTaskStruct; - -StaticSemaphore_t xSlMutexBuffer; - -/********************************************************************* - * @fn static void prvSecureLinkTask(void *p_arg) - * @brief - * The task that implements the Secure Link renegotiation with WFX. - * @param[in] p_arg: - * @return None - *************************************************************************/ -static void prvSecureLinkTask(void * p_arg) -{ - sl_status_t result; - (void) p_arg; - - /* Create a mutex used for making Secure Link renegotiations atomic */ - s_xSLSemaphore = xSemaphoreCreateMutexStatic(&xSlMutexBuffer); - - for (;;) - { - /* Wait for a key renegotiation request */ - ulTaskNotifyTake(pdTRUE, portMAX_DELAY); - - result = sl_wfx_secure_link_renegotiate_session_key(); - if (result != SL_STATUS_OK) - { - printf("session key negotiation error %lu\n", result); - } - } -} - -/**************************************************************************** - * @fn void wfx_securelink_task_start(void) - * @brief - * Creates WFX securelink key renegotiation task. - * @param[in] None - * @return None - ******************************************************************************/ -void wfx_securelink_task_start(void) -{ - secureLinkTaskHandle = xTaskCreateStatic(prvSecureLinkTask, "secureLinkTask", WFX_SECURELINK_TASK_STK_SIZE, NULL, - WFX_SECURELINK_TASK_PRIO, secureLinkStack, &secureLinkTaskStruct); - if (secureLinkTaskHandle == NULL) - { - printf("Failed to create WFX secureLinkTask"); - } -} - -#endif diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_task.c b/examples/platform/silabs/SiWx917/wf200/sl_wfx_task.c deleted file mode 100644 index 8a00e454ade504..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_task.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include "em_gpio.h" - -#include "sl_wfx.h" -#include "sl_wfx_board.h" -#include "sl_wfx_host.h" -#include "sl_wfx_task.h" - -#include "FreeRTOS.h" -#include "event_groups.h" -#include "task.h" - -#include "AppConfig.h" - -#define CHECK_VAL 0 -#define WFX_BUS_TASK_PRIORITY 2 -#define BUS_TASK_STACK_SIZE 1024 -static StackType_t busStack[BUS_TASK_STACK_SIZE]; -StaticTask_t busTaskStruct; -TaskHandle_t wfx_bus_task_handle; - -wfx_frame_q_item wfx_bus_tx_frame; -SemaphoreHandle_t wfxtask_tx_complete; -SemaphoreHandle_t wfxtask_mutex; - -// Flag to indicate receive frames is currently running. -static bool wfx_bus_rx_in_process = false; - -/*************************************************************************** - * @fn bool wfx_bus_is_receive_processing(void) - * @brief - * Check receive frame status - * @param[in] None - * @return returns wfx_bus_rx_in_process - ******************************************************************************/ -bool wfx_bus_is_receive_processing(void) -{ - return wfx_bus_rx_in_process; -} - -/***************************************************************************** - * @fn static sl_status_t receive_frames() - * @brief - * Receives frames from the WFX. - * @param[in] None - * @return returns result - ******************************************************************************/ -static sl_status_t receive_frames() -{ - sl_status_t result; - uint16_t control_register = 0; - wfx_bus_rx_in_process = true; - do - { - result = sl_wfx_receive_frame(&control_register); - SL_WFX_ERROR_CHECK(result); - } while ((control_register & SL_WFX_CONT_NEXT_LEN_MASK) != CHECK_VAL); - -error_handler: - wfx_bus_rx_in_process = false; - return result; -} - -/******************************************************************************** - * @fn static void wfx_bus_task(void *p_arg) - * @brief - * WFX bus communication task. - * receives frames from the Bus interface - * @param[in] p_arg: - * @return None - */ -static void wfx_bus_task(void * p_arg) -{ - SILABS_LOG("SPI: Bus Task started"); - sl_wfx_host_start_platform_interrupt(); - for (;;) - { - /*Wait for an interrupt from WFX*/ - ulTaskNotifyTake(pdTRUE, portMAX_DELAY); - - /*Disable the interrupt while treating frames received to avoid - *the case where the interrupt is set but there is no frame left to treat.*/ - sl_wfx_host_disable_platform_interrupt(); - - /*Receive the frame(s) pending in WFX*/ - receive_frames(); - - /*Re-enable the interrupt*/ - sl_wfx_host_enable_platform_interrupt(); - } -} - -/*************************************************************************** - * @fn void wfx_bus_start() - * @brief - * Creates WFX bus communication task. - * @param[in] None - * @return None - ******************************************************************************/ -void wfx_bus_start() -{ - wfx_bus_task_handle = - xTaskCreateStatic(wfx_bus_task, "wfxbus", BUS_TASK_STACK_SIZE, NULL, WFX_BUS_TASK_PRIORITY, busStack, &busTaskStruct); - if (wfx_bus_task_handle == NULL) - { - SILABS_LOG("*ERR*WFX BusTask"); - } -} diff --git a/examples/platform/silabs/SiWx917/wf200/sl_wfx_task.h b/examples/platform/silabs/SiWx917/wf200/sl_wfx_task.h deleted file mode 100644 index 6838b9bac14eb4..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/sl_wfx_task.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#include "FreeRTOS.h" -#include "sl_wfx_constants.h" -#include "task.h" - -typedef struct -{ - sl_wfx_send_frame_req_t * frame; - uint32_t data_length; - sl_wfx_interface_t interface; - uint8_t priority; -} wfx_frame_q_item; - -extern wfx_frame_q_item wfxtask_tx_frame; -extern TaskHandle_t wfx_bus_task_handle; - -#ifdef __cplusplus -extern "C" { -#endif - -/**************************************************************************** - * @fn void wfx_bus_start(void) - * @brief - * Start wfx bus communication task. - *****************************************************************************/ -void wfx_bus_start(void); - -/**************************************************************************** - * @fn bool wfx_bus_is_receive_processing(void) - * @brief - * Returns status of wfx receive frames. - *****************************************************************************/ -bool wfx_bus_is_receive_processing(void); - -#ifdef __cplusplus -} -#endif diff --git a/examples/platform/silabs/SiWx917/wf200/wf200.gni b/examples/platform/silabs/SiWx917/wf200/wf200.gni deleted file mode 100644 index 358384a81121bf..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/wf200.gni +++ /dev/null @@ -1,30 +0,0 @@ -import("//build_overrides/chip.gni") -import("//build_overrides/efr32_sdk.gni") -import("//build_overrides/pigweed.gni") - -examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" -wifi_sdk_dir = "${chip_root}/src/platform/silabs/EFR32/wifi" - -wf200_defs = [ - "SL_HEAP_SIZE=24576", - "WF200_WIFI=1", - "SL_WIFI=1", - "SL_WFX_USE_SPI", - "SL_WFX_DEBUG_MASK=0x0003", -] -softap_defs = "SL_WFX_CONFIG_SOFTAP" -wifi_scan_defs = "SL_WFX_CONFIG_SCAN" -wf200_plat_incs = [ - "${wifi_sdk_dir}/", - "${examples_plat_dir}/wf200", -] -wf200_plat_src = [ - "${wifi_sdk_dir}/dhcp_client.cpp", - "${wifi_sdk_dir}/ethernetif.cpp", - "${wifi_sdk_dir}/lwip_netif.cpp", - "${wifi_sdk_dir}/wfx_notify.cpp", - "${examples_plat_dir}/wf200/sl_wfx_task.c", - "${examples_plat_dir}/wf200/wf200_init.c", - "${examples_plat_dir}/wf200/efr_spi.c", - "${examples_plat_dir}/wf200/host_if.cpp", -] diff --git a/examples/platform/silabs/SiWx917/wf200/wf200_init.c b/examples/platform/silabs/SiWx917/wf200/wf200_init.c deleted file mode 100644 index 12973d3c8ffb67..00000000000000 --- a/examples/platform/silabs/SiWx917/wf200/wf200_init.c +++ /dev/null @@ -1,543 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Includes */ - -#include "em_gpio.h" - -#include "sl_wfx.h" -#include "sl_wfx_board.h" - -// File specific to each platform, it must be created for custom boards -#include "sl_wfx_pds.h" - -#include -#include -#include -#include - -/* Firmware include */ -#include "sl_wfx_wf200_C0.h" - -#include "FreeRTOS.h" -#include "event_groups.h" -#include "task.h" - -#include "AppConfig.h" -#include "sl_wfx_host.h" -#include "sl_wfx_task.h" -#include "wfx_host_events.h" - -#include "sl_spidrv_instances.h" -#include "spidrv.h" - -#define SL_WFX_EVENT_MAX_SIZE 512 -#define SL_WFX_EVENT_LIST_SIZE 1 - -StaticSemaphore_t xWfxWakeupSemaBuffer; -uint8_t sWfxEventQueueBuffer[SL_WFX_EVENT_LIST_SIZE * sizeof(uint8_t)]; -StaticQueue_t sWfxEventQueueStruct; -QueueHandle_t wfx_event_Q = NULL; -SemaphoreHandle_t wfx_wakeup_sem = NULL; -SemaphoreHandle_t wfx_mutex = NULL; - -StaticSemaphore_t xWfxMutexBuffer; - -struct -{ - uint32_t wf200_firmware_download_progress; - int wf200_initialized; - uint8_t waited_event_id; - uint8_t posted_event_id; -} host_context; - -#ifdef SL_WFX_USE_SDIO -#ifdef SLEEP_ENABLED -sl_status_t sl_wfx_host_enable_sdio(void); -sl_status_t sl_wfx_host_disable_sdio(void); -#endif -#endif - -#ifdef SL_WFX_USE_SPI -#ifdef SLEEP_ENABLED -sl_status_t sl_wfx_host_enable_spi(void); -sl_status_t sl_wfx_host_disable_spi(void); -#endif -#endif - -/**************************************************************************** - * @fn sl_status_t wfx_soft_init(void) - * @brief - * WFX FMAC driver host interface initialization - * @param[in] None - * @returns Returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t wfx_soft_init(void) -{ - SILABS_LOG("WF200:Soft Init"); - if ((wfx_event_Q = xQueueCreateStatic(SL_WFX_EVENT_LIST_SIZE, sizeof(uint8_t), sWfxEventQueueBuffer, &sWfxEventQueueStruct)) == - NULL) - { - return SL_STATUS_FAIL; - } - - if ((wfx_wakeup_sem = xSemaphoreCreateBinaryStatic(&xWfxWakeupSemaBuffer)) == NULL) - { - return SL_STATUS_FAIL; - } - - if ((wfx_mutex = xSemaphoreCreateMutexStatic(&xWfxMutexBuffer)) == NULL) - { - return SL_STATUS_FAIL; - } - - return SL_STATUS_OK; -} -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_init(void) - * @brief - * Notify driver init function - * @param[in] None - * @returns Returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_init(void) -{ - SILABS_LOG("WFX: Host Init"); - host_context.wf200_firmware_download_progress = 0; - host_context.wf200_initialized = 0; - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_get_firmware_data(const uint8_t **data, uint32_t data_size) - * @brief - * Get firmware data - * @param[in] data: - * @param[in] data_size: - * @returns Returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_get_firmware_data(const uint8_t ** data, uint32_t data_size) -{ - *data = &sl_wfx_firmware[host_context.wf200_firmware_download_progress]; - host_context.wf200_firmware_download_progress += data_size; - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_get_firmware_size(uint32_t *firmware_size) - * @brief - * Get firmware size - * @param[in] firmware_size: - * @returns Returns SL_STATUS_OK if successful, - * SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_get_firmware_size(uint32_t * firmware_size) -{ - *firmware_size = sizeof(sl_wfx_firmware); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_get_pds_data(const char **pds_data, uint16_t index) - * @brief - * Get PDS data - * @param[in] pds_data: - * @param[in] index: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_get_pds_data(const char ** pds_data, uint16_t index) -{ - *pds_data = sl_wfx_pds[index]; - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_get_pds_size(uint16_t *pds_size) - * @brief - * Get PDS size - * @param[in] pds_size: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_get_pds_size(uint16_t * pds_size) -{ - *pds_size = SL_WFX_ARRAY_COUNT(sl_wfx_pds); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_deinit(void) - * @brief - * Deinit host interface - * @param[in] None - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_deinit(void) -{ - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_allocate_buffer(void **buffer, sl_wfx_buffer_type_t type, uint32_t buffer_size) - * @brief - * Allocate buffer (Should allocate either Ethernet - from LWIP or Control) - TODO - * @param[in] buffer: - * @param[in] type: - * @param[in] buffer_size: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_allocate_buffer(void ** buffer, sl_wfx_buffer_type_t type, uint32_t buffer_size) -{ - if ((*buffer = pvPortMalloc(buffer_size)) == (void *) 0) - { - return SL_STATUS_FAIL; - } - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_free_buffer(void *buffer, sl_wfx_buffer_type_t type) - * @brief - * Free host buffer (CHECK LWIP buffer) - * @param[in] buffer: - * @param[in] type: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_free_buffer(void * buffer, sl_wfx_buffer_type_t type) -{ - vPortFree(buffer); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_hold_in_reset(void) - * @brief - * Set reset pin low - * @param[in] None - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_hold_in_reset(void) -{ - GPIO_PinOutClear(SL_WFX_HOST_PINOUT_RESET_PORT, SL_WFX_HOST_PINOUT_RESET_PIN); - host_context.wf200_initialized = 0; - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_set_wake_up_pin(uint8_t state) - * @brief - * Set wakeup pin status - * @param[in] state: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_set_wake_up_pin(uint8_t state) -{ - CORE_DECLARE_IRQ_STATE; - - CORE_ENTER_ATOMIC(); - if (state > PINOUT_CLEAR_STATUS) - { -#ifdef SLEEP_ENABLED -#ifdef SL_WFX_USE_SDIO - sl_wfx_host_enable_sdio(); -#endif -#ifdef SL_WFX_USE_SPI - sl_wfx_host_enable_spi(); -#endif -#endif - GPIO_PinOutSet(SL_WFX_HOST_PINOUT_WUP_PORT, SL_WFX_HOST_PINOUT_WUP_PIN); - } - else - { - GPIO_PinOutClear(SL_WFX_HOST_PINOUT_WUP_PORT, SL_WFX_HOST_PINOUT_WUP_PIN); -#ifdef SLEEP_ENABLED -#ifdef SL_WFX_USE_SDIO - sl_wfx_host_disable_sdio(); -#endif -#ifdef SL_WFX_USE_SPI - sl_wfx_host_disable_spi(); -#endif -#endif - } - CORE_EXIT_ATOMIC(); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_reset_chip(void) - * @brief - * reset the host chip - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_reset_chip(void) -{ - // Pull it low for at least 1 ms to issue a reset sequence - GPIO_PinOutClear(SL_WFX_HOST_PINOUT_RESET_PORT, SL_WFX_HOST_PINOUT_RESET_PIN); - - // Delay for 10ms - vTaskDelay(pdMS_TO_TICKS(10)); - - // Hold pin high to get chip out of reset - GPIO_PinOutSet(SL_WFX_HOST_PINOUT_RESET_PORT, SL_WFX_HOST_PINOUT_RESET_PIN); - - // Delay for 3ms - vTaskDelay(pdMS_TO_TICKS(3)); - - host_context.wf200_initialized = 0; - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_wait_for_wake_up(void) - * @brief - * wait for the host wake up - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_wait_for_wake_up(void) -{ - xSemaphoreTake(wfx_wakeup_sem, TICKS_TO_WAIT_0); - xSemaphoreTake(wfx_wakeup_sem, TICKS_TO_WAIT_3 / portTICK_PERIOD_MS); - - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_wait(uint32_t wait_time) - * @brief - * wait for the host - * @param[in] wait_time: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ - -sl_status_t sl_wfx_host_wait(uint32_t wait_time) -{ - uint32_t ticks = pdMS_TO_TICKS(wait_time); - vTaskDelay(ticks ? ticks : 10); - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_setup_waited_event(uint8_t event_id) - * @brief - * Called when the driver needs to setup the waited event - * @param[in] event_id: - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_FAIL otherwise - *****************************************************************************/ - -sl_status_t sl_wfx_host_setup_waited_event(uint8_t event_id) -{ - host_context.waited_event_id = event_id; - host_context.posted_event_id = 0; - - return SL_STATUS_OK; -} - -/**************************************************************************** - * @fn uint8_t sl_wfx_host_get_waited_event(void) - * @brief - * Called when the driver get waited event - * @returns returns host_context.waited_event_id - *****************************************************************************/ - -uint8_t sl_wfx_host_get_waited_event(void) -{ - return host_context.waited_event_id; -} - -/****************************************************************************** - * @fn sl_status_t sl_wfx_host_wait_for_confirmation(uint8_t confirmation_id, uint32_t timeout, void **event_payload_out) - * @brief - * wait for the host confirmation - * @param[in] confirmation_id: - * @param[in] timeout: - * @param[in] event_payload_out: - * @returns Returns SL_STATUS_OK if successful, - * Timeout, SL_STATUS_TIMEOUT otherwise - *****************************************************************************/ - -sl_status_t sl_wfx_host_wait_for_confirmation(uint8_t confirmation_id, uint32_t timeout, void ** event_payload_out) -{ - uint8_t posted_event_id; - for (uint32_t i = 0; i < timeout; i++) - { - /* Wait for an event posted by the function sl_wfx_host_post_event() */ - if (xQueueReceive(wfx_event_Q, &posted_event_id, TICKS_TO_WAIT_1) == pdTRUE) - { - /* Once a message is received, check if it is the expected ID */ - if (confirmation_id == posted_event_id) - { - /* Pass the confirmation reply and return*/ - if (event_payload_out != NULL) - { - *event_payload_out = sl_wfx_context->event_payload_buffer; - } - return SL_STATUS_OK; - } - } - } - /* The wait for the confirmation timed out, return */ - return SL_STATUS_TIMEOUT; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_lock(void) - * @brief - * Called when the driver needs to lock its access - * @returns Returns SL_STATUS_OK if successful, - *SL_STATUS_TIMEOUT otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_lock(void) -{ - - sl_status_t status = SL_STATUS_OK; - - if (xSemaphoreTake(wfx_mutex, TICKS_TO_WAIT_500) != pdTRUE) - { - SILABS_LOG("*ERR*Wi-Fi driver mutex timo"); - status = SL_STATUS_TIMEOUT; - } - - return status; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_unlock(void) - * @brief - * Called when the driver needs to unlock its access - * @returns Returns SL_STATUS_OK - *****************************************************************************/ -sl_status_t sl_wfx_host_unlock(void) -{ - xSemaphoreGive(wfx_mutex); - - return SL_STATUS_OK; -} - -/****************************************************************************** - * @fn sl_status_t sl_wfx_host_post_event(sl_wfx_generic_message_t *event_payload) - * @brief - * Called when the driver needs to post an event - * @param[in] event_payload: - * @returns Returns status - *****************************************************************************/ -sl_status_t sl_wfx_host_post_event(sl_wfx_generic_message_t * event_payload) -{ - sl_status_t status; - - /* Forward the message to the application */ - status = sl_wfx_host_process_event(event_payload); - - if (host_context.waited_event_id == event_payload->header.id) - { - if (event_payload->header.length < SL_WFX_EVENT_MAX_SIZE) - { - /* Post the event in the queue */ - memcpy(sl_wfx_context->event_payload_buffer, (void *) event_payload, event_payload->header.length); - host_context.posted_event_id = event_payload->header.id; - xQueueOverwrite(wfx_event_Q, (void *) &event_payload->header.id); - } - } - - return status; -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_transmit_frame(void *frame, uint32_t frame_len) - * @brief - * Called when the driver needs to transmit a frame - * @param[in] frame: - * @param[in] frame_len: - * @returns returns sl_wfx_data_write(frame, frame_len) - *****************************************************************************/ -sl_status_t sl_wfx_host_transmit_frame(void * frame, uint32_t frame_len) -{ - return sl_wfx_data_write(frame, frame_len); -} - -/**************************************************************************** - * @fn sl_status_t sl_wfx_host_sleep_grant(sl_wfx_host_bus_transfer_type_t type, - sl_wfx_register_address_t address, - uint32_t length) - * @brief - * Called when the driver is considering putting the - * WFx in sleep mode - * @param[in] type: - * @param[in] address: - * @param[in] length: - * @returns SL_WIFI_SLEEP_GRANTED to let the WFx go to - *sleep, SL_WIFI_SLEEP_NOT_GRANTED otherwise - *****************************************************************************/ -sl_status_t sl_wfx_host_sleep_grant(sl_wfx_host_bus_transfer_type_t type, sl_wfx_register_address_t address, uint32_t length) -{ - (void) (type); - (void) (address); - (void) (length); - - return SL_STATUS_WIFI_SLEEP_GRANTED; -} - -#if SL_WFX_DEBUG_MASK -/**************************************************************************** - * @fn void sl_wfx_host_log(const char *str, ...) - * @brief - * Host debug output - * @param[in] str: string - * @return None - *****************************************************************************/ -void sl_wfx_host_log(const char * str, ...) -{ - va_list args; - va_start(args, str); - vprintf(str, args); - va_end(args); -} -#endif -#ifndef PW_RPC_ENABLED -/* Place holder - This is just to handle UART interrupts - * The "otThread tasks handles it. WiFi does not need it yet - * I don't care for it. I should really have the thread - * shut it off - */ -#if !CHIP_ENABLE_OPENTHREAD -/**************************************************************************** - * @fn void otSysEventSignalPending(void) - * @brief - * system event signal pending - * @param[in] None - * @return None - *****************************************************************************/ -void otSysEventSignalPending(void) -{ - // BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR(); - SILABS_LOG("*ERR*UART intr - NOT Handled"); - portYIELD_FROM_ISR(pdFALSE); -} -#endif /* !CHIP_ENABLE_OPENTHREAD */ -#endif /* PW_RPC_ENABLED */ diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index c02b331b49af33..92687ba2969a0a 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -164,6 +164,11 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { "CHIP_DEVICE_LAYER_TARGET_EFR32=1", "CHIP_DEVICE_LAYER_TARGET=silabs", ] + } else if (chip_device_platform == "SiWx917") { + defines += [ + "CHIP_DEVICE_LAYER_TARGET_EFR32=1", + "CHIP_DEVICE_LAYER_TARGET=silabs", + ] } else if (chip_device_platform == "esp32") { defines += [ "CHIP_DEVICE_LAYER_TARGET_ESP32=1", @@ -410,6 +415,8 @@ if (chip_device_platform != "none") { _platform_target = "Darwin" } else if (chip_device_platform == "efr32") { _platform_target = "silabs/EFR32" + } else if (chip_device_platform == "SiWx917") { + _platform_target = "silabs/SiWx917" } else if (chip_device_platform == "esp32") { _platform_target = "ESP32" } else if (chip_device_platform == "k32w0") { diff --git a/src/platform/device.gni b/src/platform/device.gni index 601d21ef2ff2f1..c0ad4bb5daa3a7 100755 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -113,6 +113,8 @@ if (chip_device_platform == "cc13x2_26x2") { _chip_device_layer = "Darwin" } else if (chip_device_platform == "efr32") { _chip_device_layer = "silabs" +} else if (chip_device_platform == "SiWx917") { + _chip_device_layer = "silabs" } else if (chip_device_platform == "esp32") { _chip_device_layer = "ESP32" } else if (chip_device_platform == "linux") { @@ -212,5 +214,5 @@ assert( chip_device_platform == "webos" || chip_device_platform == "bl602" || chip_device_platform == "mw320" || chip_device_platform == "zephyr" || chip_device_platform == "beken" || chip_device_platform == "bl702" || - chip_device_platform == "mt793x", + chip_device_platform == "mt793x" || chip_device_platform == "SiWx917", "Please select a valid value for chip_device_platform") diff --git a/src/platform/silabs/BLEManagerImpl.h b/src/platform/silabs/BLEManagerImpl.h index 0f1d478f179b61..e0a04e5f356e7e 100644 --- a/src/platform/silabs/BLEManagerImpl.h +++ b/src/platform/silabs/BLEManagerImpl.h @@ -26,10 +26,22 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE #include "FreeRTOS.h" +#include "timers.h" +#ifdef RS91X_BLE_ENABLE +#ifdef __cplusplus +extern "C" { +#endif +#include +#include +#include +#ifdef __cplusplus +} +#endif +#else #include "gatt_db.h" #include "sl_bgapi.h" #include "sl_bt_api.h" -#include "timers.h" +#endif // RS91X_BLE_ENABLE namespace chip { namespace DeviceLayer { @@ -45,6 +57,16 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla public: void HandleBootEvent(void); + +#ifdef RS91X_BLE_ENABLE + void HandleConnectEvent(void); + void HandleConnectionCloseEvent(uint16_t reason); + void HandleWriteEvent(rsi_ble_event_write_t evt); + void UpdateMtu(rsi_ble_event_mtu_t evt); + void HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId); + void HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt); + void HandleSoftTimerEvent(void); +#else void HandleConnectEvent(volatile sl_bt_msg_t * evt); void HandleConnectionCloseEvent(volatile sl_bt_msg_t * evt); void HandleWriteEvent(volatile sl_bt_msg_t * evt); @@ -53,9 +75,17 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla void HandleTXCharCCCDWrite(volatile sl_bt_msg_t * evt); void HandleSoftTimerEvent(volatile sl_bt_msg_t * evt); +#endif // RS91X_BLE_ENABLE + +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING +#ifdef RS91X_BLE_ENABLE + static void HandleC3ReadRequest(void); +#else #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING static void HandleC3ReadRequest(volatile sl_bt_msg_t * evt); #endif +#endif +#endif private: // Allow the BLEManager interface class to delegate method calls to @@ -125,7 +155,9 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla struct CHIPoBLEConState { +#ifndef RS91X_BLE_ENABLE bd_addr address; +#endif uint16_t mtu : 10; uint16_t allocated : 1; uint16_t subscribed : 1; @@ -153,7 +185,12 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING CHIP_ERROR EncodeAdditionalDataTlv(); #endif + +#ifdef RS91X_BLE_ENABLE + void HandleRXCharWrite(rsi_ble_event_write_t * evt); +#else void HandleRXCharWrite(volatile sl_bt_msg_t * evt); +#endif bool RemoveConnection(uint8_t connectionHandle); void AddConnection(uint8_t connectionHandle, uint8_t bondingHandle); void StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs); diff --git a/src/platform/silabs/CHIPMem-Platform.cpp b/src/platform/silabs/CHIPMem-Platform.cpp index 4f8b938f5d26ec..a826ebe856ca1e 100644 --- a/src/platform/silabs/CHIPMem-Platform.cpp +++ b/src/platform/silabs/CHIPMem-Platform.cpp @@ -150,7 +150,12 @@ bool MemoryInternalCheckPointer(const void * p, size_t min_size) } // namespace Platform } // namespace chip +#ifdef BRD4325A +extern "C" void memMonitoringTrackAlloc(void * ptr, size_t size) {} +extern "C" void memMonitoringTrackFree(void * ptr, size_t size) {} +#else extern "C" __WEAK void memMonitoringTrackAlloc(void * ptr, size_t size) {} extern "C" __WEAK void memMonitoringTrackFree(void * ptr, size_t size) {} +#endif // BRD4325A #endif // CHIP_CONFIG_MEMORY_MGMT_PLATFORM diff --git a/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp b/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp index 7bb0741b83d1a6..effee8c67d71a5 100644 --- a/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp +++ b/src/platform/silabs/ConnectivityManagerImpl_WIFI.cpp @@ -262,6 +262,7 @@ void ConnectivityManagerImpl::DriveStationState() // If the WiFi station interface is no longer enabled, or no longer provisioned, // disconnect the station from the AP, unless the WiFi station mode is currently // under application control. +#ifndef CHIP_ONNETWORK_PAIRING if (mWiFiStationMode != kWiFiStationMode_ApplicationControlled && (mWiFiStationMode != kWiFiStationMode_Enabled || !IsWiFiStationProvisioned())) { @@ -275,6 +276,7 @@ void ConnectivityManagerImpl::DriveStationState() ChangeWiFiStationState(kWiFiStationState_Disconnecting); } +#endif } // Otherwise the station interface is NOT connected to an AP, so... else diff --git a/src/platform/silabs/SiWx917/BLEManagerImpl.cpp b/src/platform/silabs/SiWx917/BLEManagerImpl.cpp index a76f26c6df6b20..6563f4b5b2e790 100644 --- a/src/platform/silabs/SiWx917/BLEManagerImpl.cpp +++ b/src/platform/silabs/SiWx917/BLEManagerImpl.cpp @@ -26,33 +26,113 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include "sl_component_catalog.h" - #include +#define RSI_BLE_ENABLE 1 -#include "FreeRTOS.h" -#include "rail.h" +//#include "rail.h" extern "C" { -#include "sl_bluetooth.h" -} -#include "sl_bt_api.h" -#include "sl_bt_stack_config.h" -#include "sl_bt_stack_init.h" +#include "FreeRTOS.h" +#include "event_groups.h" +#include "task.h" #include "timers.h" +#include "wfx_host_events.h" +#include "wfx_rsi.h" +#include "wfx_sl_ble_init.h" +#include +#include +#include +} #include #include #include #include #include -#include +#include #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING #include #endif +// static int32_t handleTxConfirmationFlag = 0; +extern uint16_t rsi_ble_measurement_hndl; +extern rsi_ble_event_conn_status_t conn_event_to_app; +extern sl_wfx_msg_t event_msg; + +// StaticTask_t busInitTaskStruct; + +/* wfxRsi Task will use as its stack */ +// StackType_t wfxRsiInitTaskStack[WFX_RSI_TASK_SZ] = { 0 }; + using namespace ::chip; using namespace ::chip::Ble; +void rsi_ble_event_handling_task(void) +{ + int32_t event_id; + + // int32_t event_id; + WFX_RSI_LOG("StartAdvertising"); + // chip::DeviceLayer::Internal::BLEManagerImpl().StartAdvertising(); //TODO:: Called on after init of module + + // Application event map + while (1) + { + // checking for events list + event_id = rsi_ble_app_get_event(); + if (event_id == -1) + { + continue; + } + switch (event_id) + { + case RSI_BLE_CONN_EVENT: { + rsi_ble_app_clear_event(RSI_BLE_CONN_EVENT); + chip::DeviceLayer::Internal::BLEMgrImpl().HandleConnectEvent(); + WFX_RSI_LOG(" RSI_BLE : Module got connected"); + } + break; + case RSI_BLE_DISCONN_EVENT: { + // event invokes when disconnection was completed + WFX_RSI_LOG(" RSI_BLE : Module got Disconnected"); + chip::DeviceLayer::Internal::BLEMgrImpl().HandleConnectionCloseEvent(event_msg.reason); + // clear the served event + rsi_ble_app_clear_event(RSI_BLE_DISCONN_EVENT); + } + break; + case RSI_BLE_MTU_EVENT: { + // event invokes when write/notification events received + WFX_RSI_LOG("RSI_BLE:: RSI_BLE_MTU_EVENT"); + chip::DeviceLayer::Internal::BLEMgrImpl().UpdateMtu(event_msg.rsi_ble_mtu); + // clear the served event + rsi_ble_app_clear_event(RSI_BLE_MTU_EVENT); + } + break; + case RSI_BLE_GATT_WRITE_EVENT: { + // event invokes when write/notification events received + WFX_RSI_LOG("RSI_BLE : RSI_BLE_GATT_WRITE_EVENT"); + chip::DeviceLayer::Internal::BLEMgrImpl().HandleWriteEvent(event_msg.rsi_ble_write); + // clear the served event + rsi_ble_app_clear_event(RSI_BLE_GATT_WRITE_EVENT); + } + break; + case RSI_BLE_GATT_INDICATION_CONFIRMATION: { + WFX_RSI_LOG("RSI_BLE : indication confirmation"); + chip::DeviceLayer::Internal::BLEMgrImpl().HandleTxConfirmationEvent(1); + rsi_ble_app_clear_event(RSI_BLE_GATT_INDICATION_CONFIRMATION); + } + break; + + case RSI_BLE_RESP_ATT_VALUE: { + WFX_RSI_LOG("RSI_BLE : RESP_ATT confirmation"); + } + default: + break; + } + } + + WFX_RSI_LOG("%s END", __func__); +} + namespace chip { namespace DeviceLayer { namespace Internal { @@ -75,6 +155,7 @@ namespace { // Timer Frequency used. #define TIMER_CLK_FREQ ((uint32_t) 32768) + // Convert msec to timer ticks. #define TIMER_MS_2_TIMERTICK(ms) ((TIMER_CLK_FREQ * ms) / 1000) #define TIMER_S_2_TIMERTICK(s) (TIMER_CLK_FREQ * s) @@ -96,6 +177,8 @@ namespace { #define BLE_CONFIG_MIN_CE_LENGTH (0) // Leave to min value #define BLE_CONFIG_MAX_CE_LENGTH (0xFFFF) // Leave to max value +#define BLE__DEFAULT_TIMER_PERIOD 1 + TimerHandle_t sbleAdvTimeoutTimer; // FreeRTOS sw timer. const uint8_t UUID_CHIPoBLEService[] = { 0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80, @@ -113,21 +196,33 @@ BLEManagerImpl BLEManagerImpl::sInstance; CHIP_ERROR BLEManagerImpl::_Init() { CHIP_ERROR err; + ChipLogProgress(DeviceLayer, "%s Start ", __func__); + + // wfx_rsi.init_task = xTaskCreateStatic((TaskFunction_t) wfx_sl_module_init, "init_task", WFX_RSI_TASK_SZ, NULL, 1, + // wfxRsiInitTaskStack, &busInitTaskStruct); + + if (NULL == wfx_rsi.init_task) + { + WFX_RSI_LOG("%s: error: failed to create task.", __func__); + } // Initialize the CHIP BleLayer. err = BleLayer::Init(this, this, &DeviceLayer::SystemLayer()); SuccessOrExit(err); + return err; + + ble_rsi_task(); memset(mBleConnections, 0, sizeof(mBleConnections)); memset(mIndConfId, kUnusedIndex, sizeof(mIndConfId)); mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; // 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 (mS) - false, // no timer reload (==one-shot) - (void *) this, // init timer id = ble obj context - BleAdvTimeoutHandler // timer callback handler + sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer", // Just a text name, not used by the RTOS kernel + BLE__DEFAULT_TIMER_PERIOD, // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = ble obj context + BleAdvTimeoutHandler // timer callback handler ); mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); @@ -135,6 +230,7 @@ CHIP_ERROR BLEManagerImpl::_Init() PlatformMgr().ScheduleWork(DriveBLEState, 0); exit: + ChipLogProgress(DeviceLayer, "%s END ", __func__); return err; } @@ -198,14 +294,18 @@ CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize) CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName) { + ChipLogProgress(DeviceLayer, "_SetDeviceName Started"); + rsi_bt_set_local_name((uint8_t *) RSI_BLE_DEV_NAME); if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported) { + ChipLogProgress(DeviceLayer, "_SetDeviceName CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE"); return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } if (deviceName != NULL && deviceName[0] != 0) { if (strlen(deviceName) >= kMaxDeviceNameLength) { + ChipLogProgress(DeviceLayer, "_SetDeviceName CHIP_ERROR_INVALID_ARGUMENT"); return CHIP_ERROR_INVALID_ARGUMENT; } strcpy(mDeviceName, deviceName); @@ -218,6 +318,7 @@ CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName) mDeviceName[0] = 0; } PlatformMgr().ScheduleWork(DriveBLEState, 0); + ChipLogProgress(DeviceLayer, "_SetDeviceName Ended"); return CHIP_NO_ERROR; } @@ -281,19 +382,19 @@ bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, cons bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId) { CHIP_ERROR err = CHIP_NO_ERROR; - sl_status_t ret; + // int32_t ret; ChipLogProgress(DeviceLayer, "Closing BLE GATT connection (con %u)", conId); - ret = sl_bt_connection_close(conId); - err = MapBLEError(ret); + // ret = rsi_ble_disconnect(1); + // err = MapBLEError(ret); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "sl_bt_connection_close() failed: %s", ErrorStr(err)); } - return (err == CHIP_NO_ERROR); + return true; //(err == CHIP_NO_ERROR); } uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const @@ -305,26 +406,13 @@ uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, PacketBufferHandle data) { - CHIP_ERROR err = CHIP_NO_ERROR; - CHIPoBLEConState * conState = GetConnectionState(conId); - sl_status_t ret; - uint16_t cId = (UUIDsMatch(&ChipUUID_CHIPoBLEChar_RX, charId) ? gattdb_CHIPoBLEChar_Rx : gattdb_CHIPoBLEChar_Tx); - uint8_t timerHandle = GetTimerHandle(conId, true); - - VerifyOrExit(((conState != NULL) && (conState->subscribed != 0)), err = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(timerHandle != kMaxConnections, err = CHIP_ERROR_NO_MEMORY); - - // start timer for light indication confirmation. Long delay for spake2 indication - sl_bt_system_set_lazy_soft_timer(TIMER_S_2_TIMERTICK(6), 0, timerHandle, true); - - ret = sl_bt_gatt_server_send_indication(conId, cId, (data->DataLength()), data->Start()); - err = MapBLEError(ret); - -exit: - if (err != CHIP_NO_ERROR) + int32_t status = 0; + WFX_RSI_LOG("In send indication"); + status = rsi_ble_indicate_value(event_msg.resp_enh_conn.dev_addr, event_msg.rsi_ble_measurement_hndl, (data->DataLength()), + data->Start()); + if (status != RSI_SUCCESS) { - ChipLogError(DeviceLayer, "BLEManagerImpl::SendIndication() failed: %s", ErrorStr(err)); - return false; + WFX_RSI_LOG("indication %d failed with error code %lx ", status); } return true; @@ -377,15 +465,20 @@ CHIP_ERROR BLEManagerImpl::MapBLEError(int bleErr) void BLEManagerImpl::DriveBLEState(void) { + + ChipLogProgress(DeviceLayer, "DriveBLEState starting"); CHIP_ERROR err = CHIP_NO_ERROR; // Check if BLE stack is initialized - VerifyOrExit(mFlags.Has(Flags::kEFRBLEStackInitialized), /* */); + // VerifyOrExit(mFlags.Has(Flags::kEFRBLEStackInitialized), /* */); + ChipLogProgress(DeviceLayer, "Start advertising if needed..."); // Start advertising if needed... if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_Enabled && mFlags.Has(Flags::kAdvertisingEnabled) && NumConnections() < kMaxConnections) { + + ChipLogProgress(DeviceLayer, "Start/re-start advertising if not already started, or if there is a pending change"); // Start/re-start advertising if not already started, or if there is a pending change // to the advertising configuration. if (!mFlags.Has(Flags::kAdvertising) || mFlags.Has(Flags::kRestartAdvertising)) @@ -403,6 +496,7 @@ void BLEManagerImpl::DriveBLEState(void) } exit: + ChipLogProgress(DeviceLayer, "DriveBLEState End"); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "Disabling CHIPoBLE service due to error: %s", ErrorStr(err)); @@ -412,21 +506,24 @@ void BLEManagerImpl::DriveBLEState(void) CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) { - sl_status_t ret; + ChipBLEDeviceIdentificationInfo mDeviceIdInfo; CHIP_ERROR err; + int32_t result; uint8_t responseData[MAX_RESPONSE_DATA_LEN]; uint8_t advData[MAX_ADV_DATA_LEN]; uint32_t index = 0; uint32_t mDeviceNameLength = 0; uint8_t mDeviceIdInfoLength = 0; + err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(mDeviceIdInfo); + + ChipLogProgress(DeviceLayer, "ConfigureAdvertisingData start"); VerifyOrExit((kMaxDeviceNameLength + 1) < UINT8_MAX, err = CHIP_ERROR_INVALID_ARGUMENT); memset(responseData, 0, MAX_RESPONSE_DATA_LEN); memset(advData, 0, MAX_ADV_DATA_LEN); - err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(mDeviceIdInfo); SuccessOrExit(err); if (!mFlags.Has(Flags::kDeviceNameSet)) @@ -457,154 +554,125 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) advData[index++] = CHIP_ADV_DATA_TYPE_SERVICE_DATA; // AD type : Service Data advData[index++] = ShortUUID_CHIPoBLEService[0]; // AD value advData[index++] = ShortUUID_CHIPoBLEService[1]; - memcpy(&advData[index], (void *) &mDeviceIdInfo, mDeviceIdInfoLength); // AD value - index += mDeviceIdInfoLength; -#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - ReturnErrorOnFailure(EncodeAdditionalDataTlv()); -#endif + // TODO:: replace the hardcoded values by calling the GetBLEDeviceIdentificationInfo + advData[index++] = 0; // OpCode + advData[index++] = 0; // DeviceDiscriminatorAndAdvVersion [] + advData[index++] = 15; // DeviceDiscriminatorAndAdvVersion [] + advData[index++] = 241; // DeviceVendorId [] + advData[index++] = 255; // DeviceVendorId [] + advData[index++] = 5; // DeviceProductId[] + advData[index++] = 128; // DeviceProductId[] + advData[index++] = 0; // AdditionalDataFlag - if (0xff != advertising_set_handle) - { - sl_bt_advertiser_delete_set(advertising_set_handle); - advertising_set_handle = 0xff; - } + //! prepare advertise data //local/device name + advData[index++] = strlen(RSI_BLE_DEV_NAME) + 1; + advData[index++] = 9; - ret = sl_bt_advertiser_create_set(&advertising_set_handle); - if (ret != SL_STATUS_OK) - { - err = MapBLEError(ret); - ChipLogError(DeviceLayer, "sl_bt_advertiser_create_set() failed: %s", ErrorStr(err)); - ExitNow(); - } + memcpy(&advData[index], RSI_BLE_DEV_NAME, strlen(RSI_BLE_DEV_NAME)); // AD value + index += strlen(RSI_BLE_DEV_NAME); - ret = sl_bt_legacy_advertiser_set_data(advertising_set_handle, sl_bt_advertiser_advertising_data_packet, index, - (uint8_t *) advData); +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + ReturnErrorOnFailure(EncodeAdditionalDataTlv()); +#endif - if (ret != SL_STATUS_OK) + result = rsi_ble_set_advertise_data(advData, index); + if (result != SL_STATUS_OK) { - err = MapBLEError(ret); - ChipLogError(DeviceLayer, "sl_bt_legacy_advertiser_set_data() - Advertising Data failed: %s", ErrorStr(err)); + err = MapBLEError(result); + ChipLogError(DeviceLayer, "rsi_ble_set_advertise_data() failed: %ld", result); ExitNow(); } - - index = 0; - - responseData[index++] = CHIP_ADV_SHORT_UUID_LEN + 1; // AD length - responseData[index++] = CHIP_ADV_DATA_TYPE_UUID; // AD type : uuid - responseData[index++] = ShortUUID_CHIPoBLEService[0]; // AD value - responseData[index++] = ShortUUID_CHIPoBLEService[1]; - - responseData[index++] = static_cast(mDeviceNameLength + 1); // length - responseData[index++] = CHIP_ADV_DATA_TYPE_NAME; // AD type : name - memcpy(&responseData[index], mDeviceName, mDeviceNameLength); // AD value - index += mDeviceNameLength; - - ret = sl_bt_legacy_advertiser_set_data(advertising_set_handle, sl_bt_advertiser_scan_response_packet, index, - (uint8_t *) responseData); - - if (ret != SL_STATUS_OK) + else { - err = MapBLEError(ret); - ChipLogError(DeviceLayer, "sl_bt_legacy_advertiser_set_data() - Scan Response failed: %s", ErrorStr(err)); - ExitNow(); + ChipLogError(DeviceLayer, "rsi_ble_set_advertise_data() success: %ld", result); } - err = MapBLEError(ret); + err = MapBLEError(result); + ChipLogProgress(DeviceLayer, "ConfigureAdvertisingData End"); exit: - return err; + return CHIP_NO_ERROR; } CHIP_ERROR BLEManagerImpl::StartAdvertising(void) { CHIP_ERROR err; - sl_status_t ret; - uint32_t interval_min; - uint32_t interval_max; - uint16_t numConnectionss = NumConnections(); - uint8_t connectableAdv = - (numConnectionss < kMaxConnections) ? sl_bt_advertiser_connectable_scannable : sl_bt_advertiser_scannable_non_connectable; + int32_t status = 0; + + ChipLogProgress(DeviceLayer, "StartAdvertising start"); // If already advertising, stop it, before changing values if (mFlags.Has(Flags::kAdvertising)) { - sl_bt_advertiser_stop(advertising_set_handle); + // sl_bt_advertiser_stop(advertising_set_handle); } else { ChipLogDetail(DeviceLayer, "Start BLE advertissement"); } - const uint8_t kResolvableRandomAddrType = 2; // Private resolvable random address type - bd_addr unusedBdAddr; // We can ignore this field when setting random address. - sl_bt_advertiser_set_random_address(advertising_set_handle, kResolvableRandomAddrType, unusedBdAddr, &unusedBdAddr); - (void) unusedBdAddr; + // bd_addr unusedBdAddr; // We can ignore this field when setting random address. + + // (void) unusedBdAddr; err = ConfigureAdvertisingData(); SuccessOrExit(err); mFlags.Clear(Flags::kRestartAdvertising); - if (mFlags.Has(Flags::kFastAdvertisingEnabled)) - { - interval_min = CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN; - interval_max = CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX; - } - else - { - interval_min = CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN; - interval_max = CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX; - } + sl_wfx_mac_address_t macaddr; + wfx_get_wifi_mac_addr(SL_WFX_STA_INTERFACE, &macaddr); - ret = sl_bt_advertiser_set_timing(advertising_set_handle, interval_min, interval_max, 0, 0); - err = MapBLEError(ret); - SuccessOrExit(err); - - sl_bt_advertiser_configure(advertising_set_handle, 1); - ret = sl_bt_legacy_advertiser_start(advertising_set_handle, connectableAdv); - - if (SL_STATUS_OK == ret) + //! Set local name + status = rsi_ble_start_advertising(); + if (status == RSI_SUCCESS) { + ChipLogProgress(DeviceLayer, "rsi_ble_start_advertising Success"); + if (mFlags.Has(Flags::kFastAdvertisingEnabled)) { StartBleAdvTimeoutTimer(CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME); } mFlags.Set(Flags::kAdvertising); } - - err = MapBLEError(ret); + else + { + ChipLogProgress(DeviceLayer, "rsi_ble_start_advertising Failed with status: %lx", status); + } exit: - return err; + ChipLogError(DeviceLayer, "StartAdvertising() End error: %s", ErrorStr(err)); + return CHIP_NO_ERROR; // err; } +// TODO:: Implementation need to be done. CHIP_ERROR BLEManagerImpl::StopAdvertising(void) { CHIP_ERROR err = CHIP_NO_ERROR; - sl_status_t ret; + // sl_status_t ret; if (mFlags.Has(Flags::kAdvertising)) { mFlags.Clear(Flags::kAdvertising).Clear(Flags::kRestartAdvertising); mFlags.Set(Flags::kFastAdvertisingEnabled, true); - ret = sl_bt_advertiser_stop(advertising_set_handle); - sl_bt_advertiser_delete_set(advertising_set_handle); + // ret = sl_bt_advertiser_stop(advertising_set_handle); + // sl_bt_advertiser_delete_set(advertising_set_handle); advertising_set_handle = 0xff; - err = MapBLEError(ret); - SuccessOrExit(err); + // err = MapBLEError(ret); + // SuccessOrExit(err); CancelBleAdvTimeoutTimer(); } -exit: + // exit: return err; } -void BLEManagerImpl::UpdateMtu(volatile sl_bt_msg_t * evt) +void BLEManagerImpl::UpdateMtu(rsi_ble_event_mtu_t evt) { - CHIPoBLEConState * bleConnState = GetConnectionState(evt->data.evt_gatt_mtu_exchanged.connection); + CHIPoBLEConState * bleConnState = GetConnectionState(event_msg.connectionHandle); if (bleConnState != NULL) { // bleConnState->MTU is a 10-bit field inside a uint16_t. We're @@ -616,9 +684,10 @@ void BLEManagerImpl::UpdateMtu(volatile sl_bt_msg_t * evt) // TODO: https://github.com/project-chip/connectedhomeip/issues/2569 // tracks making this safe with a check or explaining why no check // is needed. + ChipLogProgress(DeviceLayer, "DriveBLEState UpdateMtu %d", evt.mtu_size); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" - bleConnState->mtu = evt->data.evt_gatt_mtu_exchanged.mtu; + bleConnState->mtu = evt.mtu_size; #pragma GCC diagnostic pop ; } @@ -630,23 +699,18 @@ void BLEManagerImpl::HandleBootEvent(void) PlatformMgr().ScheduleWork(DriveBLEState, 0); } -void BLEManagerImpl::HandleConnectEvent(volatile sl_bt_msg_t * evt) +void BLEManagerImpl::HandleConnectEvent(void) { - sl_bt_evt_connection_opened_t * conn_evt = (sl_bt_evt_connection_opened_t *) &(evt->data); - uint8_t connHandle = conn_evt->connection; - uint8_t bondingHandle = conn_evt->bonding; - - ChipLogProgress(DeviceLayer, "Connect Event for handle : %d", connHandle); - - AddConnection(connHandle, bondingHandle); + ChipLogProgress(DeviceLayer, "Connect Event for handle : %d", event_msg.connectionHandle); + AddConnection(event_msg.connectionHandle, event_msg.bondingHandle); PlatformMgr().ScheduleWork(DriveBLEState, 0); } -void BLEManagerImpl::HandleConnectionCloseEvent(volatile sl_bt_msg_t * evt) +// TODO:: Implementation need to be done. +void BLEManagerImpl::HandleConnectionCloseEvent(uint16_t reason) { - sl_bt_evt_connection_closed_t * conn_evt = (sl_bt_evt_connection_closed_t *) &(evt->data); - uint8_t connHandle = conn_evt->connection; + uint8_t connHandle = 1; ChipLogProgress(DeviceLayer, "Disconnect Event for handle : %d", connHandle); @@ -656,24 +720,19 @@ void BLEManagerImpl::HandleConnectionCloseEvent(volatile sl_bt_msg_t * evt) event.Type = DeviceEventType::kCHIPoBLEConnectionError; event.CHIPoBLEConnectionError.ConId = connHandle; - switch (conn_evt->reason) - { - case SL_STATUS_BT_CTRL_REMOTE_USER_TERMINATED: - case SL_STATUS_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES: - case SL_STATUS_BT_CTRL_REMOTE_POWERING_OFF: - event.CHIPoBLEConnectionError.Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED; - break; - - case SL_STATUS_BT_CTRL_CONNECTION_TERMINATED_BY_LOCAL_HOST: - event.CHIPoBLEConnectionError.Reason = BLE_ERROR_APP_CLOSED_CONNECTION; - break; - - default: - event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; - break; - } + // switch (reason) + // { + // + // case RSI_REMOTE_DEV_TERMINATE_CONN: + // case RSI_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES: + // case RSI_BT_CTRL_REMOTE_POWERING_OFF: + // event.CHIPoBLEConnectionError.Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED; + // break; + // default: + // event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; + // } - ChipLogProgress(DeviceLayer, "BLE GATT connection closed (con %u, reason %u)", connHandle, conn_evt->reason); + // ChipLogProgress(DeviceLayer, "BLE GATT connection closed (con %u, reason %u)", connHandle, conn_evt->reason); PlatformMgr().PostEventOrDie(&event); @@ -685,84 +744,61 @@ void BLEManagerImpl::HandleConnectionCloseEvent(volatile sl_bt_msg_t * evt) } } -void BLEManagerImpl::HandleWriteEvent(volatile sl_bt_msg_t * evt) +void BLEManagerImpl::HandleWriteEvent(rsi_ble_event_write_t evt) { - uint16_t attribute = evt->data.evt_gatt_server_user_write_request.characteristic; + // RSI_BLE_WRITE_REQUEST_EVENT + ChipLogProgress(DeviceLayer, "Char Write Req, packet type %d", evt.pkt_type); + uint8_t attribute = (uint8_t) event_msg.rsi_ble_measurement_hndl; - ChipLogProgress(DeviceLayer, "Char Write Req, char : %d", attribute); + WFX_RSI_LOG("attribute = %d,rsi_ble_measurement_hndl = %d", attribute, event_msg.rsi_ble_measurement_hndl); - if (gattdb_CHIPoBLEChar_Rx == attribute) + if (evt.handle[0] == (uint8_t) event_msg.rsi_ble_gatt_server_client_config_hndl) // TODO:: compare the handle exactly { - HandleRXCharWrite(evt); + WFX_RSI_LOG("Inside HandleTXCharCCCDWrite "); + HandleTXCharCCCDWrite(&evt); + } + else + { + HandleRXCharWrite(&evt); } } -void BLEManagerImpl::HandleTXCharCCCDWrite(volatile sl_bt_msg_t * evt) +void BLEManagerImpl::HandleTXCharCCCDWrite(rsi_ble_event_write_t * evt) { CHIP_ERROR err = CHIP_NO_ERROR; - CHIPoBLEConState * bleConnState; - bool isIndicationEnabled = false; ChipDeviceEvent event; - - bleConnState = GetConnectionState(evt->data.evt_gatt_server_user_write_request.connection); - VerifyOrExit(bleConnState != NULL, err = CHIP_ERROR_NO_MEMORY); - - // Determine if the client is enabling or disabling notification/indication. - isIndicationEnabled = (evt->data.evt_gatt_server_characteristic_status.client_config_flags == sl_bt_gatt_indication); - - ChipLogProgress(DeviceLayer, "HandleTXcharCCCDWrite - Config Flags value : %d", - evt->data.evt_gatt_server_characteristic_status.client_config_flags); - ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", isIndicationEnabled ? "subscribe" : "unsubscribe"); - - if (isIndicationEnabled) - { - // If indications are not already enabled for the connection... - if (!bleConnState->subscribed) - { - bleConnState->subscribed = 1; - // Post an event to the CHIP queue to process either a CHIPoBLE Subscribe or Unsubscribe based on - // whether the client is enabling or disabling indications. - { - event.Type = DeviceEventType::kCHIPoBLESubscribe; - event.CHIPoBLESubscribe.ConId = evt->data.evt_gatt_server_user_write_request.connection; - err = PlatformMgr().PostEvent(&event); - } - } - } - else + // whether the client is enabling or disabling indications. { - bleConnState->subscribed = 0; - event.Type = DeviceEventType::kCHIPoBLEUnsubscribe; - event.CHIPoBLESubscribe.ConId = evt->data.evt_gatt_server_user_write_request.connection; + event.Type = DeviceEventType::kCHIPoBLESubscribe; + event.CHIPoBLESubscribe.ConId = 1; err = PlatformMgr().PostEvent(&event); } - -exit: - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "HandleTXCharCCCDWrite() failed: %s", ErrorStr(err)); - } } -void BLEManagerImpl::HandleRXCharWrite(volatile sl_bt_msg_t * evt) +void BLEManagerImpl::HandleRXCharWrite(rsi_ble_event_write_t * evt) { + uint8_t conId = 1; CHIP_ERROR err = CHIP_NO_ERROR; System::PacketBufferHandle buf; - uint16_t writeLen = evt->data.evt_gatt_server_user_write_request.value.len; - uint8_t * data = (uint8_t *) evt->data.evt_gatt_server_user_write_request.value.data; + uint16_t writeLen = evt->length; + uint8_t * data = (uint8_t *) evt->att_value; + + for (int i = 0; i < evt->length; i++) + { + ChipLogDetail(DeviceLayer, "HandleRXCharWrite value : %d", evt->att_value[i]); + } // Copy the data to a packet buffer. buf = System::PacketBufferHandle::NewWithData(data, writeLen, 0, 0); VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY); - ChipLogDetail(DeviceLayer, "Write request/command received for CHIPoBLE RX characteristic (con %u, len %u)", - evt->data.evt_gatt_server_user_write_request.connection, buf->DataLength()); + ChipLogDetail(DeviceLayer, "Write request/command received for CHIPoBLE RX characteristic ( len %d)", writeLen); // Post an event to the CHIP queue to deliver the data into the CHIP stack. { ChipDeviceEvent event; event.Type = DeviceEventType::kCHIPoBLEWriteReceived; - event.CHIPoBLEWriteReceived.ConId = evt->data.evt_gatt_server_user_write_request.connection; + event.CHIPoBLEWriteReceived.ConId = conId; event.CHIPoBLEWriteReceived.Data = std::move(buf).UnsafeRelease(); err = PlatformMgr().PostEvent(&event); } @@ -777,36 +813,38 @@ void BLEManagerImpl::HandleRXCharWrite(volatile sl_bt_msg_t * evt) void BLEManagerImpl::HandleTxConfirmationEvent(BLE_CONNECTION_OBJECT conId) { ChipDeviceEvent event; - uint8_t timerHandle = sInstance.GetTimerHandle(conId, false); - - ChipLogProgress(DeviceLayer, "Tx Confirmation received"); - - // stop indication confirmation timer - if (timerHandle < kMaxConnections) - { - ChipLogProgress(DeviceLayer, " stop soft timer"); - sl_bt_system_set_lazy_soft_timer(0, 0, timerHandle, false); - } + // uint8_t timerHandle = sInstance.GetTimerHandle(conId, false); + // + // ChipLogProgress(DeviceLayer, "Tx Confirmation received"); + // + // // stop indication confirmation timer // TODO:: Need to find the proper repleacement + // if (timerHandle < kMaxConnections) + // { + // ChipLogProgress(DeviceLayer, " stop soft timer"); + // // sl_bt_system_set_lazy_soft_timer(0, 0, timerHandle, false); + // } event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; event.CHIPoBLEIndicateConfirm.ConId = conId; PlatformMgr().PostEventOrDie(&event); } -void BLEManagerImpl::HandleSoftTimerEvent(volatile sl_bt_msg_t * evt) +// TODO:: Need to Implement +void BLEManagerImpl::HandleSoftTimerEvent(void) { + // BLE Manager starts soft timers with timer handles less than kMaxConnections // If we receive a callback for unknown timer handle ignore this. - if (evt->data.evt_system_soft_timer.handle < kMaxConnections) - { - ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); - ChipDeviceEvent event; - event.Type = DeviceEventType::kCHIPoBLEConnectionError; - event.CHIPoBLEConnectionError.ConId = mIndConfId[evt->data.evt_system_soft_timer.handle]; - sInstance.mIndConfId[evt->data.evt_system_soft_timer.handle] = kUnusedIndex; - event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; - PlatformMgr().PostEventOrDie(&event); - } + // if (evt->data.evt_system_soft_timer.handle < kMaxConnections) + // { + // ChipLogProgress(DeviceLayer, "BLEManagerImpl::HandleSoftTimerEvent CHIPOBLE_PROTOCOL_ABORT"); + // ChipDeviceEvent event; + // event.Type = DeviceEventType::kCHIPoBLEConnectionError; + // event.CHIPoBLEConnectionError.ConId = mIndConfId[evt->data.evt_system_soft_timer.handle]; + // sInstance.mIndConfId[evt->data.evt_system_soft_timer.handle] = kUnusedIndex; + // event.CHIPoBLEConnectionError.Reason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; + // PlatformMgr().PostEventOrDie(&event); + // } } bool BLEManagerImpl::RemoveConnection(uint8_t connectionHandle) @@ -900,19 +938,20 @@ CHIP_ERROR BLEManagerImpl::EncodeAdditionalDataTlv() return err; } -void BLEManagerImpl::HandleC3ReadRequest(volatile sl_bt_msg_t * evt) +// TODO:: Need the +void BLEManagerImpl::HandleC3ReadRequest(void) { - sl_bt_evt_gatt_server_user_read_request_t * readReq = - (sl_bt_evt_gatt_server_user_read_request_t *) &(evt->data.evt_gatt_server_user_read_request); - ChipLogDetail(DeviceLayer, "Read request received for CHIPoBLEChar_C3 - opcode:%d", readReq->att_opcode); - sl_status_t ret = sl_bt_gatt_server_send_user_read_response(readReq->connection, readReq->characteristic, 0, - sInstance.c3AdditionalDataBufferHandle->DataLength(), - sInstance.c3AdditionalDataBufferHandle->Start(), nullptr); - - if (ret != SL_STATUS_OK) - { - ChipLogDetail(DeviceLayer, "Failed to send read response, err:%ld", ret); - } + // sl_bt_evt_gatt_server_user_read_request_t * readReq = + // (sl_bt_evt_gatt_server_user_read_request_t *) &(evt->data.evt_gatt_server_user_read_request); + // ChipLogDetail(DeviceLayer, "Read request received for CHIPoBLEChar_C3 - opcode:%d", readReq->att_opcode); + // sl_status_t ret = sl_bt_gatt_server_send_user_read_response(readReq->connection, readReq->characteristic, 0, + // sInstance.c3AdditionalDataBufferHandle->DataLength(), + // sInstance.c3AdditionalDataBufferHandle->Start(), nullptr); + + // if (ret != SL_STATUS_OK) + // { + // ChipLogDetail(DeviceLayer, "Failed to send read response, err:%ld", ret); + // } } #endif // CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING @@ -989,105 +1028,4 @@ void BLEManagerImpl::DriveBLEState(intptr_t arg) } // namespace DeviceLayer } // namespace chip -extern "C" void sl_bt_on_event(sl_bt_msg_t * evt) -{ - // As this is running in a separate thread, we need to block CHIP from operating, - // until the events are handled. - chip::DeviceLayer::PlatformMgr().LockChipStack(); - - // handle bluetooth events - switch (SL_BT_MSG_ID(evt->header)) - { - case sl_bt_evt_system_boot_id: { - ChipLogProgress(DeviceLayer, "Bluetooth stack booted: v%d.%d.%d-b%d", evt->data.evt_system_boot.major, - evt->data.evt_system_boot.minor, evt->data.evt_system_boot.patch, evt->data.evt_system_boot.build); - chip::DeviceLayer::Internal::BLEMgrImpl().HandleBootEvent(); - - RAIL_Version_t railVer; - RAIL_GetVersion(&railVer, true); - ChipLogProgress(DeviceLayer, "RAIL version:, v%d.%d.%d-b%d", railVer.major, railVer.minor, railVer.rev, railVer.build); - sl_bt_connection_set_default_parameters(BLE_CONFIG_MIN_INTERVAL, BLE_CONFIG_MAX_INTERVAL, BLE_CONFIG_LATENCY, - BLE_CONFIG_TIMEOUT, BLE_CONFIG_MIN_CE_LENGTH, BLE_CONFIG_MAX_CE_LENGTH); - } - break; - - case sl_bt_evt_connection_opened_id: { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleConnectEvent(evt); - } - break; - case sl_bt_evt_connection_parameters_id: { - // ChipLogProgress(DeviceLayer, "Connection parameter ID received"); - } - break; - case sl_bt_evt_connection_phy_status_id: { - // ChipLogProgress(DeviceLayer, "PHY update procedure is completed"); - } - break; - case sl_bt_evt_connection_closed_id: { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleConnectionCloseEvent(evt); - } - break; - - /* This event indicates that a remote GATT client is attempting to write a value of an - * attribute in to the local GATT database, where the attribute was defined in the GATT - * XML firmware configuration file to have type="user". */ - case sl_bt_evt_gatt_server_attribute_value_id: { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleWriteEvent(evt); - } - break; - - case sl_bt_evt_gatt_mtu_exchanged_id: { - chip::DeviceLayer::Internal::BLEMgrImpl().UpdateMtu(evt); - } - break; - - // confirmation of indication received from remote GATT client - case sl_bt_evt_gatt_server_characteristic_status_id: { - sl_bt_gatt_server_characteristic_status_flag_t StatusFlags; - - StatusFlags = (sl_bt_gatt_server_characteristic_status_flag_t) evt->data.evt_gatt_server_characteristic_status.status_flags; - - if (sl_bt_gatt_server_confirmation == StatusFlags) - { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleTxConfirmationEvent( - evt->data.evt_gatt_server_characteristic_status.connection); - } - else if ((evt->data.evt_gatt_server_characteristic_status.characteristic == gattdb_CHIPoBLEChar_Tx) && - (evt->data.evt_gatt_server_characteristic_status.status_flags == gatt_server_client_config)) - { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleTXCharCCCDWrite(evt); - } - } - break; - - /* Software Timer event */ - case sl_bt_evt_system_soft_timer_id: { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleSoftTimerEvent(evt); - } - break; - - case sl_bt_evt_gatt_server_user_read_request_id: { - ChipLogProgress(DeviceLayer, "GATT server user_read_request"); -#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - if (evt->data.evt_gatt_server_user_read_request.characteristic == gattdb_CHIPoBLEChar_C3) - { - chip::DeviceLayer::Internal::BLEMgrImpl().HandleC3ReadRequest(evt); - } -#endif // CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - } - break; - - case sl_bt_evt_connection_remote_used_features_id: { - // ChipLogProgress(DeviceLayer, "link layer features supported by the remote device"); - } - break; - - default: - ChipLogProgress(DeviceLayer, "evt_UNKNOWN id = %08" PRIx32, SL_BT_MSG_ID(evt->header)); - break; - } - - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); -} - #endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/src/platform/silabs/SiWx917/BUILD.gn b/src/platform/silabs/SiWx917/BUILD.gn index b67c63c486a719..4026e1cd40c8f4 100644 --- a/src/platform/silabs/SiWx917/BUILD.gn +++ b/src/platform/silabs/SiWx917/BUILD.gn @@ -22,17 +22,13 @@ import("${chip_root}/src/crypto/crypto.gni") silabs_platform_dir = "${chip_root}/src/platform/silabs" -assert(chip_device_platform == "efr32") +assert(chip_device_platform == "SiWx917") if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } -if (chip_crypto == "platform") { - import("//build_overrides/mbedtls.gni") -} - -static_library("EFR32") { +static_library("SiWx917") { sources = [ "${silabs_platform_dir}/BLEManagerImpl.h", "${silabs_platform_dir}/BlePlatformConfig.h", @@ -57,33 +53,21 @@ static_library("EFR32") { "ConfigurationManagerImpl.cpp", "KeyValueStoreManagerImpl.cpp", "PlatformManagerImpl.cpp", + "bluetooth/rsi_ble_config.h", + "bluetooth/wfx_sl_ble_init.c", + "bluetooth/wfx_sl_ble_init.h", ] + # TODO: OTA on CCP platform if (chip_enable_ota_requestor) { sources += [ - "OTAImageProcessorImpl.cpp", - "OTAImageProcessorImpl.h", + #"OTAImageProcessorImpl.cpp", + #"OTAImageProcessorImpl.h", ] } public_deps = [ "${chip_root}/src/platform:platform_base" ] - # Add platform crypto implementation - if (chip_crypto == "platform") { - sources += [ - "CHIPCryptoPALPsaEfr32.cpp", - "Efr32OpaqueKeypair.h", - "Efr32PsaOpaqueKeypair.cpp", - "Efr32PsaOperationalKeystore.cpp", - "Efr32PsaOperationalKeystore.h", - ] - - public_deps += [ - "${chip_root}/src/crypto", - "${mbedtls_root}:mbedtls", - ] - } - # Add pigweed KVS deps = [ "$dir_pw_kvs:crc16", @@ -93,27 +77,6 @@ static_library("EFR32") { "$dir_pw_checksum", "$dir_pw_kvs", ] - if (chip_enable_openthread) { - public_deps += [ "${chip_root}/third_party/openthread:openthread" ] - - deps += [ "${chip_root}/third_party/openthread:openthread_cli" ] - - sources += [ - "${silabs_platform_dir}/ThreadStackManagerImpl.h", - "../../OpenThread/OpenThreadUtils.cpp", - "ConnectivityManagerImpl.cpp", - "ThreadStackManagerImpl.cpp", - ] - - if (chip_mdns == "platform") { - sources += [ "../../OpenThread/DnssdImpl.cpp" ] - deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] - } - - public_configs = [ - "${chip_root}/src/lib/address_resolve:default_address_resolve_config", - ] - } if (chip_enable_wifi) { sources += [ diff --git a/src/platform/silabs/SiWx917/CHIPCryptoPALPsaEfr32.cpp b/src/platform/silabs/SiWx917/CHIPCryptoPALPsaEfr32.cpp deleted file mode 100644 index 13af1ae5a557b6..00000000000000 --- a/src/platform/silabs/SiWx917/CHIPCryptoPALPsaEfr32.cpp +++ /dev/null @@ -1,1879 +0,0 @@ -/* - * - * Copyright (c) 2020-2022 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * PSA Crypto API based implementation of CHIP crypto primitives - * with Silicon Labs SDK modifications - */ - -#include - -#include - -// Include version header to get configuration information -#include - -#if !defined(MBEDTLS_PSA_CRYPTO_C) -#error "This implementation needs PSA Crypto" -#endif - -#if !defined(MBEDTLS_USE_PSA_CRYPTO) -#error "This implementation requires that PSA Crypto keys can be used for CSR generation" -#endif - -#include "psa/crypto.h" - -// Go straight for the driver wrappers for speed on plaintext keys -extern "C" { -#include "psa_crypto_core.h" -#include "psa_crypto_driver_wrappers.h" -} - -// Includes needed for SPAKE2+ ECP operations -#include -#include - -// Includes needed for certificate parsing -#if defined(MBEDTLS_X509_CRT_PARSE_C) -#include -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) -#include -#include -#include - -#if defined(MBEDTLS_ERROR_C) -#include -#endif // defined(MBEDTLS_ERROR_C) - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace chip { -namespace Crypto { - -using chip::Platform::MemoryCalloc; -using chip::Platform::MemoryFree; - -#define MAX_ERROR_STR_LEN 128 -#define NUM_BYTES_IN_SHA256_HASH 32 - -// In mbedTLS 3.0.0 direct access to structure fields was replaced with using MBEDTLS_PRIVATE macro. -#if (MBEDTLS_VERSION_NUMBER >= 0x03000000) -#define CHIP_CRYPTO_PAL_PRIVATE(x) MBEDTLS_PRIVATE(x) -#else -#define CHIP_CRYPTO_PAL_PRIVATE(x) x -#endif - -#if (MBEDTLS_VERSION_NUMBER >= 0x03000000 && MBEDTLS_VERSION_NUMBER < 0x03010000) -#define CHIP_CRYPTO_PAL_PRIVATE_X509(x) MBEDTLS_PRIVATE(x) -#else -#define CHIP_CRYPTO_PAL_PRIVATE_X509(x) x -#endif - -static void _log_mbedTLS_error(int error_code) -{ - if (error_code != 0) - { -#if defined(MBEDTLS_ERROR_C) - char error_str[MAX_ERROR_STR_LEN]; - mbedtls_strerror(error_code, error_str, sizeof(error_str)); - ChipLogError(Crypto, "mbedTLS error: %s", error_str); -#else - // Error codes defined in 16-bit negative hex numbers. Ease lookup by printing likewise - ChipLogError(Crypto, "mbedTLS error: -0x%04X", -static_cast(error_code)); -#endif - } -} - -static void _log_PSA_error(psa_status_t status) -{ - if (status != 0) - { - // Error codes defined in 16-bit negative hex numbers. Ease lookup by printing likewise - ChipLogError(Crypto, "PSA error: %ld", status); - } -} - -static bool _isValidTagLength(size_t tag_length) -{ - if (tag_length == 8 || tag_length == 12 || tag_length == 16) - { - return true; - } - return false; -} - -/** - * @brief Compare two times - * - * @param t1 First time to compare - * @param t2 Second time to compare - * @return int 0 If both times are idential to the second, -1 if t1 < t2, 1 if t1 > t2. - */ -static int timeCompare(mbedtls_x509_time * t1, mbedtls_x509_time * t2) -{ - VerifyOrReturnValue(t1->year >= t2->year, -1); - VerifyOrReturnValue(t1->year <= t2->year, 1); - // Same year - VerifyOrReturnValue(t1->mon >= t2->mon, -1); - VerifyOrReturnValue(t1->mon <= t2->mon, 1); - // Same month - VerifyOrReturnValue(t1->day >= t2->day, -1); - VerifyOrReturnValue(t1->day <= t2->day, 1); - // Same day - VerifyOrReturnValue(t1->hour >= t2->hour, -1); - VerifyOrReturnValue(t1->hour <= t2->hour, 1); - // Same hour - VerifyOrReturnValue(t1->min >= t2->min, -1); - VerifyOrReturnValue(t1->min <= t2->min, 1); - // Same minute - VerifyOrReturnValue(t1->sec >= t2->sec, -1); - VerifyOrReturnValue(t1->sec <= t2->sec, 1); - // Same second - return 0; -} - -CHIP_ERROR AES_CCM_encrypt(const uint8_t * plaintext, size_t plaintext_length, const uint8_t * aad, size_t aad_length, - const uint8_t * key, size_t key_length, const uint8_t * nonce, size_t nonce_length, uint8_t * ciphertext, - uint8_t * tag, size_t tag_length) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - size_t output_length = 0; - uint8_t * buffer = nullptr; - bool allocated_buffer = false; - - VerifyOrExit(_isValidTagLength(tag_length), error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(key_length == kAES_CCM128_Key_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(key != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(key_length == kAES_CCM128_Key_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(nonce != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(nonce_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(CanCastTo(nonce_length), error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(tag != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - - // If the ciphertext and tag outputs aren't a contiguous buffer, the PSA API requires buffer copying - if (Uint8::to_uchar(ciphertext) + plaintext_length != Uint8::to_uchar(tag)) - { - buffer = (uint8_t *) MemoryCalloc(1, plaintext_length + tag_length); - allocated_buffer = true; - VerifyOrExit(buffer != nullptr, error = CHIP_ERROR_NO_MEMORY); - } - - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_AES); - psa_set_key_bits(&attr, key_length * 8); - psa_set_key_algorithm(&attr, PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG(PSA_ALG_CCM, 8)); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_ENCRYPT); - - status = psa_driver_wrapper_aead_encrypt( - &attr, Uint8::to_const_uchar(key), key_length, PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, tag_length), - Uint8::to_const_uchar(nonce), nonce_length, Uint8::to_const_uchar(aad), aad_length, Uint8::to_const_uchar(plaintext), - plaintext_length, allocated_buffer ? buffer : ciphertext, plaintext_length + tag_length, &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == plaintext_length + tag_length, error = CHIP_ERROR_INTERNAL); - - if (allocated_buffer) - { - memcpy(Uint8::to_uchar(ciphertext), buffer, plaintext_length); - memcpy(Uint8::to_uchar(tag), buffer + plaintext_length, tag_length); - memset(buffer, 0, plaintext_length + tag_length); - } - -exit: - if (allocated_buffer) - { - MemoryFree(buffer); - } - psa_reset_key_attributes(&attr); - return error; -} - -CHIP_ERROR AES_CCM_decrypt(const uint8_t * ciphertext, size_t ciphertext_len, const uint8_t * aad, size_t aad_len, - const uint8_t * tag, size_t tag_length, const uint8_t * key, size_t key_length, const uint8_t * nonce, - size_t nonce_length, uint8_t * plaintext) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - size_t output_length = 0; - uint8_t * buffer = nullptr; - bool allocated_buffer = false; - - VerifyOrExit(_isValidTagLength(tag_length), error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(tag != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(key != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(key_length == kAES_CCM128_Key_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(nonce != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(nonce_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); - - // If the ciphertext and tag outputs aren't a contiguous buffer, the PSA API requires buffer copying - if (Uint8::to_const_uchar(ciphertext) + ciphertext_len != Uint8::to_const_uchar(tag)) - { - buffer = (uint8_t *) MemoryCalloc(1, ciphertext_len + tag_length); - allocated_buffer = true; - VerifyOrExit(buffer != nullptr, error = CHIP_ERROR_NO_MEMORY); - } - - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_AES); - psa_set_key_bits(&attr, key_length * 8); - psa_set_key_algorithm(&attr, PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG(PSA_ALG_CCM, 8)); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_DECRYPT); - - if (allocated_buffer) - { - memcpy(buffer, ciphertext, ciphertext_len); - memcpy(buffer + ciphertext_len, tag, tag_length); - } - - status = psa_driver_wrapper_aead_decrypt( - &attr, Uint8::to_const_uchar(key), key_length, PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, tag_length), - Uint8::to_const_uchar(nonce), nonce_length, Uint8::to_const_uchar(aad), aad_len, allocated_buffer ? buffer : ciphertext, - ciphertext_len + tag_length, plaintext, ciphertext_len, &output_length); - - if (allocated_buffer) - { - memset(buffer, 0, ciphertext_len + tag_length); - } - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == ciphertext_len, error = CHIP_ERROR_INTERNAL); -exit: - if (allocated_buffer) - { - MemoryFree(buffer); - } - - psa_reset_key_attributes(&attr); - return error; -} - -CHIP_ERROR Hash_SHA256(const uint8_t * data, const size_t data_length, uint8_t * out_buffer) -{ - size_t output_length = 0; - - psa_crypto_init(); - - const psa_status_t result = - psa_hash_compute(PSA_ALG_SHA_256, data, data_length, out_buffer, PSA_HASH_LENGTH(PSA_ALG_SHA_256), &output_length); - - VerifyOrReturnError(result == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - VerifyOrReturnError(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_256), CHIP_ERROR_INTERNAL); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Hash_SHA1(const uint8_t * data, const size_t data_length, uint8_t * out_buffer) -{ - size_t output_length = 0; - - psa_crypto_init(); - - const psa_status_t result = - psa_hash_compute(PSA_ALG_SHA_1, data, data_length, out_buffer, PSA_HASH_LENGTH(PSA_ALG_SHA_1), &output_length); - - VerifyOrReturnError(result == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - VerifyOrReturnError(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_1), CHIP_ERROR_INTERNAL); - - return CHIP_NO_ERROR; -} - -static_assert(kMAX_Hash_SHA256_Context_Size >= sizeof(psa_hash_operation_t), - "kMAX_Hash_SHA256_Context_Size is too small for the size of underlying psa_hash_operation_t"); - -static inline psa_hash_operation_t * to_inner_hash_sha256_context(HashSHA256OpaqueContext * context) -{ - return SafePointerCast(context); -} - -Hash_SHA256_stream::Hash_SHA256_stream(void) -{ - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - const psa_hash_operation_t initial_context = PSA_HASH_OPERATION_INIT; - memcpy(context, &initial_context, sizeof(psa_hash_operation_t)); -} - -Hash_SHA256_stream::~Hash_SHA256_stream(void) -{ - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - psa_hash_abort(context); - Clear(); -} - -CHIP_ERROR Hash_SHA256_stream::Begin(void) -{ - psa_crypto_init(); - - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - *context = PSA_HASH_OPERATION_INIT; - const psa_status_t result = psa_hash_setup(context, PSA_ALG_SHA_256); - - VerifyOrReturnError(result == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Hash_SHA256_stream::AddData(const ByteSpan data) -{ - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - const psa_status_t result = psa_hash_update(context, Uint8::to_const_uchar(data.data()), data.size()); - - VerifyOrReturnError(result == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Hash_SHA256_stream::GetDigest(MutableByteSpan & out_buffer) -{ - CHIP_ERROR result = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - size_t output_length = 0; - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - - VerifyOrReturnError(out_buffer.size() >= kSHA256_Hash_Length, CHIP_ERROR_BUFFER_TOO_SMALL); - - // Clone the context first since calculating the digest finishes the operation - psa_hash_operation_t digest_context = PSA_HASH_OPERATION_INIT; - status = psa_hash_clone(context, &digest_context); - - VerifyOrReturnError(status == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - - // Calculate digest on the cloned context - status = psa_hash_finish(&digest_context, Uint8::to_uchar(out_buffer.data()), out_buffer.size(), &output_length); - - VerifyOrExit(status == PSA_SUCCESS, result = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_256), result = CHIP_ERROR_INTERNAL); -exit: - psa_hash_abort(&digest_context); - return result; -} - -CHIP_ERROR Hash_SHA256_stream::Finish(MutableByteSpan & out_buffer) -{ - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - size_t output_length = 0; - - VerifyOrReturnError(out_buffer.size() >= kSHA256_Hash_Length, CHIP_ERROR_BUFFER_TOO_SMALL); - const psa_status_t status = psa_hash_finish(context, Uint8::to_uchar(out_buffer.data()), out_buffer.size(), &output_length); - - VerifyOrReturnError(status == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - VerifyOrReturnError(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_256), CHIP_ERROR_INTERNAL); - - return CHIP_NO_ERROR; -} - -void Hash_SHA256_stream::Clear(void) -{ - psa_hash_operation_t * context = to_inner_hash_sha256_context(&mContext); - psa_hash_abort(context); -} - -CHIP_ERROR HKDF_sha::HKDF_SHA256(const uint8_t * secret, const size_t secret_length, const uint8_t * salt, const size_t salt_length, - const uint8_t * info, const size_t info_length, uint8_t * out_buffer, size_t out_length) -{ - VerifyOrReturnError(secret != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(secret_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - - // Salt is optional - if (salt_length > 0) - { - VerifyOrReturnError(salt != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - } - - VerifyOrReturnError(info_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(info != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_derivation_operation_t operation = PSA_KEY_DERIVATION_OPERATION_INIT; - - psa_crypto_init(); - - status = psa_key_derivation_setup(&operation, PSA_ALG_HKDF(PSA_ALG_SHA_256)); - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - - if (salt_length > 0) - { - status = - psa_key_derivation_input_bytes(&operation, PSA_KEY_DERIVATION_INPUT_SALT, Uint8::to_const_uchar(salt), salt_length); - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - } - - status = - psa_key_derivation_input_bytes(&operation, PSA_KEY_DERIVATION_INPUT_SECRET, Uint8::to_const_uchar(secret), secret_length); - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - - status = psa_key_derivation_input_bytes(&operation, PSA_KEY_DERIVATION_INPUT_INFO, Uint8::to_const_uchar(info), info_length); - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - - status = psa_key_derivation_output_bytes(&operation, out_buffer, out_length); - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); -exit: - psa_key_derivation_abort(&operation); - - return error; -} - -CHIP_ERROR HMAC_sha::HMAC_SHA256(const uint8_t * key, size_t key_length, const uint8_t * message, size_t message_length, - uint8_t * out_buffer, size_t out_length) -{ - VerifyOrReturnError(key != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(key_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(message != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(message_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_length >= kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT; - size_t output_length = 0; - - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_HMAC); - psa_set_key_bits(&attr, key_length * 8); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_HASH); - psa_set_key_algorithm(&attr, PSA_ALG_HMAC(PSA_ALG_SHA_256)); - - status = psa_driver_wrapper_mac_compute(&attr, Uint8::to_const_uchar(key), key_length, PSA_ALG_HMAC(PSA_ALG_SHA_256), - Uint8::to_const_uchar(message), message_length, out_buffer, out_length, &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_256), error = CHIP_ERROR_INTERNAL); -exit: - psa_mac_abort(&operation); - psa_reset_key_attributes(&attr); - return error; -} - -CHIP_ERROR PBKDF2_sha256::pbkdf2_sha256(const uint8_t * password, size_t plen, const uint8_t * salt, size_t slen, - unsigned int iteration_count, uint32_t key_length, uint8_t * output) -{ - // TODO: replace inlined algorithm with usage of the PSA key derivation API once implemented - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - size_t output_length = 0; - - // Align these buffers on the native data size to speed up the XOR - static const size_t hash_size_in_native = - ((PSA_HASH_LENGTH(PSA_ALG_SHA_256) + sizeof(unsigned int) - 1) / sizeof(unsigned int)); - static_assert(hash_size_in_native * sizeof(unsigned int) >= PSA_HASH_LENGTH(PSA_ALG_SHA_256)); - - unsigned int md1_buffer[hash_size_in_native]; - unsigned int work_buffer[hash_size_in_native]; - uint8_t * md1 = (uint8_t *) md1_buffer; - uint8_t * work = (uint8_t *) work_buffer; - - size_t use_len; - unsigned char * out_p = output; - uint8_t * U1 = (uint8_t *) MemoryCalloc(1, slen + 4); - - VerifyOrExit(U1 != nullptr, error = CHIP_ERROR_NO_MEMORY); - VerifyOrExit(password != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(plen > 0, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(salt != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(slen >= kSpake2p_Min_PBKDF_Salt_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(slen <= kSpake2p_Max_PBKDF_Salt_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(key_length > 0, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(output != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); - - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_HMAC); - psa_set_key_bits(&attr, plen * 8); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_HASH); - psa_set_key_algorithm(&attr, PSA_ALG_HMAC(PSA_ALG_SHA_256)); - - // Start with initializing the salt + counter - memcpy(U1, salt, slen); - U1[slen] = 0; - U1[slen + 1] = 0; - U1[slen + 2] = 0; - U1[slen + 3] = 1; - - // Loop until we have generated the requested key length - while (key_length) - { - // U1 ends up in work - status = psa_driver_wrapper_mac_compute(&attr, password, plen, PSA_ALG_HMAC(PSA_ALG_SHA_256), U1, slen + 4, work, - PSA_HASH_LENGTH(PSA_ALG_SHA_256), &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_256), error = CHIP_ERROR_INTERNAL); - - memcpy(md1, work, PSA_HASH_LENGTH(PSA_ALG_SHA_256)); - - for (size_t i = 1; i < iteration_count; i++) - { - // U2 ends up in md1 - // - - status = psa_driver_wrapper_mac_compute(&attr, password, plen, PSA_ALG_HMAC(PSA_ALG_SHA_256), md1, sizeof(md1_buffer), - md1, sizeof(md1_buffer), &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == PSA_HASH_LENGTH(PSA_ALG_SHA_256), error = CHIP_ERROR_INTERNAL); - - // U1 xor U2 - // - for (size_t j = 0; j < hash_size_in_native; j++) - { - work_buffer[j] ^= md1_buffer[j]; - } - } - - use_len = (key_length < PSA_HASH_LENGTH(PSA_ALG_SHA_256)) ? key_length : PSA_HASH_LENGTH(PSA_ALG_SHA_256); - memcpy(out_p, work, use_len); - - key_length -= (uint32_t) use_len; - out_p += use_len; - - for (size_t i = 4; i > 0; i--) - { - if (++U1[slen + i - 1] != 0) - { - break; - } - } - } - -exit: - MemoryFree(U1); - psa_reset_key_attributes(&attr); - return error; -} - -CHIP_ERROR add_entropy_source(entropy_source fn_source, void * p_source, size_t threshold) -{ - // PSA Crypto has its own entropy and doesn't support an override mechanism - (void) fn_source; - (void) p_source; - (void) threshold; - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DRBG_get_bytes(uint8_t * out_buffer, const size_t out_length) -{ - VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(out_length > 0, CHIP_ERROR_INVALID_ARGUMENT); - - psa_crypto_init(); - const psa_status_t result = psa_generate_random(Uint8::to_uchar(out_buffer), out_length); - VerifyOrReturnError(result == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - - return CHIP_NO_ERROR; -} - -// CryptoRNG's definition is needed to use the mbedTLS-backed SPAKE2+ and certificate operations -static int CryptoRNG(void * ctxt, uint8_t * out_buffer, size_t out_length) -{ - return (chip::Crypto::DRBG_get_bytes(out_buffer, out_length) == CHIP_NO_ERROR) ? 0 : 1; -} - -// Mapping function is used as part of the certificate operations -mbedtls_ecp_group_id MapECPGroupId(SupportedECPKeyTypes keyType) -{ - switch (keyType) - { - case SupportedECPKeyTypes::ECP256R1: - return MBEDTLS_ECP_DP_SECP256R1; - default: - return MBEDTLS_ECP_DP_NONE; - } -} - -/******************************************************************************* - * - * WARNING: The default (base) implementation of P256Keypair is UNSAFE! - * - * Because of the way CHIPCryptoPAL has evolved, it is dictating how a base - * P256Keypair should behave. This includes: - * * Allowing using a P256 key for both ECDSA and ECDH operations - * * Needing to support copying a key through Serialize()/Deserialize() - * operations. This can't easily be done opaquely on an opaque backend - * without convoluted forms of reference tracking. - * * Not including a way to figure out whether the created key is supposed - * to be ephemeral or long-lived. - * * Needing to support ingestion of specific-format keys through - * Deserialize() (to support e.g. the example DAC provider). - * - * These conditions have lead to the base implementation of this class in this - * crypto backend being backed by a plaintext key buffer instead of opaque key - * references. Usage of the base class is strongly discouraged, and is only - * implemented to support the in-tree examples which instantiate keys of this - * base class. - * - ******************************************************************************/ - -typedef struct -{ - uint8_t privkey[32]; - size_t bitlen; -} psa_plaintext_ecp_keypair; - -static inline psa_plaintext_ecp_keypair * to_keypair(P256KeypairContext * context) -{ - return SafePointerCast(context); -} - -static inline const psa_plaintext_ecp_keypair * to_const_keypair(const P256KeypairContext * context) -{ - return SafePointerCast(context); -} - -CHIP_ERROR P256Keypair::ECDSA_sign_msg(const uint8_t * msg, const size_t msg_length, P256ECDSASignature & out_signature) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - size_t output_length = 0; - const psa_plaintext_ecp_keypair * keypair = to_const_keypair(&mKeypair); - - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); - VerifyOrExit((msg != nullptr) && (msg_length > 0), error = CHIP_ERROR_INVALID_ARGUMENT); - - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, keypair->bitlen); - psa_set_key_algorithm(&attr, PSA_ALG_ECDSA(PSA_ALG_SHA_256)); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_MESSAGE); - - // use imported key to sign a message - status = - psa_driver_wrapper_sign_message(&attr, keypair->privkey, PSA_BITS_TO_BYTES(keypair->bitlen), PSA_ALG_ECDSA(PSA_ALG_SHA_256), - msg, msg_length, out_signature.Bytes(), out_signature.Capacity(), &output_length); - - VerifyOrReturnError(status == PSA_SUCCESS, CHIP_ERROR_INTERNAL); - VerifyOrReturnError(output_length == kP256_ECDSA_Signature_Length_Raw, CHIP_ERROR_INTERNAL); - VerifyOrReturnError(out_signature.SetLength(output_length) == CHIP_NO_ERROR, CHIP_ERROR_INTERNAL); - -exit: - _log_PSA_error(status); - psa_reset_key_attributes(&attr); - - return error; -} - -CHIP_ERROR P256PublicKey::ECDSA_validate_msg_signature(const uint8_t * msg, const size_t msg_length, - const P256ECDSASignature & signature) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - - VerifyOrExit((msg != nullptr) && (msg_length > 0), error = CHIP_ERROR_INVALID_ARGUMENT); - - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, 256); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_VERIFY_MESSAGE); - psa_set_key_algorithm(&attr, PSA_ALG_ECDSA(PSA_ALG_SHA_256)); - - // use imported key to verify a message - status = psa_driver_wrapper_verify_message(&attr, Uint8::to_const_uchar(*this), Length(), PSA_ALG_ECDSA(PSA_ALG_SHA_256), msg, - msg_length, signature.ConstBytes(), signature.Length()); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INVALID_SIGNATURE); -exit: - _log_PSA_error(status); - psa_reset_key_attributes(&attr); - - return error; -} - -CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, const size_t hash_length, - const P256ECDSASignature & signature) const -{ - VerifyOrReturnError(hash != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(hash_length == kSHA256_Hash_Length, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(signature.Length() == kP256_ECDSA_Signature_Length_Raw, CHIP_ERROR_INVALID_ARGUMENT); - - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - - // Step 1: import public key as volatile - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, 256); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_VERIFY_HASH); - psa_set_key_algorithm(&attr, PSA_ALG_ECDSA(PSA_ALG_SHA_256)); - - // use imported key to verify a hash - status = psa_driver_wrapper_verify_hash(&attr, Uint8::to_const_uchar(*this), Length(), PSA_ALG_ECDSA(PSA_ALG_SHA_256), hash, - hash_length, signature.ConstBytes(), signature.Length()); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INVALID_SIGNATURE); -exit: - _log_PSA_error(status); - psa_reset_key_attributes(&attr); - return error; -} - -CHIP_ERROR P256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_key, P256ECDHDerivedSecret & out_secret) const -{ - // Todo: replace with driver call once key derivation through the driver wrapper has been figured out - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - mbedtls_svc_key_id_t key_id = 0; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - size_t output_length = 0; - const psa_plaintext_ecp_keypair * keypair = to_const_keypair(&mKeypair); - - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); - - // Step 1: import plaintext key as volatile for ECDH - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, keypair->bitlen); - psa_set_key_algorithm(&attr, PSA_ALG_ECDH); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_DERIVE); - - status = psa_import_key(&attr, keypair->privkey, PSA_BITS_TO_BYTES(keypair->bitlen), &key_id); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - - // Step 2: do key derivation - status = psa_raw_key_agreement(PSA_ALG_ECDH, key_id, Uint8::to_const_uchar(remote_public_key), remote_public_key.Length(), - Uint8::to_uchar(out_secret), - (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(), &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - SuccessOrExit(out_secret.SetLength(output_length)); - -exit: - _log_PSA_error(status); - // Step 3: destroy imported key - psa_reset_key_attributes(&attr); - if (key_id != 0) - { - psa_destroy_key(key_id); - } - return error; -} - -void ClearSecretData(uint8_t * buf, size_t len) -{ - mbedtls_platform_zeroize(buf, len); -} - -// THE BELOW IS FROM `third_party/openthread/repo/third_party/mbedtls/repo/library/constant_time.c` since -// mbedtls_ct_memcmp is not available on Linux somehow :( -int mbedtls_ct_memcmp_copy(const void * a, const void * b, size_t n) -{ - size_t i; - volatile const unsigned char * A = (volatile const unsigned char *) a; - volatile const unsigned char * B = (volatile const unsigned char *) b; - volatile unsigned char diff = 0; - - for (i = 0; i < n; i++) - { - /* Read volatile data in order before computing diff. - * This avoids IAR compiler warning: - * 'the order of volatile accesses is undefined ..' */ - unsigned char x = A[i], y = B[i]; - diff |= x ^ y; - } - - return ((int) diff); -} - -bool IsBufferContentEqualConstantTime(const void * a, const void * b, size_t n) -{ - return mbedtls_ct_memcmp_copy(a, b, n) == 0; -} - -CHIP_ERROR P256Keypair::Initialize() -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_plaintext_ecp_keypair * keypair = to_keypair(&mKeypair); - size_t output_length; - - if (mInitialized) - { - return CHIP_ERROR_INCORRECT_STATE; - } - - // Step 1: Generate a volatile new key - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - psa_crypto_init(); - - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, 256); - psa_set_key_algorithm(&attr, PSA_ALG_ECDH); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_DERIVE | PSA_KEY_USAGE_EXPORT); - - status = psa_driver_wrapper_generate_key(&attr, keypair->privkey, sizeof(keypair->privkey), &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == kP256_PrivateKey_Length, error = CHIP_ERROR_INTERNAL); - - keypair->bitlen = 256; - - // Step 2: Export the public key into the pubkey member - status = psa_driver_wrapper_export_public_key(&attr, keypair->privkey, sizeof(keypair->privkey), Uint8::to_uchar(mPublicKey), - mPublicKey.Length(), &output_length); - - VerifyOrExit(status == PSA_SUCCESS, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(output_length == kP256_PublicKey_Length, error = CHIP_ERROR_INTERNAL); - -exit: - _log_PSA_error(status); - if (error == CHIP_NO_ERROR) - { - mInitialized = true; - } - psa_reset_key_attributes(&attr); - - return error; -} - -CHIP_ERROR P256Keypair::Serialize(P256SerializedKeypair & output) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - const psa_plaintext_ecp_keypair * keypair = to_const_keypair(&mKeypair); - size_t len = output.Length() == 0 ? output.Capacity() : output.Length(); - Encoding::BufferWriter bbuf(output, len); - - VerifyOrExit(mInitialized, error = CHIP_ERROR_WELL_UNINITIALIZED); - - bbuf.Put(mPublicKey, mPublicKey.Length()); - - VerifyOrExit(bbuf.Available() == sizeof(keypair->privkey), error = CHIP_ERROR_INTERNAL); - - bbuf.Put(keypair->privkey, PSA_BITS_TO_BYTES(keypair->bitlen)); - VerifyOrExit(bbuf.Fit(), error = CHIP_ERROR_BUFFER_TOO_SMALL); - - output.SetLength(bbuf.Needed()); - -exit: - return error; -} - -CHIP_ERROR P256Keypair::Deserialize(P256SerializedKeypair & input) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_plaintext_ecp_keypair * keypair = to_keypair(&mKeypair); - Encoding::BufferWriter bbuf(mPublicKey, mPublicKey.Length()); - - VerifyOrExit(input.Length() == mPublicKey.Length() + kP256_PrivateKey_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - - Clear(); - - memcpy(keypair->privkey, Uint8::to_uchar(input) + mPublicKey.Length(), kP256_PrivateKey_Length); - keypair->bitlen = 256; - - bbuf.Put((const uint8_t *) input, mPublicKey.Length()); - VerifyOrExit(bbuf.Fit(), error = CHIP_ERROR_NO_MEMORY); - - mInitialized = true; - -exit: - return error; -} - -void P256Keypair::Clear() -{ - if (mInitialized) - { - psa_plaintext_ecp_keypair * keypair = to_keypair(&mKeypair); - memset(keypair, 0, sizeof(psa_plaintext_ecp_keypair)); - mInitialized = false; - } -} - -P256Keypair::~P256Keypair() -{ - Clear(); -} - -CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const -{ - MutableByteSpan csr(out_csr, csr_length); - CHIP_ERROR err = GenerateCertificateSigningRequest(this, csr); - csr_length = (CHIP_NO_ERROR == err) ? csr.size() : 0; - return err; -} - -CHIP_ERROR VerifyCertificateSigningRequest(const uint8_t * csr_buf, size_t csr_length, P256PublicKey & pubkey) -{ -#if defined(MBEDTLS_X509_CSR_PARSE_C) - ReturnErrorOnFailure(VerifyCertificateSigningRequestFormat(csr_buf, csr_length)); - - // TODO: For some embedded targets, mbedTLS library doesn't have mbedtls_x509_csr_parse_der, and mbedtls_x509_csr_parse_free. - // Taking a step back, embedded targets likely will not process CSR requests. Adding this action item to reevaluate - // this if there's a need for this processing for embedded targets. - CHIP_ERROR error = CHIP_NO_ERROR; - size_t pubkey_size = 0; - - mbedtls_ecp_keypair * keypair = nullptr; - - P256ECDSASignature signature; - MutableByteSpan out_raw_sig_span(signature.Bytes(), signature.Capacity()); - - mbedtls_x509_csr csr; - mbedtls_x509_csr_init(&csr); - - int result = mbedtls_x509_csr_parse_der(&csr, csr_buf, csr_length); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - // Verify the signature algorithm and public key type - VerifyOrExit(csr.CHIP_CRYPTO_PAL_PRIVATE(sig_md) == MBEDTLS_MD_SHA256, error = CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE); - VerifyOrExit(csr.CHIP_CRYPTO_PAL_PRIVATE(sig_pk) == MBEDTLS_PK_ECDSA, error = CHIP_ERROR_WRONG_KEY_TYPE); - - keypair = mbedtls_pk_ec(csr.CHIP_CRYPTO_PAL_PRIVATE_X509(pk)); - - // Copy the public key from the CSR - result = mbedtls_ecp_point_write_binary(&keypair->CHIP_CRYPTO_PAL_PRIVATE(grp), &keypair->CHIP_CRYPTO_PAL_PRIVATE(Q), - MBEDTLS_ECP_PF_UNCOMPRESSED, &pubkey_size, Uint8::to_uchar(pubkey), pubkey.Length()); - - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(pubkey_size == pubkey.Length(), error = CHIP_ERROR_INTERNAL); - - // Convert DER signature to raw signature - error = EcdsaAsn1SignatureToRaw(kP256_FE_Length, - ByteSpan{ csr.CHIP_CRYPTO_PAL_PRIVATE(sig).CHIP_CRYPTO_PAL_PRIVATE_X509(p), - csr.CHIP_CRYPTO_PAL_PRIVATE(sig).CHIP_CRYPTO_PAL_PRIVATE_X509(len) }, - out_raw_sig_span); - - VerifyOrExit(error == CHIP_NO_ERROR, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(out_raw_sig_span.size() == (kP256_FE_Length * 2), error = CHIP_ERROR_INTERNAL); - signature.SetLength(out_raw_sig_span.size()); - - // Verify the signature using the public key - error = pubkey.ECDSA_validate_msg_signature(csr.CHIP_CRYPTO_PAL_PRIVATE_X509(cri).CHIP_CRYPTO_PAL_PRIVATE_X509(p), - csr.CHIP_CRYPTO_PAL_PRIVATE_X509(cri).CHIP_CRYPTO_PAL_PRIVATE_X509(len), signature); - - SuccessOrExit(error); - -exit: - mbedtls_x509_csr_free(&csr); - _log_mbedTLS_error(result); - return error; -#else - ChipLogError(Crypto, "MBEDTLS_X509_CSR_PARSE_C is not enabled. CSR cannot be parsed"); - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -#endif -} - -typedef struct Spake2p_Context -{ - mbedtls_ecp_group curve; - mbedtls_ecp_point M; - mbedtls_ecp_point N; - mbedtls_ecp_point X; - mbedtls_ecp_point Y; - mbedtls_ecp_point L; - mbedtls_ecp_point Z; - mbedtls_ecp_point V; - - mbedtls_mpi w0; - mbedtls_mpi w1; - mbedtls_mpi xy; - mbedtls_mpi tempbn; -} Spake2p_Context; - -static inline Spake2p_Context * to_inner_spake2p_context(Spake2pOpaqueContext * context) -{ - return SafePointerCast(context); -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - memset(context, 0, sizeof(Spake2p_Context)); - - mbedtls_ecp_group_init(&context->curve); - result = mbedtls_ecp_group_load(&context->curve, MBEDTLS_ECP_DP_SECP256R1); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - VerifyOrExit(mbedtls_md_info_from_type(MBEDTLS_MD_SHA256) != nullptr, error = CHIP_ERROR_INTERNAL); - - mbedtls_ecp_point_init(&context->M); - mbedtls_ecp_point_init(&context->N); - mbedtls_ecp_point_init(&context->X); - mbedtls_ecp_point_init(&context->Y); - mbedtls_ecp_point_init(&context->L); - mbedtls_ecp_point_init(&context->V); - mbedtls_ecp_point_init(&context->Z); - M = &context->M; - N = &context->N; - X = &context->X; - Y = &context->Y; - L = &context->L; - V = &context->V; - Z = &context->Z; - - mbedtls_mpi_init(&context->w0); - mbedtls_mpi_init(&context->w1); - mbedtls_mpi_init(&context->xy); - mbedtls_mpi_init(&context->tempbn); - w0 = &context->w0; - w1 = &context->w1; - xy = &context->xy; - tempbn = &context->tempbn; - - G = &context->curve.G; - order = &context->curve.N; - - return error; - -exit: - _log_mbedTLS_error(result); - Clear(); - return error; -} - -void Spake2p_P256_SHA256_HKDF_HMAC::Clear() -{ - VerifyOrReturn(state != CHIP_SPAKE2P_STATE::PREINIT); - - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - mbedtls_ecp_point_free(&context->M); - mbedtls_ecp_point_free(&context->N); - mbedtls_ecp_point_free(&context->X); - mbedtls_ecp_point_free(&context->Y); - mbedtls_ecp_point_free(&context->L); - mbedtls_ecp_point_free(&context->Z); - mbedtls_ecp_point_free(&context->V); - - mbedtls_mpi_free(&context->w0); - mbedtls_mpi_free(&context->w1); - mbedtls_mpi_free(&context->xy); - mbedtls_mpi_free(&context->tempbn); - - mbedtls_ecp_group_free(&context->curve); - - state = CHIP_SPAKE2P_STATE::PREINIT; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::Mac(const uint8_t * key, size_t key_len, const uint8_t * in, size_t in_len, - MutableByteSpan & out_span) -{ - HMAC_sha hmac; - VerifyOrReturnError(out_span.size() >= kSHA256_Hash_Length, CHIP_ERROR_BUFFER_TOO_SMALL); - ReturnErrorOnFailure(hmac.HMAC_SHA256(key, key_len, in, in_len, out_span.data(), kSHA256_Hash_Length)); - out_span = out_span.SubSpan(0, kSHA256_Hash_Length); - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::MacVerify(const uint8_t * key, size_t key_len, const uint8_t * mac, size_t mac_len, - const uint8_t * in, size_t in_len) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - uint8_t computed_mac[kSHA256_Hash_Length]; - MutableByteSpan computed_mac_span{ computed_mac }; - VerifyOrExit(mac_len == kSHA256_Hash_Length, error = CHIP_ERROR_INVALID_ARGUMENT); - - SuccessOrExit(error = Mac(key, key_len, in, in_len, computed_mac_span)); - VerifyOrExit(computed_mac_span.size() == mac_len, error = CHIP_ERROR_INTERNAL); - - VerifyOrExit(IsBufferContentEqualConstantTime(mac, computed_mac, kSHA256_Hash_Length), error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - return error; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FELoad(const uint8_t * in, size_t in_len, void * fe) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - result = mbedtls_mpi_read_binary((mbedtls_mpi *) fe, Uint8::to_const_uchar(in), in_len); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_mpi_mod_mpi((mbedtls_mpi *) fe, (mbedtls_mpi *) fe, (const mbedtls_mpi *) order); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - return error; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEWrite(const void * fe, uint8_t * out, size_t out_len) -{ - if (mbedtls_mpi_write_binary((const mbedtls_mpi *) fe, Uint8::to_uchar(out), out_len) != 0) - { - return CHIP_ERROR_INTERNAL; - } - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEGenerate(void * fe) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - result = mbedtls_ecp_gen_privkey(&context->curve, (mbedtls_mpi *) fe, CryptoRNG, nullptr); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - return error; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::FEMul(void * fer, const void * fe1, const void * fe2) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - result = mbedtls_mpi_mul_mpi((mbedtls_mpi *) fer, (const mbedtls_mpi *) fe1, (const mbedtls_mpi *) fe2); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_mpi_mod_mpi((mbedtls_mpi *) fer, (mbedtls_mpi *) fer, (const mbedtls_mpi *) order); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - return error; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointLoad(const uint8_t * in, size_t in_len, void * R) -{ - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - if (mbedtls_ecp_point_read_binary(&context->curve, (mbedtls_ecp_point *) R, Uint8::to_const_uchar(in), in_len) != 0) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointWrite(const void * R, uint8_t * out, size_t out_len) -{ - memset(out, 0, out_len); - - size_t mbedtls_out_len = out_len; - - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - if (mbedtls_ecp_point_write_binary(&context->curve, (const mbedtls_ecp_point *) R, MBEDTLS_ECP_PF_UNCOMPRESSED, - &mbedtls_out_len, Uint8::to_uchar(out), out_len) != 0) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointMul(void * R, const void * P1, const void * fe1) -{ - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - if (mbedtls_ecp_mul(&context->curve, (mbedtls_ecp_point *) R, (const mbedtls_mpi *) fe1, (const mbedtls_ecp_point *) P1, - CryptoRNG, nullptr) != 0) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointAddMul(void * R, const void * P1, const void * fe1, const void * P2, - const void * fe2) -{ - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - if (mbedtls_ecp_muladd(&context->curve, (mbedtls_ecp_point *) R, (const mbedtls_mpi *) fe1, (const mbedtls_ecp_point *) P1, - (const mbedtls_mpi *) fe2, (const mbedtls_ecp_point *) P2) != 0) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointInvert(void * R) -{ - mbedtls_ecp_point * Rp = (mbedtls_ecp_point *) R; - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - if (mbedtls_mpi_sub_mpi(&Rp->CHIP_CRYPTO_PAL_PRIVATE(Y), &context->curve.P, &Rp->CHIP_CRYPTO_PAL_PRIVATE(Y)) != 0) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointCofactorMul(void * R) -{ - return CHIP_NO_ERROR; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::ComputeL(uint8_t * Lout, size_t * L_len, const uint8_t * w1in, size_t w1in_len) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - - mbedtls_ecp_group curve; - mbedtls_mpi w1_bn; - mbedtls_ecp_point Ltemp; - - mbedtls_ecp_group_init(&curve); - mbedtls_mpi_init(&w1_bn); - mbedtls_ecp_point_init(&Ltemp); - - result = mbedtls_ecp_group_load(&curve, MBEDTLS_ECP_DP_SECP256R1); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_mpi_read_binary(&w1_bn, Uint8::to_const_uchar(w1in), w1in_len); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_mpi_mod_mpi(&w1_bn, &w1_bn, &curve.N); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_ecp_mul(&curve, &Ltemp, &w1_bn, &curve.G, CryptoRNG, nullptr); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - memset(Lout, 0, *L_len); - - result = mbedtls_ecp_point_write_binary(&curve, &Ltemp, MBEDTLS_ECP_PF_UNCOMPRESSED, L_len, Uint8::to_uchar(Lout), *L_len); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - mbedtls_ecp_point_free(&Ltemp); - mbedtls_mpi_free(&w1_bn); - mbedtls_ecp_group_free(&curve); - - return error; -} - -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::PointIsValid(void * R) -{ - Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); - - if (mbedtls_ecp_check_pubkey(&context->curve, (mbedtls_ecp_point *) R) != 0) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -constexpr uint8_t sOID_AttributeType_CommonName[] = { 0x55, 0x04, 0x03 }; -constexpr uint8_t sOID_AttributeType_MatterVendorId[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xA2, 0x7C, 0x02, 0x01 }; -constexpr uint8_t sOID_AttributeType_MatterProductId[] = { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xA2, 0x7C, 0x02, 0x02 }; -constexpr uint8_t sOID_SigAlgo_ECDSAWithSHA256[] = { 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02 }; -constexpr uint8_t sOID_Extension_BasicConstraints[] = { 0x55, 0x1D, 0x13 }; -constexpr uint8_t sOID_Extension_KeyUsage[] = { 0x55, 0x1D, 0x0F }; -constexpr uint8_t sOID_Extension_SubjectKeyIdentifier[] = { 0x55, 0x1D, 0x0E }; -constexpr uint8_t sOID_Extension_AuthorityKeyIdentifier[] = { 0x55, 0x1D, 0x23 }; - -/** - * Compares an mbedtls_asn1_buf structure (oidBuf) to a reference OID represented as uint8_t array (oid). - */ -#define OID_CMP(oid, oidBuf) \ - ((MBEDTLS_ASN1_OID == (oidBuf).CHIP_CRYPTO_PAL_PRIVATE_X509(tag)) && \ - (sizeof(oid) == (oidBuf).CHIP_CRYPTO_PAL_PRIVATE_X509(len)) && \ - (memcmp((oid), (oidBuf).CHIP_CRYPTO_PAL_PRIVATE_X509(p), (oidBuf).CHIP_CRYPTO_PAL_PRIVATE_X509(len)) == 0)) - -CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, AttestationCertType certType) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_NO_ERROR; - int result = 0; - mbedtls_x509_crt mbed_cert; - unsigned char * p = nullptr; - const unsigned char * end = nullptr; - size_t len = 0; - bool extBasicPresent = false; - bool extKeyUsagePresent = false; - - VerifyOrReturnError(!cert.empty(), CHIP_ERROR_INVALID_ARGUMENT); - - mbedtls_x509_crt_init(&mbed_cert); - - result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(cert.data()), cert.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - // "version" value is 1 higher than the actual encoded value. - VerifyOrExit(mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(version) - 1 == 2, error = CHIP_ERROR_INTERNAL); - - // Verify signature algorithms is ECDSA with SHA256. - VerifyOrExit(OID_CMP(sOID_SigAlgo_ECDSAWithSHA256, mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(sig_oid)), - error = CHIP_ERROR_INTERNAL); - - // Verify public key presence and format. - { - Crypto::P256PublicKey pubkey; - SuccessOrExit(error = ExtractPubkeyFromX509Cert(cert, pubkey)); - } - - p = mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(p); - end = p + mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(len); - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - while (p < end) - { - mbedtls_x509_buf extOID = { 0, 0, nullptr }; - int extCritical = 0; - - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - /* Get extension ID */ - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OID); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - extOID.CHIP_CRYPTO_PAL_PRIVATE_X509(tag) = MBEDTLS_ASN1_OID; - extOID.CHIP_CRYPTO_PAL_PRIVATE_X509(len) = len; - extOID.CHIP_CRYPTO_PAL_PRIVATE_X509(p) = p; - p += len; - - /* Get optional critical */ - result = mbedtls_asn1_get_bool(&p, end, &extCritical); - VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - - /* Data should be octet string type */ - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OCTET_STRING); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - if (OID_CMP(sOID_Extension_BasicConstraints, extOID)) - { - int isCA = 0; - int pathLen = -1; - unsigned char * seqStart = p; - - VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); - extBasicPresent = true; - - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - if (len > 0) - { - result = mbedtls_asn1_get_bool(&p, end, &isCA); - VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_INTERNAL); - - if (p != seqStart + len) - { - result = mbedtls_asn1_get_int(&p, end, &pathLen); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - } - } - - if (certType == AttestationCertType::kDAC) - { - VerifyOrExit(!isCA && pathLen == -1, error = CHIP_ERROR_INTERNAL); - } - else if (certType == AttestationCertType::kPAI) - { - VerifyOrExit(isCA && pathLen == 0, error = CHIP_ERROR_INTERNAL); - } - else - { - VerifyOrExit(isCA && (pathLen == -1 || pathLen == 0 || pathLen == 1), error = CHIP_ERROR_INTERNAL); - } - } - else if (OID_CMP(sOID_Extension_KeyUsage, extOID)) - { - mbedtls_x509_bitstring bs = { 0, 0, nullptr }; - unsigned int keyUsage = 0; - - VerifyOrExit(extCritical, error = CHIP_ERROR_INTERNAL); - extKeyUsagePresent = true; - - result = mbedtls_asn1_get_bitstring(&p, p + len, &bs); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - for (size_t i = 0; i < bs.CHIP_CRYPTO_PAL_PRIVATE_X509(len) && i < sizeof(unsigned int); i++) - { - keyUsage |= static_cast(bs.CHIP_CRYPTO_PAL_PRIVATE_X509(p)[i]) << (8 * i); - } - - if (certType == AttestationCertType::kDAC) - { - // SHALL only have the digitalSignature bit set. - VerifyOrExit(keyUsage == MBEDTLS_X509_KU_DIGITAL_SIGNATURE, error = CHIP_ERROR_INTERNAL); - } - else - { - bool keyCertSignFlag = keyUsage & MBEDTLS_X509_KU_KEY_CERT_SIGN; - bool crlSignFlag = keyUsage & MBEDTLS_X509_KU_CRL_SIGN; - bool otherFlags = - keyUsage & ~(MBEDTLS_X509_KU_CRL_SIGN | MBEDTLS_X509_KU_KEY_CERT_SIGN | MBEDTLS_X509_KU_DIGITAL_SIGNATURE); - VerifyOrExit(keyCertSignFlag && crlSignFlag && !otherFlags, error = CHIP_ERROR_INTERNAL); - } - } - else - { - p += len; - } - } - - // Verify basic and key usage extensions are present. - VerifyOrExit(extBasicPresent && extKeyUsagePresent, error = CHIP_ERROR_INTERNAL); - - // Verify that SKID and AKID extensions are present. - { - uint8_t kidBuf[kSubjectKeyIdentifierLength]; - MutableByteSpan kid(kidBuf); - SuccessOrExit(error = ExtractSKIDFromX509Cert(cert, kid)); - if (certType == AttestationCertType::kDAC || certType == AttestationCertType::kPAI) - { - // Mandatory extension for DAC and PAI certs. - SuccessOrExit(error = ExtractAKIDFromX509Cert(cert, kid)); - } - } - -exit: - _log_mbedTLS_error(result); - mbedtls_x509_crt_free(&mbed_cert); - -#else - (void) cert; - (void) certType; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -CHIP_ERROR ValidateCertificateChain(const uint8_t * rootCertificate, size_t rootCertificateLen, const uint8_t * caCertificate, - size_t caCertificateLen, const uint8_t * leafCertificate, size_t leafCertificateLen, - CertificateChainValidationResult & result) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_NO_ERROR; - mbedtls_x509_crt certChain; - mbedtls_x509_crt rootCert; - mbedtls_x509_time leaf_valid_from; - mbedtls_x509_crt * cert = NULL; - int mbedResult; - uint32_t flags; - int compare_from = 0; - int compare_until = 0; - - result = CertificateChainValidationResult::kInternalFrameworkError; - - VerifyOrReturnError(rootCertificate != nullptr && rootCertificateLen != 0, - (result = CertificateChainValidationResult::kRootArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); - VerifyOrReturnError(leafCertificate != nullptr && leafCertificateLen != 0, - (result = CertificateChainValidationResult::kLeafArgumentInvalid, CHIP_ERROR_INVALID_ARGUMENT)); - - mbedtls_x509_crt_init(&certChain); - mbedtls_x509_crt_init(&rootCert); - - /* Start of chain */ - mbedResult = mbedtls_x509_crt_parse(&certChain, Uint8::to_const_uchar(leafCertificate), leafCertificateLen); - VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kLeafFormatInvalid, error = CHIP_ERROR_INTERNAL)); - leaf_valid_from = certChain.valid_from; - - /* Add the intermediate to the chain, if present */ - if (caCertificate != nullptr && caCertificateLen > 0) - { - mbedResult = mbedtls_x509_crt_parse(&certChain, Uint8::to_const_uchar(caCertificate), caCertificateLen); - VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kICAFormatInvalid, error = CHIP_ERROR_INTERNAL)); - } - - /* Parse the root cert */ - mbedResult = mbedtls_x509_crt_parse(&rootCert, Uint8::to_const_uchar(rootCertificate), rootCertificateLen); - VerifyOrExit(mbedResult == 0, (result = CertificateChainValidationResult::kRootFormatInvalid, error = CHIP_ERROR_INTERNAL)); - - /* Validates that intermediate and root certificates are valid at the time of the leaf certificate's start time. */ - compare_from = timeCompare(&leaf_valid_from, &rootCert.valid_from); - compare_until = timeCompare(&leaf_valid_from, &rootCert.valid_to); - VerifyOrExit((compare_from >= 0) && (compare_until <= 0), - (result = CertificateChainValidationResult::kChainInvalid, error = CHIP_ERROR_CERT_NOT_TRUSTED)); - cert = certChain.next; - while (cert) - { - compare_from = timeCompare(&leaf_valid_from, &cert->valid_from); - compare_until = timeCompare(&leaf_valid_from, &cert->valid_to); - VerifyOrExit((compare_from >= 0) && (compare_until <= 0), - (result = CertificateChainValidationResult::kChainInvalid, error = CHIP_ERROR_CERT_NOT_TRUSTED)); - cert = cert->next; - } - - /* Verify the chain against the root */ - mbedResult = mbedtls_x509_crt_verify(&certChain, &rootCert, NULL, NULL, &flags, NULL, NULL); - - switch (mbedResult) - { - case 0: - VerifyOrExit(flags == 0, (result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); - result = CertificateChainValidationResult::kSuccess; - break; - case MBEDTLS_ERR_X509_CERT_VERIFY_FAILED: - result = CertificateChainValidationResult::kChainInvalid; - error = CHIP_ERROR_CERT_NOT_TRUSTED; - break; - default: - SuccessOrExit((result = CertificateChainValidationResult::kInternalFrameworkError, error = CHIP_ERROR_INTERNAL)); - } - -exit: - _log_mbedTLS_error(mbedResult); - mbedtls_x509_crt_free(&certChain); - mbedtls_x509_crt_free(&rootCert); - -#else - (void) rootCertificate; - (void) rootCertificateLen; - (void) caCertificate; - (void) caCertificateLen; - (void) leafCertificate; - (void) leafCertificateLen; - (void) result; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -inline bool IsTimeGreaterThanEqual(const mbedtls_x509_time * const timeA, const mbedtls_x509_time * const timeB) -{ - - // checks if two values are different and if yes, then returns first > second. -#define RETURN_STRICTLY_GREATER_IF_DIFFERENT(component) \ - { \ - auto valueA = timeA->CHIP_CRYPTO_PAL_PRIVATE_X509(component); \ - auto valueB = timeB->CHIP_CRYPTO_PAL_PRIVATE_X509(component); \ - \ - if (valueA != valueB) \ - { \ - return valueA > valueB; \ - } \ - } - - RETURN_STRICTLY_GREATER_IF_DIFFERENT(year); - RETURN_STRICTLY_GREATER_IF_DIFFERENT(mon); - RETURN_STRICTLY_GREATER_IF_DIFFERENT(day); - RETURN_STRICTLY_GREATER_IF_DIFFERENT(hour); - RETURN_STRICTLY_GREATER_IF_DIFFERENT(min); - RETURN_STRICTLY_GREATER_IF_DIFFERENT(sec); - - // all above are equal - return true; -} - -CHIP_ERROR IsCertificateValidAtIssuance(const ByteSpan & referenceCertificate, const ByteSpan & toBeEvaluatedCertificate) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_NO_ERROR; - mbedtls_x509_crt mbedReferenceCertificate; - mbedtls_x509_crt mbedToBeEvaluatedCertificate; - mbedtls_x509_time refNotBeforeTime; - mbedtls_x509_time tbeNotBeforeTime; - mbedtls_x509_time tbeNotAfterTime; - int result; - - VerifyOrReturnError(!referenceCertificate.empty() && !toBeEvaluatedCertificate.empty(), CHIP_ERROR_INVALID_ARGUMENT); - - mbedtls_x509_crt_init(&mbedReferenceCertificate); - mbedtls_x509_crt_init(&mbedToBeEvaluatedCertificate); - - result = mbedtls_x509_crt_parse(&mbedReferenceCertificate, Uint8::to_const_uchar(referenceCertificate.data()), - referenceCertificate.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - result = mbedtls_x509_crt_parse(&mbedToBeEvaluatedCertificate, Uint8::to_const_uchar(toBeEvaluatedCertificate.data()), - toBeEvaluatedCertificate.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - refNotBeforeTime = mbedReferenceCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_from); - tbeNotBeforeTime = mbedToBeEvaluatedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_from); - tbeNotAfterTime = mbedToBeEvaluatedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_to); - - // check if referenceCertificate is issued at or after tbeCertificate's notBefore timestamp - VerifyOrExit(IsTimeGreaterThanEqual(&refNotBeforeTime, &tbeNotBeforeTime), error = CHIP_ERROR_CERT_EXPIRED); - - // check if referenceCertificate is issued at or before tbeCertificate's notAfter timestamp - VerifyOrExit(IsTimeGreaterThanEqual(&tbeNotAfterTime, &refNotBeforeTime), error = CHIP_ERROR_CERT_EXPIRED); - -exit: - _log_mbedTLS_error(result); - mbedtls_x509_crt_free(&mbedReferenceCertificate); - mbedtls_x509_crt_free(&mbedToBeEvaluatedCertificate); - -#else - (void) referenceCertificate; - (void) toBeEvaluatedCertificate; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -CHIP_ERROR IsCertificateValidAtCurrentTime(const ByteSpan & certificate) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_NO_ERROR; - mbedtls_x509_crt mbedCertificate; - int result; - - VerifyOrReturnError(!certificate.empty(), CHIP_ERROR_INVALID_ARGUMENT); - - mbedtls_x509_crt_init(&mbedCertificate); - - result = mbedtls_x509_crt_parse(&mbedCertificate, Uint8::to_const_uchar(certificate.data()), certificate.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - // check if certificate's notBefore timestamp is earlier than or equal to current time. - result = mbedtls_x509_time_is_past(&mbedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_from)); - VerifyOrExit(result == 1, error = CHIP_ERROR_CERT_EXPIRED); - - // check if certificate's notAfter timestamp is later than current time. - result = mbedtls_x509_time_is_future(&mbedCertificate.CHIP_CRYPTO_PAL_PRIVATE_X509(valid_to)); - VerifyOrExit(result == 1, error = CHIP_ERROR_CERT_EXPIRED); - -exit: - _log_mbedTLS_error(result); - mbedtls_x509_crt_free(&mbedCertificate); - -#else - (void) certificate; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -CHIP_ERROR ExtractPubkeyFromX509Cert(const ByteSpan & certificate, Crypto::P256PublicKey & pubkey) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_NO_ERROR; - mbedtls_x509_crt mbed_cert; - mbedtls_ecp_keypair * keypair = nullptr; - size_t pubkey_size = 0; - - mbedtls_x509_crt_init(&mbed_cert); - - int result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(certificate.data()), certificate.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - VerifyOrExit(mbedtls_pk_get_type(&(mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(pk))) == MBEDTLS_PK_ECKEY, - error = CHIP_ERROR_INVALID_ARGUMENT); - - keypair = mbedtls_pk_ec(mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(pk)); - VerifyOrExit(keypair->CHIP_CRYPTO_PAL_PRIVATE(grp).id == MapECPGroupId(pubkey.Type()), error = CHIP_ERROR_INVALID_ARGUMENT); - // Copy the public key from the cert in raw point format - result = - mbedtls_ecp_point_write_binary(&keypair->CHIP_CRYPTO_PAL_PRIVATE(grp), &keypair->CHIP_CRYPTO_PAL_PRIVATE(Q), - MBEDTLS_ECP_PF_UNCOMPRESSED, &pubkey_size, Uint8::to_uchar(pubkey.Bytes()), pubkey.Length()); - - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - VerifyOrExit(pubkey_size == pubkey.Length(), error = CHIP_ERROR_INTERNAL); - -exit: - _log_mbedTLS_error(result); - mbedtls_x509_crt_free(&mbed_cert); - -#else - (void) certificate; - (void) pubkey; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -namespace { - -CHIP_ERROR ExtractKIDFromX509Cert(bool extractSKID, const ByteSpan & certificate, MutableByteSpan & kid) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_ERROR_NOT_FOUND; - mbedtls_x509_crt mbed_cert; - unsigned char * p = nullptr; - const unsigned char * end = nullptr; - size_t len = 0; - - mbedtls_x509_crt_init(&mbed_cert); - - int result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(certificate.data()), certificate.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - // TODO: The mbedTLS team is working on supporting SKID and AKID extensions processing. - // Once it is supported, this code should be updated. - - p = mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(p); - end = mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(p) + - mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(v3_ext).CHIP_CRYPTO_PAL_PRIVATE_X509(len); - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - - while (p < end) - { - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OID); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - - mbedtls_x509_buf extOID = { MBEDTLS_ASN1_OID, len, p }; - bool extractCurrentExtSKID = extractSKID && OID_CMP(sOID_Extension_SubjectKeyIdentifier, extOID); - bool extractCurrentExtAKID = !extractSKID && OID_CMP(sOID_Extension_AuthorityKeyIdentifier, extOID); - p += len; - - int is_critical = 0; - result = mbedtls_asn1_get_bool(&p, end, &is_critical); - VerifyOrExit(result == 0 || result == MBEDTLS_ERR_ASN1_UNEXPECTED_TAG, error = CHIP_ERROR_WRONG_CERT_TYPE); - - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OCTET_STRING); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - - if (extractCurrentExtSKID || extractCurrentExtAKID) - { - if (extractCurrentExtSKID) - { - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_OCTET_STRING); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - } - else - { - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - result = mbedtls_asn1_get_tag(&p, end, &len, MBEDTLS_ASN1_CONTEXT_SPECIFIC); - VerifyOrExit(result == 0, error = CHIP_ERROR_WRONG_CERT_TYPE); - // Other optional fields, authorityCertIssuer and authorityCertSerialNumber, - // will be skipped if present. - } - VerifyOrExit(len == kSubjectKeyIdentifierLength, error = CHIP_ERROR_WRONG_CERT_TYPE); - VerifyOrExit(len <= kid.size(), error = CHIP_ERROR_BUFFER_TOO_SMALL); - memcpy(kid.data(), p, len); - if (kid.size() > len) - { - kid.reduce_size(len); - } - ExitNow(error = CHIP_NO_ERROR); - break; - } - p += len; - } - -exit: - _log_mbedTLS_error(result); - mbedtls_x509_crt_free(&mbed_cert); - -#else - (void) certificate; - (void) kid; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -} // namespace - -CHIP_ERROR ExtractSKIDFromX509Cert(const ByteSpan & certificate, MutableByteSpan & skid) -{ - return ExtractKIDFromX509Cert(true, certificate, skid); -} - -CHIP_ERROR ExtractAKIDFromX509Cert(const ByteSpan & certificate, MutableByteSpan & akid) -{ - return ExtractKIDFromX509Cert(false, certificate, akid); -} - -CHIP_ERROR ExtractVIDPIDFromX509Cert(const ByteSpan & certificate, AttestationCertVidPid & vidpid) -{ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - CHIP_ERROR error = CHIP_NO_ERROR; - mbedtls_x509_crt mbed_cert; - mbedtls_asn1_named_data * dnIterator = nullptr; - AttestationCertVidPid vidpidFromCN; - - mbedtls_x509_crt_init(&mbed_cert); - - int result = mbedtls_x509_crt_parse(&mbed_cert, Uint8::to_const_uchar(certificate.data()), certificate.size()); - VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); - - for (dnIterator = &mbed_cert.CHIP_CRYPTO_PAL_PRIVATE_X509(subject); dnIterator != nullptr; - dnIterator = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(next)) - { - DNAttrType attrType = DNAttrType::kUnspecified; - if (OID_CMP(sOID_AttributeType_CommonName, dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(oid))) - { - attrType = DNAttrType::kCommonName; - } - else if (OID_CMP(sOID_AttributeType_MatterVendorId, dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(oid))) - { - attrType = DNAttrType::kMatterVID; - } - else if (OID_CMP(sOID_AttributeType_MatterProductId, dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(oid))) - { - attrType = DNAttrType::kMatterPID; - } - - size_t val_len = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(val).CHIP_CRYPTO_PAL_PRIVATE_X509(len); - uint8_t * val_p = dnIterator->CHIP_CRYPTO_PAL_PRIVATE_X509(val).CHIP_CRYPTO_PAL_PRIVATE_X509(p); - error = ExtractVIDPIDFromAttributeString(attrType, ByteSpan(val_p, val_len), vidpid, vidpidFromCN); - SuccessOrExit(error); - } - - // If Matter Attributes were not found use values extracted from the CN Attribute, - // which might be uninitialized as well. - if (!vidpid.Initialized()) - { - vidpid = vidpidFromCN; - } - -exit: - _log_mbedTLS_error(result); - mbedtls_x509_crt_free(&mbed_cert); - -#else - (void) certificate; - (void) vidpid; - CHIP_ERROR error = CHIP_ERROR_NOT_IMPLEMENTED; -#endif // defined(MBEDTLS_X509_CRT_PARSE_C) - - return error; -} - -} // namespace Crypto -} // namespace chip diff --git a/src/platform/silabs/SiWx917/ConfigurationManagerImpl.cpp b/src/platform/silabs/SiWx917/ConfigurationManagerImpl.cpp index aad749374aa943..618b5a6a7703a8 100644 --- a/src/platform/silabs/SiWx917/ConfigurationManagerImpl.cpp +++ b/src/platform/silabs/SiWx917/ConfigurationManagerImpl.cpp @@ -19,7 +19,7 @@ /** * @file * Provides the implementation of the Device Layer ConfigurationManager object - * for EFR32 platforms using the Silicon Labs SDK. + * for SiWx917 platforms using the Silicon Labs SDK. */ /* this file behaves like a config.h, comes first */ #include @@ -30,7 +30,7 @@ #include #include -#include "em_rmu.h" +#include "core_cm4.h" #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_STATION #include "wfx_host_events.h" @@ -60,8 +60,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() IncreaseBootCount(); // It is possible to configure the possible reset sources with RMU_ResetControl // In this case, we keep Reset control at default setting - rebootCause = RMU_ResetCauseGet(); - RMU_ResetCauseClear(); err = CHIP_NO_ERROR; diff --git a/src/platform/silabs/SiWx917/ConnectivityManagerImpl.cpp b/src/platform/silabs/SiWx917/ConnectivityManagerImpl.cpp deleted file mode 100644 index c38a5e5bb1e268..00000000000000 --- a/src/platform/silabs/SiWx917/ConnectivityManagerImpl.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Nest Labs, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* this file behaves like a config.h, comes first */ -#include - -#include -#include -#include -#include - -#include - -#if INET_CONFIG_ENABLE_TCP_ENDPOINT -#include -#endif - -#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include -#endif - -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD -#include -#endif - -using namespace ::chip; -using namespace ::chip::Inet; -using namespace ::chip::System; -using namespace ::chip::TLV; -using namespace ::chip::DeviceLayer::Internal; - -namespace chip { -namespace DeviceLayer { - -ConnectivityManagerImpl ConnectivityManagerImpl::sInstance; - -CHIP_ERROR ConnectivityManagerImpl::_Init() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - // Initialize the generic base classes that require it. -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - GenericConnectivityManagerImpl_Thread::_Init(); -#endif - SuccessOrExit(err); - -exit: - return err; -} - -void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) -{ - // Forward the event to the generic base classes as needed. -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - GenericConnectivityManagerImpl_Thread::_OnPlatformEvent(event); -#endif -} - -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/silabs/SiWx917/Efr32OpaqueKeypair.h b/src/platform/silabs/SiWx917/Efr32OpaqueKeypair.h deleted file mode 100644 index 58123c106ed892..00000000000000 --- a/src/platform/silabs/SiWx917/Efr32OpaqueKeypair.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -typedef uint16_t EFR32OpaqueKeyId; -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdUnknown = 0xFFFFU; // Do not modify, will impact existing deployments -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdVolatile = 0xFFFEU; // Do not modify, will impact existing deployments -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMin = 0x0U; // Do not modify, will impact existing deployments -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMax = 0x1FFU; // Do not decrease, will impact existing deployments - -enum class EFR32OpaqueKeyUsages : uint8_t -{ - ECDSA_P256_SHA256 = 0, - ECDH_P256 = 1, -}; - -/** - * @brief Base class for opaque keys - * - * Deriving from this class allows using it as a base class for operations - * which don't expose the private key independent of key size. - **/ -class EFR32OpaqueKeypair -{ -public: - EFR32OpaqueKeypair(); - virtual ~EFR32OpaqueKeypair(); - - /** - * @brief Load a keypair with given key ID - * - * If no key exists under the given ID, an error is returned - * and the object is unusable for operations. - * - * @param key_id key ID under which this key was created - * - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Load(EFR32OpaqueKeyId key_id); - - /** - * @brief Create a new keypair with given ID and usage - * - * If a key already exists under the given ID, an error is returned - * and no new key is created. - * - * @param key_id key ID under which to store this key. Set to 0 - * for a non-persistent key which gets destructed - * when the lifetime of this object ends, or set - * to any other value to store the key under that - * ID. - * - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Create(EFR32OpaqueKeyId key_id, EFR32OpaqueKeyUsages usage); - - /** - * @brief Get the public key for this keypair - * - * @param output Output buffer to put public key (in 0x04 || X || Y format) - * @param output_size Size of \p output - * @param output_length Amount of bytes put in \p output on success - * - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR GetPublicKey(uint8_t * output, size_t output_size, size_t * output_length) const; - - /** - * @brief Get the key ID for this keypair - * - * @return Returns kEFR32OpaqueKeyIdUnknown for an uninitialised/invalid - * key, kEFR32OpaqueKeyIdVolatile for a volatile key, and a key - * ID in the range [kEFR32OpaqueKeyIdPersistentMin, kEFR32OpaqueKeyIdPersistentMax] - * for valid persistent keys. - **/ - EFR32OpaqueKeyId GetKeyId() const; - - /** - * @brief Use this keypair to sign a message using the ECDSA-SHA256 algorithm - * - * @param msg Message buffer to sign - * @param msg_len Size of \p msg in bytes - * @param output Output buffer to write signature to. Signature - * is in raw format (i.e. binary concatenation of - * r and s) - * @param output_size Size of output buffer - * @param output_length Amount of bytes written into output buffer - * - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Sign(const uint8_t * msg, size_t msg_len, uint8_t * output, size_t output_size, size_t * output_length) const; - - /** - * @brief Use this keypair to derive a key using the raw ECDH algorithm - * - * @param their_key Buffer containing raw uncompressed public key - * of party to derive with - * @param their_key_len Size of \p their_key in bytes - * @param output Output buffer to write derived bytes to - * @param output_size Size of output buffer - * @param output_length Amount of bytes written into output buffer - * - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Derive(const uint8_t * their_key, size_t their_key_len, uint8_t * output, size_t output_size, - size_t * output_length) const; - - /** - * @brief Delete the keypair from storage - * - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Delete(); - -protected: - void * mContext = nullptr; - bool mHasKey = false; - bool mIsPersistent = false; - uint8_t * mPubkeyRef = nullptr; - size_t mPubkeySize = 0; - size_t mPubkeyLength = 0; -}; - -/** - * @brief Derived class of P256Keypair for using opaque keys - * - * The signature and compiled form of this class is suboptimal due to how - * the P256Keypair isn't really an abstract interface, but rather partly - * interface / partly implementation. Future optimisation should look at - * converting P256Keypair to a fully abstract interface. - **/ -class EFR32OpaqueP256Keypair : public chip::Crypto::P256Keypair, public EFR32OpaqueKeypair -{ -public: - EFR32OpaqueP256Keypair(); - ~EFR32OpaqueP256Keypair() override; - - /** - * @brief Initialize the keypair. - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Initialize() override; - - /** - * @brief Serialize the keypair (unsupported on opaque keys) - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Serialize(chip::Crypto::P256SerializedKeypair & output) const override; - - /** - * @brief Deserialize the keypair (unsupported on opaque keys) - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR Deserialize(chip::Crypto::P256SerializedKeypair & input) override; - - /** - * @brief Generate a new Certificate Signing Request (CSR). - * @param csr Newly generated CSR in DER format - * @param csr_length The caller provides the length of input buffer (csr). The function returns the actual length of generated - *CSR. - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR NewCertificateSigningRequest(uint8_t * csr, size_t & csr_length) const override; - - /** - * @brief A function to sign a msg using ECDSA - * @param msg Message that needs to be signed - * @param msg_length Length of message - * @param out_signature Buffer that will hold the output signature. The signature consists of: 2 EC elements (r and s), - * in raw point form (see SEC1). - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR ECDSA_sign_msg(const uint8_t * msg, size_t msg_length, - chip::Crypto::P256ECDSASignature & out_signature) const override; - - /** - * @brief A function to derive a shared secret using ECDH - * - * This implements the CHIP_Crypto_ECDH(PrivateKey myPrivateKey, PublicKey theirPublicKey) cryptographic primitive - * from the specification, using this class's private key from `mKeypair` as `myPrivateKey` and the remote - * public key from `remote_public_key` as `theirPublicKey`. - * - * @param remote_public_key Public key of remote peer with which we are trying to establish secure channel. remote_public_key is - * ASN.1 DER encoded as padded big-endian field elements as described in SEC 1: Elliptic Curve Cryptography - * [https://www.secg.org/sec1-v2.pdf] - * @param out_secret Buffer to write out secret into. This is a byte array representing the x coordinate of the shared secret. - * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise - **/ - CHIP_ERROR ECDH_derive_secret(const chip::Crypto::P256PublicKey & remote_public_key, - chip::Crypto::P256ECDHDerivedSecret & out_secret) const override; - - /** @brief Return public key for the keypair. - **/ - const chip::Crypto::P256PublicKey & Pubkey() const override; - -private: - chip::Crypto::P256PublicKey mPubKey; -}; - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/silabs/SiWx917/Efr32PsaOpaqueKeypair.cpp b/src/platform/silabs/SiWx917/Efr32PsaOpaqueKeypair.cpp deleted file mode 100644 index ae9a0f66c13cad..00000000000000 --- a/src/platform/silabs/SiWx917/Efr32PsaOpaqueKeypair.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Efr32OpaqueKeypair.h" -#include "em_device.h" -#include - -#include -#include -#include -using chip::Platform::MemoryCalloc; -using chip::Platform::MemoryFree; - -using chip::Crypto::P256ECDHDerivedSecret; -using chip::Crypto::P256ECDSASignature; -using chip::Crypto::P256Keypair; -using chip::Crypto::P256PublicKey; -using chip::Crypto::P256SerializedKeypair; - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -/******************************************************************************* - * - * PSA key ID range for storing Matter Opaque keys - * - ******************************************************************************/ -#define PSA_KEY_ID_FOR_MATTER_MIN (0x00004400) -#define PSA_KEY_ID_FOR_MATTER_MAX (0x000045FF) -#define PSA_KEY_ID_FOR_MATTER_SIZE (PSA_KEY_ID_FOR_MATTER_MAX - PSA_KEY_ID_FOR_MATTER_MIN + 1) - -static_assert((kEFR32OpaqueKeyIdPersistentMax - kEFR32OpaqueKeyIdPersistentMin) < PSA_KEY_ID_FOR_MATTER_SIZE, - "Not enough PSA range to store all allowed opaque key IDs"); - -#if defined(SEMAILBOX_PRESENT) && (_SILICON_LABS_SECURITY_FEATURE == _SILICON_LABS_SECURITY_FEATURE_VAULT) -#define PSA_CRYPTO_LOCATION_FOR_DEVICE PSA_KEY_LOCATION_SL_SE_OPAQUE -#elif defined(CRYPTOACC_PRESENT) && defined(SEPUF_PRESENT) && defined(SL_TRUSTZONE_NONSECURE) -#define PSA_CRYPTO_LOCATION_FOR_DEVICE PSA_KEY_LOCATION_SL_CRYPTOACC_OPAQUE -#else -#define PSA_CRYPTO_LOCATION_FOR_DEVICE PSA_KEY_LOCATION_LOCAL_STORAGE -#endif - -static void _log_PSA_error(psa_status_t status) -{ - if (status != PSA_SUCCESS) - { - ChipLogError(Crypto, "PSA error: %ld", status); - } -} - -/******************************************************************************* - * - * PSA Crypto backed implementation of EFR32OpaqueKeypair - * - ******************************************************************************/ - -static bool is_opaque_key_valid(EFR32OpaqueKeyId id) -{ - if (id == kEFR32OpaqueKeyIdVolatile) - { - return true; - } - else if (id >= kEFR32OpaqueKeyIdPersistentMin && id <= (kEFR32OpaqueKeyIdPersistentMin + PSA_KEY_ID_FOR_MATTER_SIZE)) - { - return true; - } - - return false; -} - -static mbedtls_svc_key_id_t psa_key_id_from_opaque(EFR32OpaqueKeyId id) -{ - if (id == kEFR32OpaqueKeyIdVolatile || !is_opaque_key_valid(id)) - { - return 0; - } - - return PSA_KEY_ID_FOR_MATTER_MIN + (id - kEFR32OpaqueKeyIdPersistentMin); -} - -static EFR32OpaqueKeyId opaque_key_id_from_psa(mbedtls_svc_key_id_t id) -{ - if (id == 0) - { - return kEFR32OpaqueKeyIdVolatile; - } - else if (id >= PSA_KEY_ID_FOR_MATTER_MIN && id <= PSA_KEY_ID_FOR_MATTER_MAX) - { - return (id + kEFR32OpaqueKeyIdPersistentMin) - PSA_KEY_ID_FOR_MATTER_MIN; - } - else - { - return kEFR32OpaqueKeyIdUnknown; - } -} - -EFR32OpaqueKeypair::EFR32OpaqueKeypair() -{ - psa_crypto_init(); - // Avoid having a reference to PSA datatypes in the signature of this class - mContext = MemoryCalloc(1, sizeof(mbedtls_svc_key_id_t)); -} - -EFR32OpaqueKeypair::~EFR32OpaqueKeypair() -{ - // Free key resources - if (mContext != nullptr) - { - // Delete volatile keys, since nobody else can after we drop the key ID. - if (!mIsPersistent) - { - Delete(); - } - - MemoryFree(mContext); - mContext = nullptr; - } -} - -CHIP_ERROR EFR32OpaqueKeypair::Load(EFR32OpaqueKeyId opaque_id) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - mbedtls_svc_key_id_t key_id = 0; - - VerifyOrExit(opaque_id != kEFR32OpaqueKeyIdVolatile, error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(is_opaque_key_valid(opaque_id), error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mContext, error = CHIP_ERROR_INCORRECT_STATE); - - // If the object contains a volatile key, clean it up before reusing the object storage - if (mHasKey && !mIsPersistent) - { - Delete(); - } - - key_id = psa_key_id_from_opaque(opaque_id); - - status = psa_export_public_key(key_id, mPubkeyRef, mPubkeySize, &mPubkeyLength); - - if (status == PSA_ERROR_DOES_NOT_EXIST) - { - error = CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND; - goto exit; - } - - VerifyOrExit(status == PSA_SUCCESS, { - _log_PSA_error(status); - error = CHIP_ERROR_INTERNAL; - }); - - // Store the key ID and mark the key as valid - *(mbedtls_svc_key_id_t *) mContext = key_id; - mHasKey = true; - mIsPersistent = true; - -exit: - if (error != CHIP_NO_ERROR) - { - memset(mPubkeyRef, 0, mPubkeySize); - } - - return error; -} - -CHIP_ERROR EFR32OpaqueKeypair::Create(EFR32OpaqueKeyId opaque_id, EFR32OpaqueKeyUsages usage) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - psa_key_attributes_t attr = PSA_KEY_ATTRIBUTES_INIT; - mbedtls_svc_key_id_t key_id = 0; - - VerifyOrExit(is_opaque_key_valid(opaque_id), error = CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrExit(mContext, error = CHIP_ERROR_INCORRECT_STATE); - - if (opaque_id == kEFR32OpaqueKeyIdVolatile) - { - psa_set_key_lifetime( - &attr, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_LIFETIME_VOLATILE, PSA_CRYPTO_LOCATION_FOR_DEVICE)); - } - else - { - psa_key_handle_t key_handle; - - key_id = psa_key_id_from_opaque(opaque_id); - - // Check if the key already exists - int ret = psa_open_key(key_id, &key_handle); - if (PSA_SUCCESS == ret) - { - // WARNING: Existing key! This is caused by a problem in the key store. - // The key must be destroyed, otherwhise the device won't recover. - ChipLogError(Crypto, "WARNING: PSA key recycled: %d / %ld", opaque_id, key_id); - psa_destroy_key(key_id); - } - - psa_set_key_id(&attr, key_id); - psa_set_key_lifetime( - &attr, PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(PSA_KEY_LIFETIME_PERSISTENT, PSA_CRYPTO_LOCATION_FOR_DEVICE)); - } - - switch (usage) - { - case EFR32OpaqueKeyUsages::ECDSA_P256_SHA256: - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, 256); - psa_set_key_algorithm(&attr, PSA_ALG_ECDSA(PSA_ALG_SHA_256)); - // Need hash signing permissions because the CSR generation uses sign_hash internally - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_SIGN_MESSAGE | PSA_KEY_USAGE_SIGN_HASH); - break; - case EFR32OpaqueKeyUsages::ECDH_P256: - psa_set_key_type(&attr, PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)); - psa_set_key_bits(&attr, 256); - psa_set_key_algorithm(&attr, PSA_ALG_ECDH); - psa_set_key_usage_flags(&attr, PSA_KEY_USAGE_DERIVE); - break; - } - - status = psa_generate_key(&attr, &key_id); - VerifyOrExit(status == PSA_SUCCESS, { - _log_PSA_error(status); - error = CHIP_ERROR_INTERNAL; - }); - - // Export the public key - status = psa_export_public_key(key_id, mPubkeyRef, mPubkeySize, &mPubkeyLength); - if (PSA_SUCCESS != status) - { - _log_PSA_error(status); - // Key generation succeeded, but pubkey export did not. To avoid - // memory leaks, delete the generated key before returning the error - psa_destroy_key(key_id); - error = CHIP_ERROR_INTERNAL; - goto exit; - } - - // Store the key ID and mark the key as valid - mHasKey = true; - mIsPersistent = opaque_id != kEFR32OpaqueKeyIdVolatile; - -exit: - psa_reset_key_attributes(&attr); - if (mContext) - { - if (CHIP_NO_ERROR == error) - { - *(mbedtls_svc_key_id_t *) mContext = key_id; - } - else - { - *(mbedtls_svc_key_id_t *) mContext = 0; - } - } - return error; -} - -CHIP_ERROR EFR32OpaqueKeypair::GetPublicKey(uint8_t * output, size_t output_size, size_t * output_length) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - VerifyOrExit(mHasKey, error = CHIP_ERROR_INCORRECT_STATE); - - if (output_size >= mPubkeyLength) - { - memcpy(output, mPubkeyRef, mPubkeyLength); - *output_length = mPubkeyLength; - } - else - { - error = CHIP_ERROR_BUFFER_TOO_SMALL; - } -exit: - return error; -} - -EFR32OpaqueKeyId EFR32OpaqueKeypair::GetKeyId() const -{ - if (!mHasKey) - { - return kEFR32OpaqueKeyIdUnknown; - } - - if (!mIsPersistent) - { - return kEFR32OpaqueKeyIdVolatile; - } - - return opaque_key_id_from_psa(*(mbedtls_svc_key_id_t *) mContext); -} - -CHIP_ERROR EFR32OpaqueKeypair::Sign(const uint8_t * msg, size_t msg_len, uint8_t * output, size_t output_size, - size_t * output_length) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - - VerifyOrExit(mContext, error = CHIP_ERROR_INCORRECT_STATE); - VerifyOrExit(mHasKey, error = CHIP_ERROR_INCORRECT_STATE); - - status = psa_sign_message(*(mbedtls_svc_key_id_t *) mContext, PSA_ALG_ECDSA(PSA_ALG_SHA_256), msg, msg_len, output, output_size, - output_length); - - VerifyOrExit(status == PSA_SUCCESS, { - _log_PSA_error(status); - error = CHIP_ERROR_INTERNAL; - }); - -exit: - return error; -} - -CHIP_ERROR EFR32OpaqueKeypair::Derive(const uint8_t * their_key, size_t their_key_len, uint8_t * output, size_t output_size, - size_t * output_length) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - - VerifyOrExit(mHasKey, error = CHIP_ERROR_INCORRECT_STATE); - - status = psa_raw_key_agreement(PSA_ALG_ECDH, *(mbedtls_svc_key_id_t *) mContext, their_key, their_key_len, output, output_size, - output_length); - - VerifyOrExit(status == PSA_SUCCESS, { - _log_PSA_error(status); - error = CHIP_ERROR_INTERNAL; - }); - -exit: - return error; -} - -CHIP_ERROR EFR32OpaqueKeypair::Delete() -{ - CHIP_ERROR error = CHIP_NO_ERROR; - psa_status_t status = PSA_ERROR_BAD_STATE; - - VerifyOrExit(mHasKey, error = CHIP_ERROR_INCORRECT_STATE); - - status = psa_destroy_key(*(mbedtls_svc_key_id_t *) mContext); - VerifyOrExit(status == PSA_SUCCESS, { - _log_PSA_error(status); - error = CHIP_ERROR_INTERNAL; - }); - -exit: - mHasKey = false; - mIsPersistent = false; - memset(mPubkeyRef, 0, mPubkeySize); - if (mContext) - { - *(mbedtls_svc_key_id_t *) mContext = 0; - } - return error; -} - -/******************************************************************************* - * - * PSA Crypto backed implementation of EFR32OpaqueP256Keypair - * - ******************************************************************************/ -EFR32OpaqueP256Keypair::EFR32OpaqueP256Keypair() -{ - mPubkeyRef = mPubKey.Bytes(); - mPubkeySize = mPubKey.Length(); - mPubkeyLength = 0; -} - -EFR32OpaqueP256Keypair::~EFR32OpaqueP256Keypair() {} - -CHIP_ERROR EFR32OpaqueP256Keypair::Initialize() -{ - if (mPubkeyLength > 0) - { - // already have a key - ECDH use case where CASESession is calling Initialize() - return CHIP_NO_ERROR; - } - - ChipLogError(Crypto, "Initialize() is invalid on opaque keys, use Create() instead"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR EFR32OpaqueP256Keypair::Serialize(P256SerializedKeypair & output) const -{ - ChipLogError(Crypto, "Serialisation is invalid on opaque keys, share the object instead"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR EFR32OpaqueP256Keypair::Deserialize(P256SerializedKeypair & input) -{ - ChipLogError(Crypto, "Serialisation is invalid on opaque keys"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR EFR32OpaqueP256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & csr_length) const -{ - MutableByteSpan csr(out_csr, csr_length); - CHIP_ERROR err = GenerateCertificateSigningRequest(this, csr); - csr_length = (CHIP_NO_ERROR == err) ? csr.size() : 0; - return err; -} - -CHIP_ERROR EFR32OpaqueP256Keypair::ECDSA_sign_msg(const uint8_t * msg, size_t msg_length, P256ECDSASignature & out_signature) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - size_t output_length = 0; - - VerifyOrExit((msg != nullptr) && (msg_length > 0), error = CHIP_ERROR_INVALID_ARGUMENT); - - error = Sign(msg, msg_length, out_signature.Bytes(), out_signature.Capacity(), &output_length); - - SuccessOrExit(error); - SuccessOrExit(out_signature.SetLength(output_length)); -exit: - return error; -} - -CHIP_ERROR EFR32OpaqueP256Keypair::ECDH_derive_secret(const P256PublicKey & remote_public_key, - P256ECDHDerivedSecret & out_secret) const -{ - CHIP_ERROR error = CHIP_NO_ERROR; - size_t output_length = 0; - - error = Derive(Uint8::to_const_uchar(remote_public_key), remote_public_key.Length(), Uint8::to_uchar(out_secret), - (out_secret.Length() == 0) ? out_secret.Capacity() : out_secret.Length(), &output_length); - - SuccessOrExit(error); - SuccessOrExit(out_secret.SetLength(output_length)); -exit: - return error; -} - -const P256PublicKey & EFR32OpaqueP256Keypair::Pubkey() const -{ - return mPubKey; -} - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.cpp b/src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.cpp deleted file mode 100644 index e8fdf61ff1c903..00000000000000 --- a/src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.cpp +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "Efr32PsaOperationalKeystore.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "Efr32OpaqueKeypair.h" -#include - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -static_assert((sizeof(FabricIndex) == 1), "Implementation is not prepared for large fabric indices"); -static_assert(SL_MATTER_MAX_STORED_OP_KEYS <= (kEFR32OpaqueKeyIdPersistentMax - kEFR32OpaqueKeyIdPersistentMin), - "Not enough opaque keys available to cover all requested operational keys"); -static_assert((CHIP_CONFIG_MAX_FABRICS + 1) <= SL_MATTER_MAX_STORED_OP_KEYS, - "Not enough operational keys requested to cover all potential fabrics (+1 staging for fabric update)"); -static_assert(SL_MATTER_MAX_STORED_OP_KEYS >= 1, "Minimum supported amount of operational keys is 1"); - -using namespace chip::Crypto; - -using chip::Platform::MemoryCalloc; -using chip::Platform::MemoryFree; - -Efr32PsaOperationalKeystore::~Efr32PsaOperationalKeystore() -{ - Deinit(); -} - -CHIP_ERROR Efr32PsaOperationalKeystore::Init() -{ - // Detect existing keymap size - CHIP_ERROR error = CHIP_NO_ERROR; - size_t wantedLen = SL_MATTER_MAX_STORED_OP_KEYS * sizeof(FabricIndex); - size_t existingLen = 0; - bool update_cache = false; - - if (SILABSConfig::ConfigValueExists(SILABSConfig::kConfigKey_OpKeyMap, existingLen)) - { - // There's a pre-existing key map on disk. Size the map to read it fully. - size_t outLen = 0; - - if (existingLen > (kEFR32OpaqueKeyIdPersistentMax - kEFR32OpaqueKeyIdPersistentMin) * sizeof(FabricIndex)) - { - return CHIP_ERROR_INTERNAL; - } - - // Upsize the map if the config was changed - if (existingLen < wantedLen) - { - existingLen = wantedLen; - } - - mKeyMap = (FabricIndex *) MemoryCalloc(1, existingLen); - VerifyOrExit(mKeyMap, error = CHIP_ERROR_NO_MEMORY); - - // Read the existing key map - error = SILABSConfig::ReadConfigValueBin(SILABSConfig::kConfigKey_OpKeyMap, (uint8_t *) mKeyMap, existingLen, outLen); - SuccessOrExit(error); - - // If upsizing, extend the map with undefined indices - for (size_t i = (outLen / sizeof(FabricIndex)); i < (existingLen / sizeof(FabricIndex)); i++) - { - mKeyMap[i] = kUndefinedFabricIndex; - } - - // If the config has changed, check whether it can be downsized fully or partially - if (existingLen > wantedLen) - { - size_t highest_found_index = 0; - for (size_t i = (wantedLen / sizeof(FabricIndex)); i < (existingLen / sizeof(FabricIndex)); i++) - { - if (mKeyMap[i] != kUndefinedFabricIndex) - { - highest_found_index = i; - } - } - - // set size to the smallest that will fit the upper opaque key ID in use - if (highest_found_index > 0) - { - existingLen = (highest_found_index + 1) * sizeof(FabricIndex); - update_cache = true; - } - } - - // Set the key map size - mKeyMapSize = existingLen; - } - else - { - // No key map on disk. Create and initialize a new one. - mKeyMap = (FabricIndex *) MemoryCalloc(1, wantedLen); - VerifyOrExit(mKeyMap, error = CHIP_ERROR_NO_MEMORY); - - for (size_t i = 0; i < (wantedLen / sizeof(FabricIndex)); i++) - { - mKeyMap[i] = kUndefinedFabricIndex; - } - - mKeyMapSize = wantedLen; - - update_cache = true; - } - - // Write-out keymap if needed - if (update_cache) - { - error = SILABSConfig::WriteConfigValueBin(SILABSConfig::kConfigKey_OpKeyMap, mKeyMap, mKeyMapSize); - SuccessOrExit(error); - } - - // Initialize cache key - mCachedKey = Platform::New(); - VerifyOrExit(mCachedKey, error = CHIP_ERROR_NO_MEMORY); - -exit: - if (error != CHIP_NO_ERROR) - { - Deinit(); - return error; - } - - mIsInitialized = true; - return CHIP_NO_ERROR; -} - -EFR32OpaqueKeyId Efr32PsaOperationalKeystore::FindKeyIdForFabric(FabricIndex fabricIndex) const -{ - // Search the map linearly to find a matching index slot - for (size_t i = 0; i < (mKeyMapSize / sizeof(FabricIndex)); i++) - { - if (mKeyMap[i] == fabricIndex) - { - // Found a match - return i + kEFR32OpaqueKeyIdPersistentMin; - } - } - - return kEFR32OpaqueKeyIdUnknown; -} - -bool Efr32PsaOperationalKeystore::HasOpKeypairForFabric(FabricIndex fabricIndex) const -{ - VerifyOrReturnError(mIsInitialized, false); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex), false); - - // If there was a pending keypair, then there's really a usable key - if (mIsPendingKeypairActive && (fabricIndex == mPendingFabricIndex) && (mPendingKeypair != nullptr)) - { - return true; - } - - // Check whether we have a match in the map - if (FindKeyIdForFabric(fabricIndex) != kEFR32OpaqueKeyIdUnknown) - { - return true; - } - - return false; -} - -CHIP_ERROR Efr32PsaOperationalKeystore::NewOpKeypairForFabric(FabricIndex fabricIndex, - MutableByteSpan & outCertificateSigningRequest) -{ - CHIP_ERROR error = CHIP_NO_ERROR; - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); - - // If a key is pending, we cannot generate for a different fabric index until we commit or revert. - if ((mPendingFabricIndex != kUndefinedFabricIndex) && (fabricIndex != mPendingFabricIndex)) - { - return CHIP_ERROR_INVALID_FABRIC_INDEX; - } - - VerifyOrReturnError(outCertificateSigningRequest.size() >= Crypto::kMAX_CSR_Length, CHIP_ERROR_BUFFER_TOO_SMALL); - - // Generate new key - EFR32OpaqueKeyId id = kEFR32OpaqueKeyIdUnknown; - - if (mPendingFabricIndex != kUndefinedFabricIndex) - { - // If we already have a pending key, delete it and put a new one in its place - id = mPendingKeypair->GetKeyId(); - if (id == kEFR32OpaqueKeyIdUnknown) - { - ResetPendingKey(); - } - else - { - mPendingKeypair->Delete(); - if (id == kEFR32OpaqueKeyIdVolatile) - { - id = kEFR32OpaqueKeyIdUnknown; - } - } - } - - if (id == kEFR32OpaqueKeyIdUnknown) - { - // Try to find an available opaque ID in the map - id = FindKeyIdForFabric(kUndefinedFabricIndex); - - if (!mPendingKeypair) - { - mPendingKeypair = Platform::New(); - } - } - - if (id == kEFR32OpaqueKeyIdUnknown) - { - // Could not find a free spot in the map - return CHIP_ERROR_NO_MEMORY; - } - - // Create new key on the old or found key ID - error = mPendingKeypair->Create(id, EFR32OpaqueKeyUsages::ECDSA_P256_SHA256); - if (error != CHIP_NO_ERROR) - { - ResetPendingKey(); - return error; - } - - // Set CSR and state - size_t csrLength = outCertificateSigningRequest.size(); - error = mPendingKeypair->NewCertificateSigningRequest(outCertificateSigningRequest.data(), csrLength); - if (error != CHIP_NO_ERROR) - { - ResetPendingKey(); - return error; - } - - outCertificateSigningRequest.reduce_size(csrLength); - mPendingFabricIndex = fabricIndex; - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Efr32PsaOperationalKeystore::ActivateOpKeypairForFabric(FabricIndex fabricIndex, - const Crypto::P256PublicKey & nocPublicKey) -{ - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); - VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex) && (fabricIndex == mPendingFabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); - - // Validate public key being activated matches last generated pending keypair - VerifyOrReturnError(mPendingKeypair->Pubkey().Matches(nocPublicKey), CHIP_ERROR_INVALID_PUBLIC_KEY); - - mIsPendingKeypairActive = true; - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Efr32PsaOperationalKeystore::CommitOpKeypairForFabric(FabricIndex fabricIndex) -{ - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); - VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex) && (fabricIndex == mPendingFabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); - VerifyOrReturnError(mIsPendingKeypairActive == true, CHIP_ERROR_INCORRECT_STATE); - - // Add key association to key map - EFR32OpaqueKeyId id = mPendingKeypair->GetKeyId(); - - if (id == kEFR32OpaqueKeyIdUnknown || id == kEFR32OpaqueKeyIdVolatile) - { - ResetPendingKey(); - return CHIP_ERROR_INTERNAL; - } - - // Guard against array out-of-bounds (should not happen with correctly initialised keys) - size_t keymap_index = id - kEFR32OpaqueKeyIdPersistentMin; - if (keymap_index >= (mKeyMapSize / sizeof(FabricIndex))) - { - return CHIP_ERROR_INTERNAL; - } - - if (mKeyMap[keymap_index] != kUndefinedFabricIndex) - { - ResetPendingKey(); - return CHIP_ERROR_INTERNAL; - } - - mKeyMap[keymap_index] = fabricIndex; - - // Persist key map - CHIP_ERROR error = SILABSConfig::WriteConfigValueBin(SILABSConfig::kConfigKey_OpKeyMap, mKeyMap, mKeyMapSize); - if (error != CHIP_NO_ERROR) - { - return error; - } - - // There's a good chance we'll need the key again soon - mCachedKey->Load(id); - - mPendingKeypair = nullptr; - mIsPendingKeypairActive = false; - mPendingFabricIndex = kUndefinedFabricIndex; - - return CHIP_NO_ERROR; -} - -CHIP_ERROR Efr32PsaOperationalKeystore::RemoveOpKeypairForFabric(FabricIndex fabricIndex) -{ - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); - - // Remove pending keypair if we have it and the fabric ID matches - if ((mPendingKeypair != nullptr) && (fabricIndex == mPendingFabricIndex)) - { - RevertPendingKeypair(); - } - - EFR32OpaqueKeyId id = FindKeyIdForFabric(fabricIndex); - if (id == kEFR32OpaqueKeyIdUnknown) - { - // Fabric is not in the map, so assume it's gone already - return CHIP_NO_ERROR; - } - - // Guard against array out-of-bounds (should not happen with correctly initialised keys) - size_t keymap_index = id - kEFR32OpaqueKeyIdPersistentMin; - if (keymap_index >= (mKeyMapSize / sizeof(FabricIndex))) - { - return CHIP_ERROR_INTERNAL; - } - - // Reset the key mapping since we'll be deleting this key - mKeyMap[keymap_index] = kUndefinedFabricIndex; - - // Persist key map - CHIP_ERROR error = SILABSConfig::WriteConfigValueBin(SILABSConfig::kConfigKey_OpKeyMap, mKeyMap, mKeyMapSize); - if (error != CHIP_NO_ERROR) - { - return error; - } - - // Check if key is cached - EFR32OpaqueKeyId cachedId = mCachedKey->GetKeyId(); - - if (id == cachedId) - { - // Delete from persistent storage and unload - mCachedKey->Delete(); - return CHIP_NO_ERROR; - } - - // Load it for purposes of deletion - error = mCachedKey->Load(id); - if (error != CHIP_NO_ERROR && error != CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) - { - return CHIP_ERROR_INTERNAL; - } - - mCachedKey->Delete(); - - return CHIP_NO_ERROR; -} - -void Efr32PsaOperationalKeystore::RevertPendingKeypair() -{ - if (mIsInitialized) - { - // Just delete the pending key from storage - ResetPendingKey(); - } -} - -CHIP_ERROR Efr32PsaOperationalKeystore::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message, - Crypto::P256ECDSASignature & outSignature) const -{ - VerifyOrReturnError(mIsInitialized, CHIP_ERROR_WELL_UNINITIALIZED); - VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); - - // Check to see whether the key is an activated pending key - if (mIsPendingKeypairActive && (fabricIndex == mPendingFabricIndex)) - { - VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INTERNAL); - return mPendingKeypair->ECDSA_sign_msg(message.data(), message.size(), outSignature); - } - - // Figure out which key ID we're looking for - EFR32OpaqueKeyId id = FindKeyIdForFabric(fabricIndex); - - if (id == kEFR32OpaqueKeyIdUnknown) - { - // Fabric is not in the map, but the caller thinks it's there? - return CHIP_ERROR_INTERNAL; - } - - // Check whether we have the key in cache - EFR32OpaqueKeyId cachedId = mCachedKey->GetKeyId(); - - if (id == cachedId) - { - return mCachedKey->ECDSA_sign_msg(message.data(), message.size(), outSignature); - } - - // If not, we need to recreate from the backend - CHIP_ERROR error = mCachedKey->Load(id); - if (error != CHIP_NO_ERROR) - { - return CHIP_ERROR_INTERNAL; - } - - // Sign with retrieved key - error = mCachedKey->ECDSA_sign_msg(message.data(), message.size(), outSignature); - if (error != CHIP_NO_ERROR) - { - return CHIP_ERROR_INTERNAL; - } - - return CHIP_NO_ERROR; -} - -Crypto::P256Keypair * Efr32PsaOperationalKeystore::AllocateEphemeralKeypairForCASE() -{ - EFR32OpaqueP256Keypair * new_key = Platform::New(); - - if (new_key != nullptr) - { - new_key->Create(kEFR32OpaqueKeyIdVolatile, EFR32OpaqueKeyUsages::ECDH_P256); - } - - return new_key; -} - -void Efr32PsaOperationalKeystore::ReleaseEphemeralKeypair(Crypto::P256Keypair * keypair) -{ - Platform::Delete((EFR32OpaqueP256Keypair *) keypair); -} - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.h b/src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.h deleted file mode 100644 index 4203724bd0dba7..00000000000000 --- a/src/platform/silabs/SiWx917/Efr32PsaOperationalKeystore.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include - -#include "Efr32OpaqueKeypair.h" -#include - -// Set SL_MATTER_MAX_STORED_OP_KEYS to the preferred size of the mapping table -// between fabric IDs and opaque key indices. It can not be less than -// CHIP_CONFIG_MAX_FABRICS + 1 (since there would be too few map elements to -// support all fabrics the application wants to support in addition to an extra -// pending key), but can be larger in case a consistent on-disk size of the map -// is required. -#ifndef SL_MATTER_MAX_STORED_OP_KEYS -#define SL_MATTER_MAX_STORED_OP_KEYS (CHIP_CONFIG_MAX_FABRICS + 1) -#endif - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -/** - * @brief OperationalKeystore implementation making use of the EFR32 SDK-provided - * storage mechanisms to load/store keypairs. - * - * WARNING: Ensure that any implementation that uses this one as a starting point - * DOES NOT have the raw key material (in usable form) passed up/down to - * direct storage APIs that may make copies on heap/stack without sanitization. - */ -class Efr32PsaOperationalKeystore : public chip::Crypto::OperationalKeystore -{ -public: - Efr32PsaOperationalKeystore(){}; - virtual ~Efr32PsaOperationalKeystore() override; - - // Non-copyable - Efr32PsaOperationalKeystore(Efr32PsaOperationalKeystore const &) = delete; - void operator=(Efr32PsaOperationalKeystore const &) = delete; - - /** - * @brief Initialize the Operational Keystore - */ - CHIP_ERROR Init(); - - bool HasPendingOpKeypair() const override { return (mPendingKeypair != nullptr); } - - bool HasOpKeypairForFabric(FabricIndex fabricIndex) const override; - CHIP_ERROR NewOpKeypairForFabric(FabricIndex fabricIndex, MutableByteSpan & outCertificateSigningRequest) override; - CHIP_ERROR ActivateOpKeypairForFabric(FabricIndex fabricIndex, const chip::Crypto::P256PublicKey & nocPublicKey) override; - CHIP_ERROR CommitOpKeypairForFabric(FabricIndex fabricIndex) override; - CHIP_ERROR RemoveOpKeypairForFabric(FabricIndex fabricIndex) override; - void RevertPendingKeypair() override; - CHIP_ERROR SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message, - chip::Crypto::P256ECDSASignature & outSignature) const override; - Crypto::P256Keypair * AllocateEphemeralKeypairForCASE() override; - void ReleaseEphemeralKeypair(chip::Crypto::P256Keypair * keypair) override; - -protected: - // The keymap maps PSA Crypto persistent key ID offsets against fabric IDs. - // The keymap is persisted in NVM3, and the keys are stored through the PSA - // API. - FabricIndex * mKeyMap = nullptr; - size_t mKeyMapSize = 0; - - // The key cache is to avoid having to reconstruct keys from the storage - // backend all the time (since it is rather slow). - EFR32OpaqueP256Keypair * mCachedKey = nullptr; - - // This pending fabric index is `kUndefinedFabricIndex` if there isn't a - // pending keypair override for a given fabric. - FabricIndex mPendingFabricIndex = kUndefinedFabricIndex; - EFR32OpaqueP256Keypair * mPendingKeypair = nullptr; - bool mIsPendingKeypairActive = false; - bool mIsInitialized = false; - -private: - void ResetPendingKey() - { - if (mPendingKeypair != nullptr) - { - mPendingKeypair->Delete(); - Platform::Delete(mPendingKeypair); - } - mPendingKeypair = nullptr; - mIsPendingKeypairActive = false; - mPendingFabricIndex = kUndefinedFabricIndex; - } - - void Deinit() - { - ResetPendingKey(); - - if (mCachedKey != nullptr) - { - Platform::Delete(mCachedKey); - mCachedKey = nullptr; - } - - if (mKeyMap != nullptr) - { - Platform::MemoryFree(mKeyMap); - mKeyMap = nullptr; - mKeyMapSize = 0; - } - - mIsInitialized = false; - } - - /** - * @brief Find the opaque key ID stored in the map for a given - * fabric ID. - * - * @param fabricIndex The fabric index to find the opaque key ID for. - * Can also be kUndefinedFabricIndex to find the first - * unoccupied key ID. - * - * @return a valid key ID on match, or kEFR32OpaqueKeyIdUnknown if no - * match is found. - */ - EFR32OpaqueKeyId FindKeyIdForFabric(FabricIndex fabricIndex) const; -}; - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/platform/silabs/SiWx917/PlatformManagerImpl.cpp b/src/platform/silabs/SiWx917/PlatformManagerImpl.cpp index 25de6d51d164b2..8032c840210804 100644 --- a/src/platform/silabs/SiWx917/PlatformManagerImpl.cpp +++ b/src/platform/silabs/SiWx917/PlatformManagerImpl.cpp @@ -24,6 +24,7 @@ /* this file behaves like a config.h, comes first */ #include +#include #include #include #include @@ -42,6 +43,24 @@ namespace DeviceLayer { PlatformManagerImpl PlatformManagerImpl::sInstance; +static void app_get_random(uint8_t * aOutput, size_t aLen) +{ + size_t i; + + for (i = 0; i < aLen; i++) + { + aOutput[i] = rand(); + } +} + +static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) +{ + app_get_random(reinterpret_cast(output), static_cast(len)); + *olen = len; + + return 0; +} + CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) { CHIP_ERROR err; @@ -57,6 +76,9 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); + // 16 : Threshold value + ReturnErrorOnFailure(chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16)); + // Call _InitChipStack() on the generic implementation base class // to finish the initialization process. err = Internal::GenericPlatformManagerImpl_FreeRTOS::_InitChipStack(); diff --git a/src/platform/silabs/SiWx917/ThreadStackManagerImpl.cpp b/src/platform/silabs/SiWx917/ThreadStackManagerImpl.cpp deleted file mode 100644 index 16d792276644e4..00000000000000 --- a/src/platform/silabs/SiWx917/ThreadStackManagerImpl.cpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Nest Labs, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation of the ThreadStackManager object for - * EFR32 platforms using the Silicon Labs SDK and the OpenThread - * stack. - * - */ -/* this file behaves like a config.h, comes first */ -#include - -#include -#include -#include -#include - -#include - -#include - -namespace chip { -namespace DeviceLayer { - -using namespace ::chip::DeviceLayer::Internal; - -ThreadStackManagerImpl ThreadStackManagerImpl::sInstance; - -CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack(void) -{ - return InitThreadStack(NULL); -} - -CHIP_ERROR ThreadStackManagerImpl::InitThreadStack(otInstance * otInst) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - // Initialize the generic implementation base classes. - err = GenericThreadStackManagerImpl_FreeRTOS::DoInit(); - SuccessOrExit(err); - err = GenericThreadStackManagerImpl_OpenThread::DoInit(otInst); - SuccessOrExit(err); - -exit: - return err; -} - -bool ThreadStackManagerImpl::IsInitialized() -{ - return sInstance.mThreadStackLock != NULL; -} - -} // namespace DeviceLayer -} // namespace chip - -using namespace ::chip::DeviceLayer; - -/** - * Glue function called directly by the OpenThread stack when tasklet processing work - * is pending. - */ -extern "C" void otTaskletsSignalPending(otInstance * p_instance) -{ - ThreadStackMgrImpl().SignalThreadActivityPending(); -} - -/** - * Glue function called directly by the OpenThread stack when system event processing work - * is pending. - */ -extern "C" void otSysEventSignalPending(void) -{ - BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR(); - portYIELD_FROM_ISR(yieldRequired); -} - -extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) -{ - return CHIPPlatformMemoryCalloc(aNum, aSize); -} - -extern "C" void otPlatFree(void * aPtr) -{ - CHIPPlatformMemoryFree(aPtr); -} - -extern "C" __WEAK void sl_openthread_init(void) -{ - // Place holder for enabling Silabs specific features available only through Simplicity Studio -} - -/** - * @brief Openthread UART implementation for the CLI is conflicting - * with the UART implemented for Pigweed RPC as they use the same UART port - * - * We now only build the uart as implemented in - * connectedhomeip/examples/platform/efr32/uart.c - * and remap OT functions to use our uart api. - * - * For now OT CLI isn't usable when the examples are built with pw_rpc - */ - -#ifndef PW_RPC_ENABLED -#include "uart.h" -#endif - -extern "C" otError otPlatUartEnable(void) -{ -#ifdef PW_RPC_ENABLED - return OT_ERROR_NOT_IMPLEMENTED; -#else - uartConsoleInit(); - return OT_ERROR_NONE; -#endif -} - -#if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI - -extern "C" otError otPlatUartSend(const uint8_t * aBuf, uint16_t aBufLength) -{ -#ifdef PW_RPC_ENABLED - return OT_ERROR_NOT_IMPLEMENTED; -#else - if (uartConsoleWrite((const char *) aBuf, aBufLength) > 0) - { - otPlatUartSendDone(); - return OT_ERROR_NONE; - } - return OT_ERROR_FAILED; -#endif -} - -extern "C" void efr32UartProcess(void) -{ -#if !defined(PW_RPC_ENABLED) && !defined(ENABLE_CHIP_SHELL) - uint8_t tempBuf[128] = { 0 }; - // will read the data available up to 128bytes - uint16_t count = uartConsoleRead((char *) tempBuf, 128); - if (count > 0) - { - // ot process Received data for CLI cmds - otPlatUartReceived(tempBuf, count); - } -#endif -} - -extern "C" __WEAK otError otPlatUartFlush(void) -{ - return OT_ERROR_NOT_IMPLEMENTED; -} - -extern "C" __WEAK otError otPlatUartDisable(void) -{ - return OT_ERROR_NOT_IMPLEMENTED; -} - -#endif // CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI diff --git a/src/platform/silabs/SiWx917/args.gni b/src/platform/silabs/SiWx917/args.gni index 6e7ac8dcb49e51..4fa9a22d40ac18 100644 --- a/src/platform/silabs/SiWx917/args.gni +++ b/src/platform/silabs/SiWx917/args.gni @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/SiWx917/args.gni") import("${chip_root}/src/crypto/crypto.gni") # ARM architecture flags will be set based on silabs_family. @@ -26,12 +26,7 @@ mbedtls_target = "${efr32_sdk_build_root}:efr32_sdk" openthread_external_mbedtls = mbedtls_target -# default to platform crypto implementation but allow commandline override -if (chip_crypto == "") { - chip_crypto = "platform" -} - -chip_device_platform = "efr32" +chip_device_platform = "SiWx917" #Net work configuration OpenThread lwip_platform = "efr32" @@ -44,7 +39,7 @@ chip_with_lwip = false chip_build_tests = false # Transitional CommissionableDataProvider not used anymore -# examples/platform/silabs/efr32/EFR32DeviceDataProvider is now used. +# examples/platform/silabs/SiWx917/SiWx917DeviceDataProvider is now used. chip_use_transitional_commissionable_data_provider = false openthread_root = "${chip_root}/third_party/openthread/ot-efr32/openthread" diff --git a/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h b/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h new file mode 100644 index 00000000000000..7849747dd28152 --- /dev/null +++ b/src/platform/silabs/SiWx917/bluetooth/rsi_ble_config.h @@ -0,0 +1,269 @@ +/******************************************************************************* + * @file rsi_ble_config.h + * @brief + ******************************************************************************* + * # License + * Copyright 2020 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ + +#ifndef RSI_BLE_CONFIG_H +#define RSI_BLE_CONFIG_H + +#include "rsi_ble_apis.h" +#include +/****************************************************** + * * Macros + * ******************************************************/ +//! application event list +#define RSI_BLE_CONN_EVENT 0x01 +#define RSI_BLE_DISCONN_EVENT 0x02 +#define RSI_BLE_GATT_WRITE_EVENT 0x03 +#define RSI_BLE_MTU_EVENT 0x04 +#define RSI_BLE_GATT_INDICATION_CONFIRMATION 0x05 +#define RSI_BLE_RESP_ATT_VALUE 0x06 +#define RSI_SSID 0x0D +#define RSI_SECTYPE 0x0E +#define RSI_BLE_WLAN_DISCONN_NOTIFY 0x0F +#define RSI_WLAN_ALREADY 0x10 +#define RSI_WLAN_NOT_ALREADY 0x11 +#define RSI_BLE_WLAN_TIMEOUT_NOTIFY 0x12 +#define RSI_BLE_WLAN_JOIN_STATUS 0x15 +#define RSI_APP_FW_VERSION 0x13 +#define RSI_BLE_WLAN_DISCONNECT_STATUS 0x14 + +#define RSI_REM_DEV_ADDR_LEN 18 +#define RSI_REM_DEV_NAME_LEN 31 + +#define RSI_BLE_DEV_NAME "CCP_DEVICE" +#define RSI_BLE_SET_RAND_ADDR "00:23:A7:12:34:56" + +#define CLEAR_WHITELIST 0x00 +#define ADD_DEVICE_TO_WHITELIST 0x01 +#define DELETE_DEVICE_FROM_WHITELIST 0x02 + +#define ALL_PHYS 0x00 + +#define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE 0 + +#define RSI_OPERMODE_WLAN_BLE 13 + +/***********************************************************************************************************************************************/ +//! Characteristic Presenatation Format Fields +/***********************************************************************************************************************************************/ +#define RSI_BLE_UINT8_FORMAT 0x04 +#define RSI_BLE_EXPONENT 0x00 +#define RSI_BLE_PERCENTAGE_UNITS_UUID 0x27AD +#define RSI_BLE_NAME_SPACE 0x01 +#define RSI_BLE_DESCRIPTION 0x010B + +//! BLE characteristic custom service uuid +#define RSI_BLE_CUSTOM_SERVICE_UUID 0xFFF6 +#define RSI_BLE_CUSTOM_LEVEL_UUID 0x1FF1 + +#ifdef RSI_M4_INTERFACE +#define RSI_BLE_MAX_NBR_ATT_REC 20 +#define RSI_BLE_MAX_NBR_SLAVES 1 +#define RSI_BLE_NUM_CONN_EVENTS 2 +#else +#define RSI_BLE_MAX_NBR_ATT_REC 80 +#define RSI_BLE_MAX_NBR_SLAVES 3 +#define RSI_BLE_NUM_CONN_EVENTS 20 +#endif + +#define RSI_BLE_MAX_NBR_ATT_SERV 10 + +#define RSI_BLE_MAX_NBR_MASTERS 1 +#define RSI_BLE_GATT_ASYNC_ENABLE 1 +#define RSI_BLE_GATT_INIT 0 + +#define RSI_BLE_START_SCAN 0x01 +#define RSI_BLE_STOP_SCAN 0x00 + +#define RSI_BLE_SCAN_TYPE SCAN_TYPE_ACTIVE +#define RSI_BLE_SCAN_FILTER_TYPE SCAN_FILTER_TYPE_ALL +/* Number of BLE GATT RECORD SIZE IN (n*16 BYTES), eg:(0x40*16)=1024 bytes */ +#define RSI_BLE_NUM_REC_BYTES 0x40 + +#define RSI_BLE_INDICATE_CONFIRMATION_FROM_HOST 0 + +/*=======================================================================*/ +//! Advertising command parameters +/*=======================================================================*/ + +#define RSI_BLE_ADV_TYPE UNDIR_CONN +#define RSI_BLE_ADV_FILTER_TYPE ALLOW_SCAN_REQ_ANY_CONN_REQ_ANY +#define RSI_BLE_ADV_DIR_ADDR_TYPE LE_PUBLIC_ADDRESS +#define RSI_BLE_ADV_DIR_ADDR "00:15:83:6A:64:17" + +#define RSI_BLE_ADV_INT_MIN 0x100 +#define RSI_BLE_ADV_INT_MAX 0x200 +#define RSI_BLE_ADV_CHANNEL_MAP 0x07 + +//! Advertise status +//! Start the advertising process +#define RSI_BLE_START_ADV 0x01 +//! Stop the advertising process +#define RSI_BLE_STOP_ADV 0x00 + +//! BLE Tx Power Index On Air +#define RSI_BLE_PWR_INX 30 + +//! BLE Active H/w Pwr Features +#define BLE_DISABLE_DUTY_CYCLING 0 +#define BLE_DUTY_CYCLING 1 +#define BLR_DUTY_CYCLING 2 +#define BLE_4X_PWR_SAVE_MODE 4 +#define RSI_BLE_PWR_SAVE_OPTIONS BLE_DISABLE_DUTY_CYCLING + +//! Advertise types + +/* Advertising will be visible(discoverable) to all the devices. + * Scanning/Connection is also accepted from all devices + * */ +#define UNDIR_CONN 0x80 + +/* Advertising will be visible(discoverable) to the particular device + * mentioned in RSI_BLE_ADV_DIR_ADDR only. + * Scanning and Connection will be accepted from that device only. + * */ +#define DIR_CONN 0x81 + +/* Advertising will be visible(discoverable) to all the devices. + * Scanning will be accepted from all the devices. + * Connection will be not be accepted from any device. + * */ +#define UNDIR_SCAN 0x82 + +/* Advertising will be visible(discoverable) to all the devices. + * Scanning and Connection will not be accepted from any device + * */ +#define UNDIR_NON_CONN 0x83 + +/* Advertising will be visible(discoverable) to the particular device + * mentioned in RSI_BLE_ADV_DIR_ADDR only. + * Scanning and Connection will be accepted from that device only. + * */ +#define DIR_CONN_LOW_DUTY_CYCLE 0x84 + +//! Advertising flags +#define LE_LIMITED_DISCOVERABLE 0x01 +#define LE_GENERAL_DISCOVERABLE 0x02 +#define LE_BR_EDR_NOT_SUPPORTED 0x04 + +//! Advertise filters +#define ALLOW_SCAN_REQ_ANY_CONN_REQ_ANY 0x00 +#define ALLOW_SCAN_REQ_WHITE_LIST_CONN_REQ_ANY 0x01 +#define ALLOW_SCAN_REQ_ANY_CONN_REQ_WHITE_LIST 0x02 +#define ALLOW_SCAN_REQ_WHITE_LIST_CONN_REQ_WHITE_LIST 0x03 + +//! Address types +#define LE_PUBLIC_ADDRESS 0x00 +#define LE_RANDOM_ADDRESS 0x01 +#define LE_RESOLVABLE_PUBLIC_ADDRESS 0x02 +#define LE_RESOLVABLE_RANDOM_ADDRESS 0x03 + +/*=======================================================================*/ + +/*=======================================================================*/ +//! Connection parameters +/*=======================================================================*/ +#define LE_SCAN_INTERVAL 0x0100 +#define LE_SCAN_WINDOW 0x0050 + +#define CONNECTION_INTERVAL_MIN 0x00A0 +#define CONNECTION_INTERVAL_MAX 0x00A0 + +#define CONNECTION_LATENCY 0x0000 +#define SUPERVISION_TIMEOUT 0x07D0 // 2000 + +/*=======================================================================*/ + +/*=======================================================================*/ +//! Scan command parameters +/*=======================================================================*/ + +#define SL_WFX_BLE_SCAN_TYPE SCAN_TYPE_ACTIVE +#define SL_WFX_BLE_SCAN_FILTER_TYPE SCAN_FILTER_TYPE_ALL + +//! Scan status +#define SL_WFX_BLE_START_SCAN 0x01 +#define SL_WFX_BLE_STOP_SCAN 0x00 + +//! Scan types +#define SCAN_TYPE_ACTIVE 0x01 +#define SCAN_TYPE_PASSIVE 0x00 + +//! Scan filters +#define SCAN_FILTER_TYPE_ALL 0x00 +#define SCAN_FILTER_TYPE_ONLY_WHITE_LIST 0x01 + +#define SL_WFX_SEL_INTERNAL_ANTENNA 0x00 +#define SL_WFX_SEL_EXTERNAL_ANTENNA 0x01 + +#define SL_WFX_BT_CTRL_REMOTE_USER_TERMINATED 0x4E13 +#define SL_WFX_BT_CTRL_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES 0x4E14 +#define SL_WFX_BT_CTRL_REMOTE_POWERING_OFF 0x4E15 +#define SL_WFX_BT_CTRL_TERMINATED_MIC_FAILURE 0x4E3D +#define SL_WFX_BT_FAILED_TO_ESTABLISH_CONN 0x4E3E +#define SL_WFX_BT_INVALID_RANGE 0x4E60 + +/***********************************************************************************************************************************************/ +//! RS9116 Firmware Configurations +/***********************************************************************************************************************************************/ + +/*=======================================================================*/ +//! Opermode command parameters +/*=======================================================================*/ +/* +#define RSI_FEATURE_BIT_MAP \ + (FEAT_ULP_GPIO_BASED_HANDSHAKE | FEAT_DEV_TO_HOST_ULP_GPIO_1) //! To set wlan feature select bit map +#define RSI_TCP_IP_BYPASS RSI_DISABLE //! TCP IP BYPASS feature check +#define RSI_TCP_IP_FEATURE_BIT_MAP \ + (TCP_IP_FEAT_DHCPV4_CLIENT) //! TCP/IP feature select bitmap for selecting TCP/IP features +#define RSI_EXT_TCPIP_FEATURE_BITMAP 0 + +#define RSI_CUSTOM_FEATURE_BIT_MAP FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map + +#define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (EXT_FEAT_LOW_POWER_MODE | EXT_FEAT_XTAL_CLK_ENABLE | EXT_FEAT_384K_MODE) + +#define RSI_BT_FEATURE_BITMAP (BT_RF_TYPE | ENABLE_BLE_PROTOCOL) +*/ +/*=======================================================================*/ +//! Power save command parameters +/*=======================================================================*/ +//! set handshake type of power mode +//#define RSI_HAND_SHAKE_TYPE GPIO_BASED + +#define BLE_ATT_REC_SIZE 500 +#define NO_OF_VAL_ATT 5 //! Attribute value count + +/***********************************************************************************************************************************************/ +//! user defined structure +/***********************************************************************************************************************************************/ +typedef struct rsi_ble_att_list_s +{ + uuid_t char_uuid; + uint16_t handle; + uint16_t value_len; + uint16_t max_value_len; + uint8_t char_val_prop; + void * value; +} rsi_ble_att_list_t; +typedef struct rsi_ble_s +{ + uint8_t DATA[BLE_ATT_REC_SIZE]; + uint16_t DATA_ix; + uint16_t att_rec_list_count; + rsi_ble_att_list_t att_rec_list[NO_OF_VAL_ATT]; +} rsi_ble_t; + +#endif \ No newline at end of file diff --git a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c new file mode 100644 index 00000000000000..115e5c16ffdcec --- /dev/null +++ b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.c @@ -0,0 +1,539 @@ +/******************************************************************************* + * @file wfx_sl_ble_init.c + * @brief + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ +/************************************************************************* + * + */ + +/*================================================================================ +* @brief : This file contains example application for Wlan Station BLE +* Provisioning +* @section Description : +* This application explains how to get the WLAN connection functionality using +* BLE provisioning. +* Silicon Labs Module starts advertising and with BLE Provisioning the Access Point +* details are fetched. +* Silicon Labs device is configured as a WiFi station and connects to an Access Point. +=================================================================================*/ + +#include "wfx_sl_ble_init.h" +#include "rsi_ble_config.h" + +// application defines +rsi_ble_event_conn_status_t conn_event_to_app; +rsi_ble_t att_list; +sl_wfx_msg_t event_msg; + +// Memory to initialize driver +uint8_t bt_global_buf[BT_GLOBAL_BUFF_LEN]; +static uint8_t wfx_rsi_drv_buf[WFX_RSI_BUF_SZ]; +const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF }; + +/* Rsi driver Task will use as its stack */ +// StackType_t driverRsiTaskStack[WFX_RSI_WLAN_TASK_SZ] = { 0 }; + +/* Structure that will hold the TCB of the wfxRsi Task being created. */ +// StaticTask_t driverRsiTaskBuffer; + +StaticTask_t rsiBLETaskStruct; + +/* wfxRsi Task will use as its stack */ +StackType_t wfxBLETaskStack[WFX_RSI_TASK_SZ] = { 0 }; + +int32_t ble_rsi_task(void) +{ + int32_t status; + uint8_t buf[RSI_RESPONSE_HOLD_BUFF_SIZE]; + // extern void rsi_hal_board_init(void); + // + // WFX_RSI_LOG("%s: starting(HEAP_SZ = %d)", __func__, SL_HEAP_SIZE); + // + // //! Driver initialization + // status = rsi_driver_init(wfx_rsi_drv_buf, WFX_RSI_BUF_SZ); + // if ((status < RSI_DRIVER_STATUS) || (status > WFX_RSI_BUF_SZ)) + // { + // WFX_RSI_LOG("%s: error: RSI Driver initialization failed with status: %02x", __func__, status); + // return status; + // } + // + // WFX_RSI_LOG("%s: rsi_device_init", __func__); + // + // /* ! Redpine module intialisation */ + // if ((status = rsi_device_init(LOAD_NWP_FW)) != RSI_SUCCESS) + // { + // WFX_RSI_LOG("%s: error: rsi_device_init failed with status: %02x", __func__, status); + // return status; + // } + // WFX_RSI_LOG("%s: start wireless drv task", __func__); + // + // /* + // * Create the driver task + // */ + // wfx_rsi.drv_task = xTaskCreateStatic((TaskFunction_t) rsi_wireless_driver_task, "rsi_drv", WFX_RSI_WLAN_TASK_SZ, NULL, + // 1, driverRsiTaskStack, &driverRsiTaskBuffer); + // if (NULL == wfx_rsi.drv_task) + // { + // WFX_RSI_LOG("%s: error: Create the driver task failed", __func__); + // return RSI_ERROR_INVALID_PARAM; + // } + // + // /* Initialize WiSeConnect or Module features. */ + // WFX_RSI_LOG("%s: rsi_wireless_init", __func__); + // if ((status = rsi_wireless_init(OPER_MODE_0, RSI_OPERMODE_WLAN_BLE)) != RSI_SUCCESS) + // { + // WFX_RSI_LOG("%s: error: Initialize WiSeConnect failed with status: %02x", __func__, status); + // return status; + // } + // + // WFX_RSI_LOG("%s: get FW version..", __func__); + // + // /* + // * Get the MAC and other info to let the user know about it. + // */ + // if (rsi_wlan_get(RSI_FW_VERSION, buf, sizeof(buf)) != RSI_SUCCESS) + // { + // WFX_RSI_LOG("%s: error: rsi_wlan_get(RSI_FW_VERSION) failed with status: %02x", __func__, status); + // return status; + // } + // + // buf[sizeof(buf) - 1] = 0; + // WFX_RSI_LOG("%s: RSI firmware version: %s", __func__, buf); + // //! Send feature frame + // if ((status = rsi_send_feature_frame()) != RSI_SUCCESS) + // { + // WFX_RSI_LOG("%s: error: rsi_send_feature_frame failed with status: %02x", __func__, status); + // return status; + // } + // + // WFX_RSI_LOG("%s: sent rsi_send_feature_frame", __func__); + // /* initializes wlan radio parameters and WLAN supplicant parameters. + // */ + // (void) rsi_wlan_radio_init(); /* Required so we can get MAC address */ + // if ((status = rsi_wlan_get(RSI_MAC_ADDRESS, &wfx_rsi.sta_mac.octet[0], RESP_BUFF_SIZE)) != RSI_SUCCESS) + // { + // WFX_RSI_LOG("%s: error: rsi_wlan_get failed with status: %02x", __func__, status); + // return status; + // } + + // registering the GAP callback functions + rsi_ble_gap_register_callbacks(NULL, NULL, rsi_ble_on_disconnect_event, NULL, NULL, NULL, rsi_ble_on_enhance_conn_status_event, + NULL, NULL, NULL); + + // registering the GATT call back functions + rsi_ble_gatt_register_callbacks(NULL, NULL, NULL, NULL, NULL, NULL, NULL, rsi_ble_on_gatt_write_event, NULL, NULL, NULL, + rsi_ble_on_mtu_event, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + rsi_ble_on_event_indication_confirmation, NULL); + + WFX_RSI_LOG("registering rsi_ble_add_service"); + + // Exchange of GATT info with BLE stack + rsi_ble_add_matter_service(); + + // initializing the application events map + rsi_ble_app_init_events(); + + wfx_rsi.ble_task = xTaskCreateStatic((TaskFunction_t) rsi_ble_event_handling_task, "rsi_ble", WFX_RSI_TASK_SZ, NULL, 2, + wfxBLETaskStack, &rsiBLETaskStruct); + WFX_RSI_LOG("%s: rsi_task_suspend init_task ", __func__); + if (wfx_rsi.ble_task == NULL) + { + WFX_RSI_LOG("%s: error: failed to create ble task.", __func__); + } + + WFX_RSI_LOG("%s complete", __func__); + // rsi_task_destroy((rsi_task_handle_t *)wfx_rsi.init_task); + return RSI_SUCCESS; +} + +/*==============================================*/ +/** + * @fn rsi_ble_app_init_events + * @brief initializes the event parameter. + * @param[in] none. + * @return none. + * @section description + * This function is used during BLE initialization. + */ +void rsi_ble_app_init_events() +{ + event_msg.ble_app_event_map = 0; + event_msg.ble_app_event_mask = 0xFFFFFFFF; + event_msg.ble_app_event_mask = event_msg.ble_app_event_mask; // To suppress warning while compiling + WFX_RSI_LOG("Function :: rsi_ble_app_init_events"); + return; +} + +/*==============================================*/ +/** + * @fn rsi_ble_app_clear_event + * @brief clears the specific event. + * @param[in] event_num, specific event number. + * @return none. + * @section description + * This function is used to clear the specific event. + */ +void rsi_ble_app_clear_event(uint32_t event_num) +{ + event_msg.event_num = event_num; + event_msg.ble_app_event_map &= ~BIT(event_num); + return; +} + +/*==============================================*/ +/** + * @fn rsi_ble_on_mtu_event + * @brief its invoked when mtu exhange event is received. + * @param[in] rsi_ble_mtu, mtu event paramaters. + * @return none. + * @section description + * This callback function is invoked when mtu exhange event is received + */ +void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu) +{ + WFX_RSI_LOG(" RSI_BLE : rsi_ble_on_mtu_event"); + memset(&event_msg.rsi_ble_mtu, 0, sizeof(rsi_ble_event_mtu_t)); + memcpy(&event_msg.rsi_ble_mtu, rsi_ble_mtu, sizeof(rsi_ble_event_mtu_t)); + rsi_ble_app_set_event(RSI_BLE_MTU_EVENT); +} + +/*==============================================*/ +/** + * @fn rsi_ble_on_gatt_write_event + * @brief its invoked when write/notify/indication events are received. + * @param[in] event_id, it indicates write/notification event id. + * @param[in] rsi_ble_write, write event parameters. + * @return none. + * @section description + * This callback function is invoked when write/notify/indication events are received + */ +void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write) +{ + WFX_RSI_LOG(" RSI_BLE : rsi_ble_on_gatt_write_event"); + memset(&event_msg.rsi_ble_write, 0, sizeof(rsi_ble_event_write_t)); + event_msg.event_id = event_id; + memcpy(&event_msg.rsi_ble_write, rsi_ble_write, sizeof(rsi_ble_event_write_t)); + rsi_ble_app_set_event(RSI_BLE_GATT_WRITE_EVENT); +} + +/*==============================================*/ +/** + * @fn rsi_ble_on_enhance_conn_status_event + * @brief invoked when enhanced connection complete event is received + * @param[out] resp_conn, connected remote device information + * @return none. + * @section description + * This callback function indicates the status of the connection + */ +void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn) +{ + WFX_RSI_LOG(" RSI_BLE : rsi_ble_on_enhance_conn_status_event"); + event_msg.connectionHandle = 1; + event_msg.bondingHandle = 255; + memcpy(event_msg.resp_enh_conn.dev_addr, resp_enh_conn->dev_addr, RSI_DEV_ADDR_LEN); + rsi_ble_app_set_event(RSI_BLE_CONN_EVENT); +} + +/*==============================================*/ +/** + * @fn rsi_ble_on_disconnect_event + * @brief invoked when disconnection event is received + * @param[in] resp_disconnect, disconnected remote device information + * @param[in] reason, reason for disconnection. + * @return none. + * @section description + * This callback function indicates disconnected device information and status + */ +void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason) +{ + WFX_RSI_LOG(" RSI_BLE : rsi_ble_on_disconnect_event"); + event_msg.reason = reason; + memcpy(event_msg.resp_disconnect, resp_disconnect, sizeof(rsi_ble_event_disconnect_t)); + rsi_ble_app_set_event(RSI_BLE_DISCONN_EVENT); +} + +/*==============================================*/ +/** + * @fn rsi_ble_on_event_indication_confirmation + * @brief this function will invoke when received indication confirmation event + * @param[out] resp_id, response id + * @param[out] status, status of the response + * @return none + * @section description + */ +void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp) +{ + WFX_RSI_LOG(" RSI_BLE : rsi_ble_on_event_indication_confirmation"); + event_msg.resp_status = resp_status; + memcpy(&event_msg.rsi_ble_event_set_att_rsp, rsi_ble_event_set_att_rsp, sizeof(rsi_ble_set_att_resp_t)); + rsi_ble_app_set_event(RSI_BLE_GATT_INDICATION_CONFIRMATION); +} + +/*==============================================*/ +/** + * @fn rsi_ble_app_get_event + * @brief returns the first set event based on priority + * @param[in] none. + * @return int32_t + * > 0 = event number + * -1 = not received any event + * @section description + * This function returns the highest priority event among all the set events + */ +int32_t rsi_ble_app_get_event(void) +{ + uint32_t ix; + + for (ix = 0; ix < 32; ix++) + { + if (event_msg.ble_app_event_map & (1 << ix)) + { + return ix; + } + } + + return (-1); +} + +/*==============================================*/ +/** + * @fn rsi_ble_app_set_event + * @brief set the specific event. + * @param[in] event_num, specific event number. + * @return none. + * @section description + * This function is used to set/raise the specific event. + */ +void rsi_ble_app_set_event(uint32_t event_num) +{ + event_msg.ble_app_event_map |= BIT(event_num); + return; +} + +/*==============================================*/ +/** + * @fn rsi_gatt_add_attribute_to_list + * @brief This function is used to store characteristic service attribute. + * @param[in] p_val, pointer to homekit structure + * @param[in] handle, characteristic service attribute handle. + * @param[in] data_len, characteristic value length + * @param[in] data, characteristic value pointer + * @param[in] uuid, characteristic value uuid + * @return none. + * @section description + * This function is used to store all attribute records + */ +void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t data_len, uint8_t * data, uuid_t uuid, + uint8_t char_prop) +{ + if ((p_val->DATA_ix + data_len) >= BLE_ATT_REC_SIZE) + { //! Check for max data length for the characteristic value + LOG_PRINT("\r\n no data memory for att rec values \r\n"); + return; + } + + p_val->att_rec_list[p_val->att_rec_list_count].char_uuid = uuid; + p_val->att_rec_list[p_val->att_rec_list_count].handle = handle; + p_val->att_rec_list[p_val->att_rec_list_count].value_len = data_len; + p_val->att_rec_list[p_val->att_rec_list_count].max_value_len = data_len; + p_val->att_rec_list[p_val->att_rec_list_count].char_val_prop = char_prop; + memcpy(p_val->DATA + p_val->DATA_ix, data, data_len); + p_val->att_rec_list[p_val->att_rec_list_count].value = p_val->DATA + p_val->DATA_ix; + p_val->att_rec_list_count++; + p_val->DATA_ix += p_val->att_rec_list[p_val->att_rec_list_count].max_value_len; + + return; +} + +/*==============================================*/ +/** + * @fn rsi_ble_add_char_serv_att + * @brief this function is used to add characteristic service attribute.. + * @param[in] serv_handler, service handler. + * @param[in] handle, characteristic service attribute handle. + * @param[in] val_prop, characteristic value property. + * @param[in] att_val_handle, characteristic value handle + * @param[in] att_val_uuid, characteristic value uuid + * @return none. + * @section description + * This function is used at application to add characteristic attribute + */ +void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle, uuid_t att_val_uuid) +{ + rsi_ble_req_add_att_t new_att = { 0 }; + + //! preparing the attribute service structure + new_att.serv_handler = serv_handler; + new_att.handle = handle; + new_att.att_uuid.size = 2; + new_att.att_uuid.val.val16 = RSI_BLE_CHAR_SERV_UUID; + new_att.property = RSI_BLE_ATT_PROPERTY_READ; + + //! preparing the characteristic attribute value + new_att.data_len = att_val_uuid.size + 4; + new_att.data[0] = val_prop; + rsi_uint16_to_2bytes(&new_att.data[2], att_val_handle); + if (new_att.data_len == 6) + { + rsi_uint16_to_2bytes(&new_att.data[4], att_val_uuid.val.val16); + } + else if (new_att.data_len == 8) + { + rsi_uint32_to_4bytes(&new_att.data[4], att_val_uuid.val.val32); + } + else if (new_att.data_len == 20) + { + memcpy(&new_att.data[4], &att_val_uuid.val.val128, att_val_uuid.size); + } + //! Add attribute to the service + rsi_ble_add_attribute(&new_att); + + return; +} + +/*==============================================*/ +/** + * @fn rsi_ble_add_char_val_att + * @brief this function is used to add characteristic value attribute. + * @param[in] serv_handler, new service handler. + * @param[in] handle, characteristic value attribute handle. + * @param[in] att_type_uuid, attribute uuid value. + * @param[in] val_prop, characteristic value property. + * @param[in] data, characteristic value data pointer. + * @param[in] data_len, characteristic value length. + * @return none. + * @section description + * This function is used at application to create new service. + */ + +void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t * data, + uint8_t data_len, uint8_t auth_read) +{ + rsi_ble_req_add_att_t new_att = { 0 }; + + memset(&new_att, 0, sizeof(rsi_ble_req_add_att_t)); + //! preparing the attributes + new_att.serv_handler = serv_handler; + new_att.handle = handle; + new_att.config_bitmap = auth_read; + memcpy(&new_att.att_uuid, &att_type_uuid, sizeof(uuid_t)); + new_att.property = val_prop; + + if (data != NULL) + memcpy(new_att.data, data, RSI_MIN(sizeof(new_att.data), data_len)); + + //! preparing the attribute value + new_att.data_len = data_len; + + //! add attribute to the service + rsi_ble_add_attribute(&new_att); + + if ((auth_read == ATT_REC_MAINTAIN_IN_HOST) || (data_len > 20)) + { + if (data != NULL) + { + rsi_gatt_add_attribute_to_list(&att_list, handle, data_len, data, att_type_uuid, val_prop); + } + } + + //! check the attribute property with notification/Indication + if ((val_prop & RSI_BLE_ATT_PROPERTY_NOTIFY) || (val_prop & RSI_BLE_ATT_PROPERTY_INDICATE)) + { + //! if notification/indication property supports then we need to add client characteristic service. + + //! preparing the client characteristic attribute & values + memset(&new_att, 0, sizeof(rsi_ble_req_add_att_t)); + new_att.serv_handler = serv_handler; + new_att.handle = handle + 1; + new_att.att_uuid.size = 2; + new_att.att_uuid.val.val16 = RSI_BLE_CLIENT_CHAR_UUID; + new_att.property = RSI_BLE_ATT_PROPERTY_READ | RSI_BLE_ATT_PROPERTY_WRITE; + new_att.data_len = 2; + + //! add attribute to the service + rsi_ble_add_attribute(&new_att); + } + + return; +} + +/*==============================================*/ +/** + * @fn rsi_ble_add_matter_service + * @brief this function is used to add service for matter + * @return status (uint32_t) 0 for success. + * @section description + * This function is used at application to create new service. + */ + +uint32_t rsi_ble_add_matter_service(void) +{ + uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID }; + custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE; + custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16; + uint8_t data[230] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; + + static const uuid_t custom_characteristic_RX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE, + .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED }, + .val.val128.data1 = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_1, + .val.val128.data2 = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_2, + .val.val128.data3 = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_3, + .val.val128.data4 = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_4 } }; + + rsi_ble_resp_add_serv_t new_serv_resp = { 0 }; + rsi_ble_add_service(custom_service, &new_serv_resp); + + // Adding custom characteristic declaration to the custom service + rsi_ble_add_char_serv_att( + new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_ATTRIBUTE_HANDLE_LOCATION, + RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ, // Set read, write, write without response + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION, custom_characteristic_RX); + + // Adding characteristic value attribute to the service + rsi_ble_add_char_val_att(new_serv_resp.serv_handler, + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION, custom_characteristic_RX, + RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ, // Set read, write, write without response + data, sizeof(data), ATT_REC_IN_HOST); + + static const uuid_t custom_characteristic_TX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_TX_SIZE, + .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_RESERVED }, + .val.val128.data1 = RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_1, + .val.val128.data2 = RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_2, + .val.val128.data3 = RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_3, + .val.val128.data4 = { RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_4 } }; + + // Adding custom characteristic declaration to the custom service + rsi_ble_add_char_serv_att( + new_serv_resp.serv_handler, new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_ATTRIBUTE_HANDLE_LOCATION, + RSI_BLE_ATT_PROPERTY_WRITE_NO_RESPONSE | RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ | + RSI_BLE_ATT_PROPERTY_NOTIFY | RSI_BLE_ATT_PROPERTY_INDICATE, // Set read, write, write without response + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION, custom_characteristic_TX); + + // Adding characteristic value attribute to the service + event_msg.rsi_ble_measurement_hndl = new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION; + + // Adding characteristic value attribute to the service + event_msg.rsi_ble_gatt_server_client_config_hndl = + new_serv_resp.start_handle + RSI_BLE_CHARACTERISTIC_TX_GATT_SERVER_CLIENT_HANDLE_LOCATION; + + rsi_ble_add_char_val_att(new_serv_resp.serv_handler, event_msg.rsi_ble_measurement_hndl, custom_characteristic_TX, + RSI_BLE_ATT_PROPERTY_WRITE_NO_RESPONSE | RSI_BLE_ATT_PROPERTY_WRITE | RSI_BLE_ATT_PROPERTY_READ | + RSI_BLE_ATT_PROPERTY_NOTIFY | + RSI_BLE_ATT_PROPERTY_INDICATE, // Set read, write, write without response + data, sizeof(data), ATT_REC_MAINTAIN_IN_HOST); + + memset(&data, 0, sizeof(data)); + return 0; +} \ No newline at end of file diff --git a/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h new file mode 100644 index 00000000000000..497d2b5ee33bfe --- /dev/null +++ b/src/platform/silabs/SiWx917/bluetooth/wfx_sl_ble_init.h @@ -0,0 +1,121 @@ +/******************************************************************************* + * @file wfx_sl_ble_init.h + * @brief + ******************************************************************************* + * # License + * Copyright 2021 Silicon Laboratories Inc. www.silabs.com + ******************************************************************************* + * + * The licensor of this software is Silicon Laboratories Inc. Your use of this + * software is governed by the terms of Silicon Labs Master Software License + * Agreement (MSLA) available at + * www.silabs.com/about-us/legal/master-software-license-agreement. This + * software is distributed to you in Source Code format and is governed by the + * sections of the MSLA applicable to Source Code. + * + ******************************************************************************/ +/************************************************************************* + * + */ + +/** + * Include files + * */ + +#ifndef WFX_SL_BLE_INIT +#define WFX_SL_BLE_INIT +#define RSI_BLE_ENABLE 1 + +// BLE include file to refer BLE APIs +#include "FreeRTOS.h" +#include "event_groups.h" +#include "rsi_ble_config.h" +#include "task.h" +#include "timers.h" +#include "wfx_host_events.h" +#include "wfx_rsi.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef RSI_M4_INTERFACE +#include "rsi_board.h" +#endif + +#define ATT_REC_IN_HOST 0 + +#define RSI_BLE_MATTER_CUSTOM_SERVICE_UUID 0 +#define RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE 2 +#define RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16 0xFFF6 +#define RSI_BLE_MATTER_CUSTOM_SERVICE_DATA 0x00 + +#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE 16 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED 0x00, 0x00, 0x00 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_1 0x18EE2EF5 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_2 0x263D +#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_3 0x4559 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_RX_VALUE_128_DATA_4 0x9F, 0x95, 0x9C, 0x4F, 0x11, 0x9D, 0x9F, 0x42 +#define RSI_BLE_CHARACTERISTIC_RX_ATTRIBUTE_HANDLE_LOCATION 1 +#define RSI_BLE_CHARACTERISTIC_RX_VALUE_HANDLE_LOCATION 2 + +#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_SIZE 16 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_RESERVED 0x00, 0x00, 0x00 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_1 0x18EE2EF5 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_2 0x263D +#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_3 0x4559 +#define RSI_BLE_CUSTOM_CHARACTERISTIC_TX_VALUE_128_DATA_4 0x9F, 0x95, 0x9C, 0x4F, 0x12, 0x9D, 0x9F, 0x42 +#define RSI_BLE_CHARACTERISTIC_TX_ATTRIBUTE_HANDLE_LOCATION 3 +#define RSI_BLE_CHARACTERISTIC_TX_MEASUREMENT_HANDLE_LOCATION 4 +#define RSI_BLE_CHARACTERISTIC_TX_GATT_SERVER_CLIENT_HANDLE_LOCATION 5 + +typedef struct sl_wfx_msg_s +{ + uint8_t connectionHandle; + uint8_t bondingHandle; + uint32_t event_num; + uint16_t reason; + uint16_t event_id; + uint16_t resp_status; + rsi_ble_event_mtu_t rsi_ble_mtu; + rsi_ble_event_write_t rsi_ble_write; + rsi_ble_event_enhance_conn_status_t resp_enh_conn; + rsi_ble_event_disconnect_t * resp_disconnect; + rsi_ble_set_att_resp_t rsi_ble_event_set_att_rsp; + uint32_t ble_app_event_map; + uint32_t ble_app_event_mask; + uint16_t rsi_ble_measurement_hndl; + uint16_t rsi_ble_gatt_server_client_config_hndl; +} sl_wfx_msg_t; + +int32_t ble_rsi_task(void); +void rsi_ble_on_connect_event(rsi_ble_event_conn_status_t * resp_conn); +void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason); +void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn); +void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write); +void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu); +void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp); +void rsi_gatt_add_attribute_to_list(rsi_ble_t * p_val, uint16_t handle, uint16_t data_len, uint8_t * data, uuid_t uuid, + uint8_t char_prop); +void rsi_ble_add_char_serv_att(void * serv_handler, uint16_t handle, uint8_t val_prop, uint16_t att_val_handle, + uuid_t att_val_uuid); +void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_type_uuid, uint8_t val_prop, uint8_t * data, + uint8_t data_len, uint8_t auth_read); +uint32_t rsi_ble_add_matter_service(void); +void rsi_ble_app_set_event(uint32_t event_num); +int32_t rsi_ble_app_get_event(void); +void rsi_ble_app_clear_event(uint32_t event_num); +void rsi_ble_app_init_events(); +void rsi_ble_event_handling_task(void); + +#endif \ No newline at end of file diff --git a/src/platform/silabs/SiWx917/efr32-mbedtls-psa-crypto-config.h b/src/platform/silabs/SiWx917/efr32-mbedtls-psa-crypto-config.h deleted file mode 100644 index 6df9724afa0808..00000000000000 --- a/src/platform/silabs/SiWx917/efr32-mbedtls-psa-crypto-config.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * - * Copyright (c) 2020-2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -// ADD USER PSA CRYPTO CONFIG HERE -#define SL_PSA_KEY_USER_SLOT_COUNT (4) - -#define SL_PSA_ITS_USER_MAX_FILES (128) - -#include "em_device.h" -#if defined(SEMAILBOX_PRESENT) || defined(CRYPTOACC_PRESENT) -// Use accelerated HMAC when we have it -#define MBEDTLS_PSA_ACCEL_ALG_HMAC -// Use accelerated ECDSA/ECDH when we have it -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY -#define MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256 -#define MBEDTLS_PSA_ACCEL_ALG_ECDH -#define MBEDTLS_PSA_ACCEL_ALG_ECDSA -#else -// Devices without SEMAILBOX or CRYPTOACC don't have HMAC top-level accelerated -#define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1 -// Devices without SEMAILBOX or CRYPTOACC don't have fully implemented ECDSA/ECDH -#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY 1 -#define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR 1 -#define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_256 1 -#define MBEDTLS_PSA_BUILTIN_ALG_ECDH 1 -#define MBEDTLS_PSA_BUILTIN_ALG_ECDSA 1 -#endif -// end of user configuration section >>> - -// AUTO GENERATED PSA CONFIG SECTION BELOW. **KEEP AS IS FUTURE GSDK UPDATE** -#define PSA_WANT_KEY_TYPE_AES -#define PSA_WANT_ALG_CMAC -#define PSA_WANT_ALG_SHA_256 -#define PSA_WANT_ALG_CCM -#define PSA_WANT_ALG_ECB_NO_PADDING -#define PSA_WANT_ALG_ECDSA -#define PSA_WANT_ALG_ECDH -#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR -#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY -#define PSA_WANT_ECC_SECP_R1_256 -#define PSA_WANT_ALG_HKDF -#define PSA_WANT_ALG_HMAC -#define PSA_WANT_KEY_TYPE_HMAC -#define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG -#define MBEDTLS_PSA_ACCEL_ALG_SHA_1 -#define MBEDTLS_PSA_ACCEL_ALG_SHA_224 -#define MBEDTLS_PSA_ACCEL_ALG_SHA_256 -#define MBEDTLS_PSA_ACCEL_KEY_TYPE_AES -#define MBEDTLS_PSA_ACCEL_ALG_ECB_NO_PADDING -#define MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING -#define MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7 -#define MBEDTLS_PSA_ACCEL_ALG_CTR -#define MBEDTLS_PSA_ACCEL_ALG_CFB -#define MBEDTLS_PSA_ACCEL_ALG_OFB -#define MBEDTLS_PSA_ACCEL_ALG_GCM -#define MBEDTLS_PSA_ACCEL_ALG_CCM -#define MBEDTLS_PSA_ACCEL_ALG_CMAC - -#define MBEDTLS_PSA_KEY_SLOT_COUNT (15 + 1 + SL_PSA_KEY_USER_SLOT_COUNT) -#define SL_PSA_ITS_MAX_FILES (1 + SL_PSA_ITS_USER_MAX_FILES) diff --git a/src/platform/silabs/SiWx917/efr32-chip-mbedtls-config.h b/src/platform/silabs/SiWx917/siwx917-chip-mbedtls-config.h similarity index 86% rename from src/platform/silabs/SiWx917/efr32-chip-mbedtls-config.h rename to src/platform/silabs/SiWx917/siwx917-chip-mbedtls-config.h index 049c12cb084a65..41126c51c0482c 100644 --- a/src/platform/silabs/SiWx917/efr32-chip-mbedtls-config.h +++ b/src/platform/silabs/SiWx917/siwx917-chip-mbedtls-config.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, The OpenThread Authors. + * Copyright (c) 2021, The OpenThread Authors. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,13 +31,10 @@ #include #include #include - -#include "em_device.h" -#include "em_se.h" - -#if CHIP_HAVE_CONFIG_H -#include -#endif // CHIP_HAVE_CONFIG_H +/** + * Enable FreeRTOS threading support + */ +#define MBEDTLS_FREERTOS /** * Enable H Crypto and Entropy modules @@ -46,8 +43,16 @@ #define MBEDTLS_ECP_C #define MBEDTLS_ECDH_C #define MBEDTLS_ENTROPY_C -#define MBEDTLS_SHA224_C #define MBEDTLS_SHA256_C +#define MBEDTLS_CIPHER_MODE_CTR +#define MBEDTLS_TRNG_C + +#define MBEDTLS_NO_PLATFORM_ENTROPY +#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES + +#if defined(MBEDTLS_ECP_ALT) && !defined(MBEDTLS_ECP_RESTARTABLE) +typedef void mbedtls_ecp_restart_ctx; +#endif #define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf @@ -58,6 +63,8 @@ #define MBEDTLS_BIGNUM_C #define MBEDTLS_CCM_C #define MBEDTLS_CIPHER_C +#define MBEDTLS_CIPHER_MODE_CBC +#define MBEDTLS_CIPHER_MODE_CFB #define MBEDTLS_CMAC_C #define MBEDTLS_CTR_DRBG_C #define MBEDTLS_ECDH_LEGACY_CONTEXT @@ -67,7 +74,9 @@ #define MBEDTLS_ECP_DP_SECP256R1_ENABLED #define MBEDTLS_ECP_NIST_OPTIM #define MBEDTLS_ENTROPY_FORCE_SHA256 -#define MBEDTLS_ENTROPY_HARDWARE_ALT +// TODO: 3R +// #define MBEDTLS_ENTROPY_HARDWARE_ALT + #define MBEDTLS_ERROR_STRERROR_DUMMY #define MBEDTLS_HAVE_ASM #define MBEDTLS_HKDF_C @@ -76,23 +85,15 @@ #define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED #define MBEDTLS_MD_C -#define MBEDTLS_NO_PLATFORM_ENTROPY #define MBEDTLS_OID_C #define MBEDTLS_PEM_PARSE_C #define MBEDTLS_PEM_WRITE_C #define MBEDTLS_PK_C #define MBEDTLS_PK_PARSE_C #define MBEDTLS_PK_WRITE_C -#if CHIP_CRYPTO_MBEDTLS #define MBEDTLS_PKCS5_C -#endif #define MBEDTLS_PLATFORM_C #define MBEDTLS_PLATFORM_MEMORY -#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#define MBEDTLS_PSA_CRYPTO_C -#define MBEDTLS_PSA_CRYPTO_CONFIG -#define MBEDTLS_PSA_CRYPTO_DRIVERS -#define MBEDTLS_PSA_CRYPTO_STORAGE_C #define MBEDTLS_SHA256_SMALLER #define MBEDTLS_SHA512_C #define MBEDTLS_SSL_CLI_C @@ -106,11 +107,6 @@ #define MBEDTLS_SSL_PROTO_DTLS #define MBEDTLS_SSL_SRV_C #define MBEDTLS_SSL_TLS_C - -#if CHIP_CRYPTO_PLATFORM -#define MBEDTLS_USE_PSA_CRYPTO -#endif - #define MBEDTLS_X509_CREATE_C #define MBEDTLS_X509_CSR_WRITE_C #define MBEDTLS_X509_CRL_PARSE_C @@ -133,9 +129,4 @@ #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 -#define MBEDTLS_CIPHER_MODE_WITH_PADDING - -#include "check_crypto_config.h" -#include "config-device-acceleration.h" #include "mbedtls/check_config.h" -#include "mbedtls/config_psa.h" diff --git a/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp b/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp index 15c678515a0e62..e45f38bcaeaf8e 100644 --- a/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp +++ b/src/platform/silabs/SiWx917/wifi/dhcp_client.cpp @@ -21,12 +21,6 @@ #include #include -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" - #include "dhcp_client.h" #include "lwip/dhcp.h" #include "wfx_host_events.h" diff --git a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp index d1fcc01f3c4f9b..13cc843d0e705d 100644 --- a/src/platform/silabs/SiWx917/wifi/ethernetif.cpp +++ b/src/platform/silabs/SiWx917/wifi/ethernetif.cpp @@ -21,12 +21,6 @@ #include #include -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" - #ifndef WF200_WIFI #include "FreeRTOS.h" #include "event_groups.h" @@ -182,141 +176,6 @@ static void low_level_input(struct netif * netif, uint8_t * b, uint16_t len) } } -/***************************************************************************** - * @fn static err_t low_level_output(struct netif *netif, struct pbuf *p) - * @brief - * This function should does the actual transmission of the packet(s). - * The packet is contained in the pbuf that is passed to the function. - * This pbuf might be chained. - * - * @param[in] netif: the lwip network interface structure - * - * @param[in] p: the packet to send - * - * @return - * ERR_OK if successful - ******************************************************************************/ -#ifdef WF200_WIFI -static err_t low_level_output(struct netif * netif, struct pbuf * p) -{ - struct pbuf * q; - sl_wfx_send_frame_req_t * tx_buffer; - uint8_t * buffer; - uint32_t framelength, asize; - uint32_t bufferoffset; - uint32_t padding; - sl_status_t result; - - for (q = p, framelength = 0; q != NULL; q = q->next) - { - framelength += q->len; - } - if (framelength < LWIP_FRAME_ALIGNMENT) - { /* 60 : Frame alignment for LWIP */ - padding = LWIP_FRAME_ALIGNMENT - framelength; - } - else - { - padding = 0; - } - - /* choose padding of 64 */ - asize = SL_WFX_ROUND_UP(framelength + padding, 64) + sizeof(sl_wfx_send_frame_req_t); - // 12 is size of other data in buffer struct, user shouldn't have to care about this? - if (sl_wfx_host_allocate_buffer((void **) &tx_buffer, SL_WFX_TX_FRAME_BUFFER, asize) != SL_STATUS_OK) - { - SILABS_LOG("*ERR*EN-Out: No mem frame len=%d", framelength); - gOverrunCount++; - SILABS_LOG("overrun count exiting when faied to alloc value %d", gOverrunCount); - return ERR_MEM; - } - buffer = tx_buffer->body.packet_data; - /* copy frame from pbufs to driver buffers */ - for (q = p, bufferoffset = 0; q != NULL; q = q->next) - { - /* Get bytes in current lwIP buffer */ - memcpy((uint8_t *) ((uint8_t *) buffer + bufferoffset), (uint8_t *) ((uint8_t *) q->payload), q->len); - bufferoffset += q->len; - } - /* No requirement to do this - but we should for security */ - if (padding) - { - memset(buffer + bufferoffset, 0, padding); - framelength += padding; - } - /* transmit */ - int i = 0; - result = SL_STATUS_FAIL; - -#ifdef WIFI_DEBUG_ENABLED - SILABS_LOG("WF200: Out %d", (int) framelength); -#endif - - /* send the generated frame over Wifi network */ - while ((result != SL_STATUS_OK) && (i++ < 10)) - { - result = sl_wfx_send_ethernet_frame(tx_buffer, framelength, SL_WFX_STA_INTERFACE, PRIORITY_0); - } - sl_wfx_host_free_buffer(tx_buffer, SL_WFX_TX_FRAME_BUFFER); - - if (result != SL_STATUS_OK) - { - SILABS_LOG("*ERR*Send enet %d", (int) framelength); - return ERR_IF; - } - return ERR_OK; -} - -/***************************************************************************** - * @fn void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t *rx_buffer) - * @brief - * This function implements the wf200 received frame callback. - * Called from the context of the bus_task (not ISR) - * - * @param[in] rx_buffer: the ethernet frame received by the wf200 - * - * @return - * None - ******************************************************************************/ -void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t * rx_buffer) -{ - struct netif * netif; - - /* Check packet interface to send to AP or STA interface */ - if ((rx_buffer->header.info & SL_WFX_MSG_INFO_INTERFACE_MASK) == (SL_WFX_STA_INTERFACE << SL_WFX_MSG_INFO_INTERFACE_OFFSET)) - { - - /* Send received frame to station interface */ - if ((netif = wfx_get_netif(SL_WFX_STA_INTERFACE)) != NULL) - { - uint8_t * buffer; - uint16_t len; - - len = rx_buffer->body.frame_length; - buffer = (uint8_t *) &(rx_buffer->body.frame[rx_buffer->body.frame_padding]); - -#ifdef WIFI_DEBUG_ENABLED - SILABS_LOG("WF200: In %d", (int) len); -#endif - - low_level_input(netif, buffer, len); - } - else - { -#ifdef WIFI_DEBUG_ENABLED - SILABS_LOG("WF200: NO-INTF"); -#endif - } - } - else - { -#ifdef WIFI_DEBUG_ENABLED - SILABS_LOG("WF200: Invalid frame IN"); -#endif - } -} - -#else /* For RS911x - using LWIP */ static SemaphoreHandle_t ethout_sem; /***************************************************************************** * @fn static err_t low_level_output(struct netif *netif, struct pbuf *p) @@ -422,8 +281,6 @@ void wfx_host_received_sta_frame_cb(uint8_t * buf, int len) } } -#endif /* RS911x - with LWIP */ - /***************************************************************************** * @fn err_t sta_ethernetif_init(struct netif *netif) * @brief @@ -452,10 +309,10 @@ err_t sta_ethernetif_init(struct netif * netif) /* initialize the hardware */ low_level_init(netif); -#ifndef WF200_WIFI + /* Need single output only */ ethout_sem = xSemaphoreCreateBinaryStatic(&xEthernetIfSemaBuffer); xSemaphoreGive(ethout_sem); -#endif + return ERR_OK; } diff --git a/src/platform/silabs/SiWx917/wifi/ethernetif.h b/src/platform/silabs/SiWx917/wifi/ethernetif.h index dfea1ea6ad3540..bac51b9258cd85 100644 --- a/src/platform/silabs/SiWx917/wifi/ethernetif.h +++ b/src/platform/silabs/SiWx917/wifi/ethernetif.h @@ -42,11 +42,8 @@ err_t sta_ethernetif_init(struct netif * netif); ******************************************************************************/ err_t ap_ethernetif_init(struct netif * netif); -#ifdef WF200_WIFI -void sl_wfx_host_received_frame_callback(sl_wfx_received_ind_t * rx_buffer); -#else void wfx_host_received_sta_frame_cb(uint8_t * buf, int len); -#endif /* WF200_WIFI */ + #ifdef __cplusplus } #endif diff --git a/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp b/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp index e19cf97a7cefd2..913f5895a94e53 100644 --- a/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp +++ b/src/platform/silabs/SiWx917/wifi/lwip_netif.cpp @@ -20,12 +20,6 @@ #include #include -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" - #include "wfx_host_events.h" #include "wifi_config.h" diff --git a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h index 5a7e8617a661e2..66e161d5f3b8cf 100644 --- a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h +++ b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h @@ -17,86 +17,7 @@ #pragma once -#ifdef WF200_WIFI -#include "FreeRTOS.h" -#include "event_groups.h" -#include "semphr.h" -#include "task.h" -#include "timers.h" - -#include "sl_wfx_cmd_api.h" -#include "sl_wfx_constants.h" - -typedef struct __attribute__((__packed__)) sl_wfx_get_counters_cnf_body_s -{ - uint32_t status; - uint16_t mib_id; - uint16_t length; - uint32_t rcpi; - uint32_t count_plcp_errors; - uint32_t count_fcs_errors; - uint32_t count_tx_packets; - uint32_t count_rx_packets; - uint32_t count_rx_packet_errors; - uint32_t count_rx_decryption_failures; - uint32_t count_rx_mic_failures; - uint32_t count_rx_no_key_failures; - uint32_t count_tx_multicast_frames; - uint32_t count_tx_frames_success; - uint32_t count_tx_frame_failures; - uint32_t count_tx_frames_retried; - uint32_t count_tx_frames_multi_retried; - uint32_t count_rx_frame_duplicates; - uint32_t count_rts_success; - uint32_t count_rts_failures; - uint32_t count_ack_failures; - uint32_t count_rx_multicast_frames; - uint32_t count_rx_frames_success; - uint32_t count_rx_cmacicv_errors; - uint32_t count_rx_cmac_replays; - uint32_t count_rx_mgmt_ccmp_replays; - uint32_t count_rx_bipmic_errors; - uint32_t count_rx_beacon; - uint32_t count_miss_beacon; - uint32_t reserved[15]; -} sl_wfx_get_counters_cnf_body_t; - -typedef struct __attribute__((__packed__)) sl_wfx_get_counters_cnf_s -{ - /** Common message header. */ - sl_wfx_header_t header; - /** Confirmation message body. */ - sl_wfx_get_counters_cnf_body_t body; -} sl_wfx_get_counters_cnf_t; - -typedef struct __attribute__((__packed__)) sl_wfx_mib_req_body_s -{ - uint16_t mib_id; ///< ID of the MIB to be read. - uint16_t reserved; -} sl_wfx_mib_req_body_t; - -typedef struct __attribute__((__packed__)) sl_wfx_header_mib_s -{ - uint16_t length; ///< Message length in bytes including this uint16_t. - ///< Maximum value is 8188 but maximum Request size is FW dependent and reported in the - ///< ::sl_wfx_startup_ind_body_t::size_inp_ch_buf. - uint8_t id; ///< Contains the message Id indexed by sl_wfx_general_commands_ids_t or sl_wfx_message_ids_t. - uint8_t reserved : 1; - uint8_t interface : 2; - uint8_t seqnum : 3; - uint8_t encrypted : 2; -} sl_wfx_header_mib_t; - -typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s -{ - /** Common message header. */ - sl_wfx_header_mib_t header; - /** Request message body. */ - sl_wfx_mib_req_body_t body; -} sl_wfx_mib_req_t; - -#else /* End WF200 else RS911x */ - +#include "stdbool.h" #include "wfx_msgs.h" /* Wi-Fi events*/ @@ -106,8 +27,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s #define SL_WFX_SCAN_COMPLETE_ID 4 #define WFX_RSI_SSID_SIZE 64 -#endif /* WF200 */ - #ifndef RS911X_SOCKETS /* LwIP includes. */ #include "lwip/apps/httpd.h" @@ -129,18 +48,11 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s #include "sl_status.h" -#ifdef RS911X_WIFI #define WLAN_TASK_STACK_SIZE 1024 -#define WLAN_TASK_PRIORITY 1 -#define WLAN_DRIVER_TASK_PRIORITY 1 +#define WLAN_TASK_PRIORITY 3 +#define WLAN_DRIVER_TASK_PRIORITY 2 #define MAX_JOIN_RETRIES_COUNT 5 -#else /* WF200 */ -#define WLAN_TASK_STACK_SIZE 1024 -#define WLAN_TASK_PRIORITY 1 -#define MAX_JOIN_RETRIES_COUNT 5 -#endif - // WLAN related Macros #define ETH_FRAME 0 #define CMP_SUCCESS 0 @@ -322,6 +234,7 @@ bool wfx_is_sta_mode_enabled(void); int32_t wfx_get_ap_info(wfx_wifi_scan_result_t * ap); int32_t wfx_get_ap_ext(wfx_wifi_scan_ext_t * extra_info); int32_t wfx_reset_counts(); +int32_t wfx_rsi_platform(); void wfx_clear_wifi_provision(void); sl_status_t wfx_connect_to_ap(void); @@ -364,12 +277,6 @@ void wfx_rsi_pkt_add_data(void * p, uint8_t * buf, uint16_t len, uint16_t off); int32_t wfx_rsi_send_data(void * p, uint16_t len); #endif /* RS911X_WIFI */ -#ifdef WF200_WIFI -void wfx_bus_start(void); -sl_status_t get_all_counters(void); -void sl_wfx_host_gpio_init(void); -sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload); -#endif #ifdef __cplusplus } #endif diff --git a/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp b/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp index 9f681e796c6d19..86bba1931446e7 100644 --- a/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp +++ b/src/platform/silabs/SiWx917/wifi/wfx_notify.cpp @@ -19,13 +19,6 @@ #include #include -#include "em_bus.h" -#include "em_cmu.h" -#include "em_gpio.h" -#include "em_ldma.h" -#include "em_usart.h" -#include "gpiointerrupt.h" - #include "AppConfig.h" #include "FreeRTOS.h" diff --git a/src/platform/silabs/SiWx917/wifi_args.gni b/src/platform/silabs/SiWx917/wifi_args.gni index 73a6613ecdcb4a..88d554d2f1040b 100644 --- a/src/platform/silabs/SiWx917/wifi_args.gni +++ b/src/platform/silabs/SiWx917/wifi_args.gni @@ -17,7 +17,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/pigweed.gni") -import("${chip_root}/examples/platform/silabs/efr32/args.gni") +import("${chip_root}/examples/platform/silabs/SiWx917/args.gni") import("${chip_root}/src/crypto/crypto.gni") # ARM architecture flags will be set based on silabs_family. @@ -25,11 +25,6 @@ arm_platform_config = "${efr32_sdk_build_root}/efr32_arm.gni" mbedtls_target = "${efr32_sdk_build_root}:efr32_sdk" -# default to platform crypto implementation but allow commandline override -if (chip_crypto == "") { - chip_crypto = "platform" -} - # Transitional CommissionableDataProvider not used anymore # examples/platform/efr32/EFR32DeviceDataProvider is now used. chip_use_transitional_commissionable_data_provider = false @@ -41,7 +36,7 @@ lwip_ipv4 = true lwip_api = true lwip_ethernet = true -chip_device_platform = "efr32" +chip_device_platform = "SiWx917" chip_enable_openthread = false chip_inet_config_enable_ipv4 = true chip_inet_config_enable_dns_resolver = false diff --git a/third_party/silabs/BUILD.gn b/third_party/silabs/BUILD.gn index f968d3dc38f13c..9c59de25de7056 100644 --- a/third_party/silabs/BUILD.gn +++ b/third_party/silabs/BUILD.gn @@ -16,7 +16,13 @@ import("//build_overrides/chip.gni") import("//build_overrides/efr32_sdk.gni") import("//build_overrides/jlink.gni") import("${chip_root}/src/platform/device.gni") -import("${efr32_sdk_build_root}/efr32_sdk.gni") +import("${efr32_sdk_build_root}/silabs_board.gni") + +if (silabs_board == "BRD4325A") { # CCP board + import("${efr32_sdk_build_root}/SiWx917_sdk.gni") +} else { + import("${efr32_sdk_build_root}/efr32_sdk.gni") +} declare_args() { # Build target to use for efr32 SDK. Use this to set global SDK defines. diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 38359a7c8a4063..5d6a857916320f 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -24,6 +24,8 @@ declare_args() { # Location of the efr32 SDK. efr32_sdk_root = "${chip_root}/third_party/silabs/gecko_sdk" sdk_support_root = "${chip_root}/third_party/silabs/matter_support" + wiseconnect_sdk_root = "${chip_root}/third_party/silabs/wisemcu-wifi-bt-sdk" + examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" # Build openthread with prebuilt silabs lib use_silabs_thread_lib = false @@ -35,9 +37,6 @@ declare_args() { # Use Silabs factory data provider example. # Users can implement their own. use_efr32_factory_data_provider = true - - # Enable Segger System View - use_system_view = false } # Explorer Kit and MGM240L do not have external flash @@ -67,12 +66,6 @@ template("efr32_sdk") { } assert(efr32_sdk_root != "", "efr32_sdk_root must be specified") - use_wf200 = false - if (defined(invoker.use_wf200)) { - if (invoker.use_wf200) { - use_wf200 = true - } - } sdk_target_name = target_name @@ -85,82 +78,30 @@ template("efr32_sdk") { # Treat these includes as system includes, so warnings in them are not fatal. _include_dirs = [ - "${efr32_sdk_root}", - "${efr32_sdk_root}/hardware/kit/common/bsp", - "${efr32_sdk_root}/app/common/util/app_assert/", - "${efr32_sdk_root}/hardware/board/inc", - "${efr32_sdk_root}/hardware/driver/memlcd/inc", - "${efr32_sdk_root}/hardware/driver/memlcd/src/ls013b7dh03", - "${efr32_sdk_root}/platform/bootloader", - "${efr32_sdk_root}/platform/bootloader/config", - "${efr32_sdk_root}/platform/bootloader/config/s2/btl_interface", - "${efr32_sdk_root}/platform/bootloader/api", - "${efr32_sdk_root}/platform/CMSIS/Core/Include", - "${efr32_sdk_root}/platform/CMSIS/RTOS2/Include", - "${efr32_sdk_root}/platform/common/inc", - "${efr32_sdk_root}/platform/driver/button/inc", - "${efr32_sdk_root}/platform/emdrv/common/inc", - "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/inc", - "${efr32_sdk_root}/platform/emdrv/dmadrv/config", - "${efr32_sdk_root}/platform/emdrv/dmadrv/inc", - "${efr32_sdk_root}/platform/emdrv/nvm3/inc", - "${efr32_sdk_root}/platform/emdrv/rtcdrv/inc", - "${efr32_sdk_root}/platform/emlib/inc", - "${efr32_sdk_root}/platform/halconfig/inc/hal-config", - "${efr32_sdk_root}/platform/peripheral/inc", - "${efr32_sdk_root}/platform/radio/rail_lib/common", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/rf/common/cortex", - "${efr32_sdk_root}/platform/radio/rail_lib/hal", - "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path", - "${efr32_sdk_root}/platform/service/device_init/inc", - "${efr32_sdk_root}/platform/service/hfxo_manager/config/", - "${efr32_sdk_root}/platform/service/hfxo_manager/inc", - "${efr32_sdk_root}/platform/service/hfxo_manager/src", - "${efr32_sdk_root}/platform/service/mpu/inc", - "${efr32_sdk_root}/platform/service/power_manager/config/", - "${efr32_sdk_root}/platform/service/power_manager/inc/", - "${efr32_sdk_root}/platform/service/power_manager/src/", - "${efr32_sdk_root}/platform/service/sleeptimer/inc", - "${efr32_sdk_root}/platform/service/sleeptimer/config", - "${efr32_sdk_root}/platform/service/system/inc", - "${efr32_sdk_root}/platform/service/udelay/inc", - "${efr32_sdk_root}/platform/service/legacy_hal/inc", - "${efr32_sdk_root}/platform/service/token_manager/config", - "${efr32_sdk_root}/platform/service/token_manager/inc", - "${efr32_sdk_root}/platform/service/token_manager/test", - "${efr32_sdk_root}/platform/service/token_manager/test/include", - "${efr32_sdk_root}/platform/service/token_manager/test/stack/config", - "${efr32_sdk_root}/platform/service/token_manager/test/stack/include", - "${efr32_sdk_root}/platform/middleware/glib", - "${efr32_sdk_root}/platform/middleware/glib/glib", - "${efr32_sdk_root}/platform/middleware/glib/dmd", - "${efr32_sdk_root}/platform/base/hal/plugin/psstore", - "${efr32_sdk_root}/platform/base/hal/plugin/antenna", - "${efr32_sdk_root}/protocol/bluetooth/inc/", - "${efr32_sdk_root}/app/bluetooth/common/in_place_ota_dfu/", - "${efr32_sdk_root}/util/plugin/plugin-common/fem-control", - "${efr32_sdk_root}/util/silicon_labs/silabs_core/graphics", - "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/include/psa", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/include", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/inc", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/config/", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/inc/public", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/inc", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/", - "${efr32_sdk_root}/util/third_party/freertos/cmsis/Include", - "${efr32_sdk_root}/util/third_party/freertos/kernel/include", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/config", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen", + "${sdk_support_root}/platform/emdrv/nvm3/inc", + + "${chip_root}/third_party/mbedtls/repo/include", + + ### CCP includes ### + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/inc", + "${wiseconnect_sdk_root}/platforms/si91x/core/chip/inc", + "${wiseconnect_sdk_root}/platforms/si91x/core/config", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver/config", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/rom_driver/inc", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/inc", + + "${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver/CMSIS/Driver/Include", + "${wiseconnect_sdk_root}/platforms/si91x/boards/brd4325a/inc", + "${wiseconnect_sdk_root}/platforms/si91x/core/cmsis", + "${wiseconnect_sdk_root}/third_party/freertos/include", + "${wiseconnect_sdk_root}/third_party/freertos/portable/GCC/ARM_CM4F", + "${examples_plat_dir}/device/inc", + + "${wiseconnect_sdk_root}/sapi/include", + + "${chip_root}/examples/platform/SiWx917/SiWx917", + "${chip_root}/examples/platform/SiWx917/SiWx917/hal", ] # Note that we're setting the mbedTLS and PSA configuration files through a @@ -169,13 +110,14 @@ template("efr32_sdk") { # To fix this, these files are also manually depended upon in the source set # declared in efr32_mbedtls_config further down this file. defines = [ - "MBEDTLS_CONFIG_FILE=\"efr32-chip-mbedtls-config.h\"", - "MBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"efr32-mbedtls-psa-crypto-config.h\"", + "MBEDTLS_CONFIG_FILE=\"siwx917-chip-mbedtls-config.h\"", "__STARTUP_CLEAR_BSS", "HARD_FAULT_LOG_ENABLE", "CORTEXM3_EFM32_MICRO", - "EFR32_LOG_ENABLED=1", - "NVM3_DEFAULT_NVM_SIZE=40960", + "SILABS_LOG_ENABLED=1", + + #Matter required at least 40960 but SiWx917 SoC requires an extra 20k to resolve nvm3_open() error, Need to be checked. + "NVM3_DEFAULT_NVM_SIZE=73728", "NVM3_DEFAULT_MAX_OBJECT_SIZE=4092", "KVS_MAX_ENTRIES=${kvs_max_entries}", "EFR32_OPENTHREAD_API", @@ -186,36 +128,18 @@ template("efr32_sdk") { "${silabs_mcu}=1", "${silabs_board}=1", "__HEAP_SIZE=0", - "SL_CATALOG_FREERTOS_KERNEL_PRESENT=1", - "MBEDTLS_THREADING_C=1", - "MBEDTLS_THREADING_ALT=1", - "SL_THREADING_ALT=1", "SL_COMPONENT_CATALOG_PRESENT", "PLATFORM_HEADER=\"platform-header.h\"", "USE_NVM3=1", - - #"__STACK_SIZE=0", + "RSI_ARM_CM4F", + "RSI_BLE_ENABLE=1", + "BRD4325A", + "CHIP_9117", + "RS91X_BLE_ENABLE=1", ] - if (use_system_view) { - _include_dirs += [ - "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10", - "${efr32_sdk_root}/util/third_party/segger/systemview/Config/", - ] - - defines += [ "SL_SYSTEM_VIEW=1" ] - } - defines += board_defines - if (use_wstk_leds) { - _include_dirs += [ "${efr32_sdk_root}/platform/driver/leddrv/inc" ] - - defines += [ "ENABLE_WSTK_LEDS" ] - } - if (defined(invoker.enable_sleepy_device)) { if (invoker.enable_sleepy_device) { defines += [ @@ -257,112 +181,11 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/emdrv/uartdrv/inc", "${efr32_sdk_root}/platform/emdrv/uartdrv/config", "${efr32_sdk_root}/hardware/driver/memlcd/inc/memlcd_usart", + "${efr32_sdk_root}/platform/common/errno/inc", ] } - if (silabs_family == "efr32mg12") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg1x", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg1x/config", - "${efr32_sdk_root}/platform/service/device_init/config/s1/", - "${efr32_sdk_root}/platform/emdrv/spidrv/inc", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/binapploader.o", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG12P/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg12_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a", - ] - - defines += [ "EFR32MG12" ] - } else if (silabs_family == "efr32mg21") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg21/config", - "${efr32_sdk_root}/platform/service/device_init/config/s2/", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG21/GCC/binapploader.o", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG21/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg21_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", - ] - - defines += [ - "EFR32MG21", - "EFR32_SERIES2_CONFIG1_MICRO", - ] - } else if (silabs_family == "efr32mg24") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", - "${efr32_sdk_root}/platform/service/device_init/config/s2/", - "${efr32_sdk_root}/platform/emdrv/spidrv/inc", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_efr32xg24_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", - ] - - defines += [ - "EFR32MG24", - "EFR32_SERIES2_CONFIG4_MICRO", - ] - } else if (silabs_family == "mgm24") { - _include_dirs += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Include", - "${efr32_sdk_root}/platform/radio/rail_lib/chip/efr32/efr32xg2x", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ble", - "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/efr32xg24/config", - "${efr32_sdk_root}/platform/service/device_init/config/s2/", - ] - - libs += [ - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libapploader.a", - "${sdk_support_root}/protocol/bluetooth/lib/EFR32MG24/GCC/libbluetooth.a", - "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_multiprotocol_module_efr32xg24_gcc_release.a", - "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM33_gcc.a", - ] - - if (silabs_mcu == "MGM240PB32VNA") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb32vna_gcc.a" ] - } else if (silabs_mcu == "MGM240PB22VNA") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240pb22vna_gcc.a" ] - } else if (silabs_mcu == "MGM240L022RNF") { - libs += [ "${sdk_support_root}/platform/radio/rail_lib/autogen/librail_release/librail_config_mgm240l022rnf_gcc.a" ] - } - - defines += [ - "MGM24", - "EFR32_SERIES2_CONFIG4_MICRO", - ] - } - - if (use_wf200) { - _include_dirs += [ - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/firmware", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/pds/brd8022a", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link", - ] - } + libs += [ "${sdk_support_root}/platform/emdrv/nvm3/lib/libnvm3_CM4_gcc.a" ] cflags = [] foreach(include_dir, _include_dirs) { @@ -390,14 +213,13 @@ template("efr32_sdk") { } } - source_set("efr32_mbedtls_config") { + source_set("si917_mbedtls_config") { # We're setting the mbedTLS config flags here as the efr32_sdk target # acts as the mbedTLS target for EFR32 builds. We need this for the build # system to recompile mbedTLS (= the SDK) when the mbedTLS config gets # edited. sources = [ - "${chip_root}/src/platform/silabs/EFR32/efr32-chip-mbedtls-config.h", - "${chip_root}/src/platform/silabs/EFR32/efr32-mbedtls-psa-crypto-config.h", + "${chip_root}/src/platform/silabs/SiWx917/siwx917-chip-mbedtls-config.h", ] public_deps = [ "${chip_root}/src/crypto:crypto_buildconfig" ] @@ -405,412 +227,91 @@ template("efr32_sdk") { source_set(sdk_target_name) { sources = [ - "${chip_root}/third_party/mbedtls/repo/include/mbedtls/platform.h", - "${efr32_sdk_root}/app/bluetooth/common/in_place_ota_dfu/sl_bt_in_place_ota_dfu.c", - "${efr32_sdk_root}/hardware/board/src/sl_board_control_gpio.c", - "${efr32_sdk_root}/hardware/board/src/sl_board_init.c", - "${efr32_sdk_root}/platform/CMSIS/RTOS2/Source/os_systick.c", - "${efr32_sdk_root}/platform/bootloader/api/btl_interface.c", - "${efr32_sdk_root}/platform/bootloader/api/btl_interface_storage.c", - "${efr32_sdk_root}/platform/bootloader/security/sha/crypto_sha.c", - "${efr32_sdk_root}/platform/common/src/sl_slist.c", - "${efr32_sdk_root}/platform/driver/button/src/sl_button.c", - "${efr32_sdk_root}/platform/driver/button/src/sl_simple_button.c", - "${efr32_sdk_root}/platform/emdrv/dmadrv/src/dmadrv.c", - "${efr32_sdk_root}/platform/emdrv/gpiointerrupt/src/gpiointerrupt.c", - "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default.c", - "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_hal_flash.c", - "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_lock.c", - "${efr32_sdk_root}/platform/emlib/src/em_adc.c", - "${efr32_sdk_root}/platform/emlib/src/em_cmu.c", - "${efr32_sdk_root}/platform/emlib/src/em_core.c", - "${efr32_sdk_root}/platform/emlib/src/em_crypto.c", - "${efr32_sdk_root}/platform/emlib/src/em_emu.c", - "${efr32_sdk_root}/platform/emlib/src/em_gpio.c", - "${efr32_sdk_root}/platform/emlib/src/em_ldma.c", - "${efr32_sdk_root}/platform/emlib/src/em_msc.c", - "${efr32_sdk_root}/platform/emlib/src/em_prs.c", - "${efr32_sdk_root}/platform/emlib/src/em_rmu.c", - "${efr32_sdk_root}/platform/emlib/src/em_rtcc.c", - "${efr32_sdk_root}/platform/emlib/src/em_se.c", - "${efr32_sdk_root}/platform/emlib/src/em_system.c", - "${efr32_sdk_root}/platform/emlib/src/em_timer.c", - "${efr32_sdk_root}/platform/peripheral/src/peripheral_sysrtc.c", - "${efr32_sdk_root}/platform/radio/rail_lib/hal/efr32/hal_efr.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_conversions_efr32.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti/sl_rail_util_pti.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfrco.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_nvic.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager.c", - "${efr32_sdk_root}/platform/service/legacy_hal/src/token_legacy.c", - "${efr32_sdk_root}/platform/service/mpu/src/sl_mpu.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_debug.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s0_s1.c", - "${efr32_sdk_root}/platform/service/power_manager/src/sl_power_manager_hal_s2.c", - "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer.c", - "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer_hal_rtcc.c", - "${efr32_sdk_root}/platform/service/sleeptimer/src/sl_sleeptimer_hal_sysrtc.c", - "${efr32_sdk_root}/platform/service/system/src/sl_system_init.c", - "${efr32_sdk_root}/platform/service/system/src/sl_system_kernel.c", - "${efr32_sdk_root}/platform/service/system/src/sl_system_process_action.c", - "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_def.c", - "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_manager.c", - "${efr32_sdk_root}/platform/service/token_manager/src/sl_token_manufacturing.c", - "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay.c", - "${efr32_sdk_root}/platform/service/udelay/src/sl_udelay_armv6m_gcc.S", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_mbedtls_context.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_rtos_adaptation.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_bt_stack_init.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sli_bt_advertiser_config.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sli_bt_connection_config.c", - "${efr32_sdk_root}/util/silicon_labs/silabs_core/memory_manager/sl_malloc.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aes.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/aesni.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1parse.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/asn1write.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/base64.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/bignum.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/camellia.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ccm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chacha20.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/chachapoly.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cipher_wrap.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/cmac.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/constant_time.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ctr_drbg.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/debug.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/des.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/dhm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecdh.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecdsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecjpake.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ecp_curves.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/entropy_poll.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/gcm.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hkdf.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/hmac_drbg.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/md.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/md5.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/oid.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pem.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pk.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pk_wrap.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkcs12.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkcs5.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkparse.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/pkwrite.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/platform_util.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/poly1305.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_client.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_driver_wrappers.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_ecp.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_rsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_se.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_slot_management.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_crypto_storage.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/psa_its_file.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ripemd160.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/rsa.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha1.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha256.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/sha512.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cache.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_ciphersuites.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cli.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_cookie.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_msg.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_srv.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_ticket.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_tls.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/ssl_tls13_keys.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/threading.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/timing.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/version.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_create.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crl.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_crt.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509_csr.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_crt.c", - "${efr32_sdk_root}/util/third_party/crypto/mbedtls/library/x509write_csr.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/aes_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/crypto_ecp.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/error.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ccm.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_cmac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_ecdsa_ecdh.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/mbedtls_sha.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_entropy_hardware.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/sl_mbedtls.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/version_features.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_crypto.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_protocol_crypto_radioaes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/crypto_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sl_psa_its_nvm3.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_crypto_trng_driver.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_common.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_driver_init.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_psa_trng.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_builtin_keys.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_signature.c", - "${efr32_sdk_root}/util/third_party/freertos/cmsis/Source/cmsis_os2.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/croutine.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/event_groups.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/list.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/queue.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/gatt_db.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_bluetooth.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_board_default_init.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_device_init_clocks.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_event_handler.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_button_instances.c", + "${examples_plat_dir}/device/src/startup_RS1xxxx.c", + "${sdk_support_root}/platform/emdrv/nvm3/src/ccp_flash_dev.c", + "${sdk_support_root}/platform/emdrv/nvm3/src/ccp_flash_intf.c", + "${sdk_support_root}/platform/emdrv/nvm3/src/ccp_flash_prg.c", + "${sdk_support_root}/platform/emdrv/nvm3/src/nvm3_default.c", + + ### nvm3 for ccp platform ### + "${sdk_support_root}/platform/emdrv/nvm3/src/nvm3_hal_flash_ccp.c", + "${sdk_support_root}/platform/emdrv/nvm3/src/nvm3_lock.c", + + ######## CCP Platform ######### + "${wiseconnect_sdk_root}/platforms/si91x/boards/brd4325a/src/rsi_board.c", + + #"${wiseconnect_sdk_root}/platforms/si91x/boards/brd4325a/src/syscalls.c", + "${wiseconnect_sdk_root}/platforms/si91x/core/chip/src/rsi_deepsleep_commonflash.c", + "${wiseconnect_sdk_root}/platforms/si91x/core/chip/src/rsi_ps_ram_func.c", + "${wiseconnect_sdk_root}/platforms/si91x/core/chip/src/rsi_system_config.c", + "${wiseconnect_sdk_root}/platforms/si91x/core/chip/src/system_RS1xxxx.c", + + #"${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver/UDMA.c", + #"${wiseconnect_sdk_root}/platforms/si91x/drivers/cmsis_driver/USART.c", + + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/src/clock_update.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/src/rsi_comparator.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/src/rsi_egpio.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/src/rsi_udma.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/src/rsi_udma_wrapper.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/peripheral_drivers/src/rsi_usart.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_ipmu.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_pll.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_power_save.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_processor_sensor.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_rtc.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_temp_sensor.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_time_period.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_ulpss_clk.c", + "${wiseconnect_sdk_root}/platforms/si91x/drivers/systemlevel/src/rsi_wwdt.c", + "${wiseconnect_sdk_root}/third_party/freertos/croutine.c", + "${wiseconnect_sdk_root}/third_party/freertos/event_groups.c", + "${wiseconnect_sdk_root}/third_party/freertos/list.c", + "${wiseconnect_sdk_root}/third_party/freertos/portable/GCC/ARM_CM4F/port.c", + "${wiseconnect_sdk_root}/third_party/freertos/queue.c", + "${wiseconnect_sdk_root}/third_party/freertos/stream_buffer.c", + "${wiseconnect_sdk_root}/third_party/freertos/tasks.c", + "${wiseconnect_sdk_root}/third_party/freertos/timers.c", + + # Bluetooth + "${wiseconnect_sdk_root}/sapi/bluetooth/rsi_ble_gap_apis.c", + "${wiseconnect_sdk_root}/sapi/bluetooth/rsi_ble_gatt_apis.c", + "${wiseconnect_sdk_root}/sapi/bluetooth/rsi_bt_common_apis.c", + "${wiseconnect_sdk_root}/sapi/driver/rsi_bt_ble.c", + + # mbedtls + "${chip_root}/third_party/mbedtls/repo/library/aes.c", + "${chip_root}/third_party/mbedtls/repo/library/asn1parse.c", + "${chip_root}/third_party/mbedtls/repo/library/asn1write.c", + "${chip_root}/third_party/mbedtls/repo/library/bignum.c", + "${chip_root}/third_party/mbedtls/repo/library/ccm.c", + "${chip_root}/third_party/mbedtls/repo/library/cipher.c", + "${chip_root}/third_party/mbedtls/repo/library/cipher_wrap.c", + "${chip_root}/third_party/mbedtls/repo/library/constant_time.c", + "${chip_root}/third_party/mbedtls/repo/library/ctr_drbg.c", + "${chip_root}/third_party/mbedtls/repo/library/ecdh.c", + "${chip_root}/third_party/mbedtls/repo/library/ecdsa.c", + "${chip_root}/third_party/mbedtls/repo/library/ecp.c", + "${chip_root}/third_party/mbedtls/repo/library/ecp_curves.c", + "${chip_root}/third_party/mbedtls/repo/library/entropy.c", + "${chip_root}/third_party/mbedtls/repo/library/hkdf.c", + "${chip_root}/third_party/mbedtls/repo/library/hmac_drbg.c", + "${chip_root}/third_party/mbedtls/repo/library/md.c", + "${chip_root}/third_party/mbedtls/repo/library/oid.c", + "${chip_root}/third_party/mbedtls/repo/library/pk.c", + "${chip_root}/third_party/mbedtls/repo/library/pk_wrap.c", + "${chip_root}/third_party/mbedtls/repo/library/pkcs5.c", + "${chip_root}/third_party/mbedtls/repo/library/pkwrite.c", + "${chip_root}/third_party/mbedtls/repo/library/platform.c", + "${chip_root}/third_party/mbedtls/repo/library/platform_util.c", + "${chip_root}/third_party/mbedtls/repo/library/sha256.c", + "${chip_root}/third_party/mbedtls/repo/library/sha512.c", + "${chip_root}/third_party/mbedtls/repo/library/x509_create.c", + "${chip_root}/third_party/mbedtls/repo/library/x509write_csr.c", ] - if (use_system_view) { - sources += [ - "${efr32_sdk_root}/util/third_party/segger/systemview/SEGGER/SEGGER_SYSVIEW.c", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/Config/Cortex-M/SEGGER_SYSVIEW_Config_FreeRTOS.c", - "${efr32_sdk_root}/util/third_party/segger/systemview/Sample/FreeRTOSV10/SEGGER_SYSVIEW_FreeRTOS.c", - ] - } - - if (use_wstk_leds) { - sources += [ - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_led.c", - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_pwm_led.c", - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_simple_led.c", - "${efr32_sdk_root}/platform/driver/leddrv/src/sl_simple_rgb_pwm_led.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_simple_led_instances.c", - ] - } - - # SPI is only used for Wifi - if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) { - sources += [ - "${efr32_sdk_root}/platform/emdrv/spidrv/src/spidrv.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_spidrv_init.c", - ] - } - - if (defined(invoker.enable_sleepy_device)) { - if (invoker.enable_sleepy_device) { - sources += [ "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/SiliconLabs/tick_power_manager.c" ] - } - } - - if (defined(enable_fem)) { - sources += [ - "${efr32_sdk_root}/util/plugin/plugin-common/fem-control/fem-control.c", - ] - } - - # USART sources files - if ((defined(invoker.chip_enable_pw_rpc) && invoker.chip_enable_pw_rpc) || - chip_build_libshell || enable_openthread_cli || - (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) || - (defined(invoker.show_qr_code) && invoker.show_qr_code) || - (defined(invoker.disable_lcd) && !invoker.disable_lcd) || - (defined(invoker.use_external_flash) && use_external_flash)) { - sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/memlcd_usart/sl_memlcd_spi.c", - "${efr32_sdk_root}/platform/emdrv/uartdrv/src/uartdrv.c", - "${efr32_sdk_root}/platform/emlib/src/em_eusart.c", - "${efr32_sdk_root}/platform/emlib/src/em_leuart.c", - "${efr32_sdk_root}/platform/emlib/src/em_usart.c", - "${sdk_support_root}/matter/efr32/${silabs_family}/${silabs_board}/autogen/sl_uartdrv_init.c", - ] - - if (defined(invoker.use_external_flash) && use_external_flash) { - sources += [ "${efr32_sdk_root}/hardware/driver/mx25_flash_shutdown/src/sl_mx25_flash_shutdown_usart/sl_mx25_flash_shutdown.c" ] - } - } - - if ((defined(invoker.show_qr_code) && invoker.show_qr_code) || - (defined(invoker.disable_lcd) && !invoker.disable_lcd)) { - sources += [ - "${efr32_sdk_root}/hardware/driver/memlcd/src/sl_memlcd.c", - "${efr32_sdk_root}/hardware/driver/memlcd/src/sl_memlcd_display.c", - "${efr32_sdk_root}/platform/middleware/glib/dmd/display/dmd_memlcd.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/bmp.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_bitmap.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_circle.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_narrow_6x8.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_normal_8x8.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_font_number_16x20.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_line.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_polygon.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_rectangle.c", - "${efr32_sdk_root}/platform/middleware/glib/glib/glib_string.c", - ] - } - - if (use_wf200) { - sources += [ - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus.c", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/bus/sl_wfx_bus_spi.c", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/secure_link/sl_wfx_secure_link.c", - "${efr32_sdk_root}/platform/radio/wifi/wfx_fmac_driver/sl_wfx.c", - ] - } - - if (silabs_family == "efr32mg12") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/startup_efr32mg12p.c", - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG12P/Source/system_efr32mg12p.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s1.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s1.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s1.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s1.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s1.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F/port.c", - ] - } else if (silabs_family == "efr32mg21") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/startup_efr32mg21.c", - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG21/Source/system_efr32mg21.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_rf_path/sl_rail_util_rf_path.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfrco.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_alt/source/sl_se_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_gcm.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", - ] - } else if (silabs_family == "efr32mg24") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/startup_efr32mg24.c", - "${efr32_sdk_root}/platform/Device/SiliconLabs/EFR32MG24/Source/system_efr32mg24.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s2.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", - ] - } else if (silabs_family == "mgm24") { - sources += [ - "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/startup_mgm24.c", - "${efr32_sdk_root}/platform/Device/SiliconLabs/MGM24/Source/system_mgm24.c", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions/pa_curves_efr32.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dcdc_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_emu_s2.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_hfxo_mgm24.c", - "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_lfxo_s2.c", - "${efr32_sdk_root}/platform/service/hfxo_manager/src/sl_hfxo_manager_hal_s2.c", - "${efr32_sdk_root}/protocol/bluetooth/src/sl_apploader_util_s2.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_attestation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_entropy.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_key_handling.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_signature.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/se_manager/src/sl_se_manager_util.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_aes.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_mbedtls_support/src/se_jpake.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_protocol_crypto/src/sli_radioaes_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_key_management.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_opaque_key_derivation.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_aead.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_cipher.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_hash.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_driver_mac.c", - "${efr32_sdk_root}/util/third_party/crypto/sl_component/sl_psa_driver/src/sli_se_transparent_key_derivation.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/port.c", - "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.c", - ] - } - - if (silabs_board == "BRD4186A" || silabs_board == "BRD4186C" || - silabs_board == "BRD4187A" || silabs_board == "BRD4187C") { - sources += [ "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_dpll_s2.c" ] - } - public_deps = [ - ":efr32_mbedtls_config", + ":si917_mbedtls_config", "${segger_rtt_root}:segger_rtt", "${segger_rtt_root}:segger_rtt_printf", "${segger_rtt_root}:segger_rtt_syscalls", diff --git a/third_party/silabs/efr32_arm.gni b/third_party/silabs/efr32_arm.gni index e1696309677ae2..68126f50843c8d 100644 --- a/third_party/silabs/efr32_arm.gni +++ b/third_party/silabs/efr32_arm.gni @@ -14,7 +14,7 @@ import("silabs_board.gni") -if (silabs_family == "efr32mg12") { +if (silabs_family == "efr32mg12" || silabs_family == "SiWx917") { arm_arch = "armv7e-m" arm_abi = "aapcs" arm_cpu = "cortex-m4" diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index b5fe904a1e9561..1e638c9351a2b6 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -59,6 +59,9 @@ if (silabs_board == "BRD4304A") { } else if (silabs_board == "BRD4170A") { silabs_family = "efr32mg12" silabs_mcu = "EFR32MG12P433F1024GM68" +} else if (silabs_board == "BRD4325A") { + silabs_family = "SiWx917" + silabs_mcu = "EFR32MG12P432F1024GL125" } else if (silabs_board == "BRD4180A") { assert( false, From 53e51d8675754be779187fbb569973c6949aff7a Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Thu, 1 Dec 2022 09:00:11 -0800 Subject: [PATCH 07/30] [Darwin] MTRDevice subscription should be non-fabric-filtered (#23473) --- src/darwin/Framework/CHIP/MTRDevice.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index a145394afd7871..7a7570b817e375 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -331,6 +331,7 @@ - (void)setupSubscription readParams.mpEventPathParamsList = eventPath.get(); readParams.mEventPathParamsListSize = 1; readParams.mKeepSubscriptions = true; + readParams.mIsFabricFiltered = false; attributePath.release(); eventPath.release(); From e0b529edc2637ca97d9e74ebb7ef253e15419261 Mon Sep 17 00:00:00 2001 From: rgoliver Date: Thu, 1 Dec 2022 13:00:19 -0500 Subject: [PATCH 08/30] Update Pigweed to 8659ed599 (#23741) --- examples/all-clusters-app/esp32/CMakeLists.txt | 4 ++++ examples/all-clusters-app/esp32/main/CMakeLists.txt | 1 + examples/all-clusters-minimal-app/esp32/CMakeLists.txt | 5 +++++ examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt | 1 + examples/chef/esp32/main/CMakeLists.txt | 1 + examples/lighting-app/esp32/CMakeLists.txt | 4 ++++ examples/lighting-app/esp32/main/CMakeLists.txt | 1 + examples/lock-app/esp32/CMakeLists.txt | 4 ++++ examples/ota-requestor-app/esp32/CMakeLists.txt | 4 ++++ examples/ota-requestor-app/esp32/main/CMakeLists.txt | 1 + examples/pigweed-app/esp32/CMakeLists.txt | 4 ++++ examples/platform/ameba/pw_sys_io/CMakeLists.txt | 4 +--- examples/platform/esp32/pw_sys_io/CMakeLists.txt | 3 +-- examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt | 4 +++- examples/platform/telink/pw_sys_io/CMakeLists.txt | 2 +- .../temperature-measurement-app/esp32/main/CMakeLists.txt | 1 + third_party/pigweed/repo | 2 +- 17 files changed, 38 insertions(+), 8 deletions(-) diff --git a/examples/all-clusters-app/esp32/CMakeLists.txt b/examples/all-clusters-app/esp32/CMakeLists.txt index 171db2102b0836..0a8752ca6bcc27 100644 --- a/examples/all-clusters-app/esp32/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/CMakeLists.txt @@ -53,6 +53,10 @@ flashing_script() if (CONFIG_ENABLE_PW_RPC) get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH) include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake) +include($ENV{PW_ROOT}/pw_assert/backend.cmake) +include($ENV{PW_ROOT}/pw_log/backend.cmake) +include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) +include($ENV{PW_ROOT}/pw_trace/backend.cmake) pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 1af642f45e4935..3293a8334d5e20 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -252,6 +252,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_log pw_rpc.server pw_sys_io + pw_trace pw_trace_tokenized pw_trace_tokenized.trace_buffer pw_trace_tokenized.rpc_service diff --git a/examples/all-clusters-minimal-app/esp32/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/CMakeLists.txt index 7bcb39178e6bee..c53fd3c05c92af 100644 --- a/examples/all-clusters-minimal-app/esp32/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/CMakeLists.txt @@ -53,6 +53,11 @@ flashing_script() if (CONFIG_ENABLE_PW_RPC) get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH) include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake) +include($ENV{PW_ROOT}/pw_assert/backend.cmake) +include($ENV{PW_ROOT}/pw_log/backend.cmake) +include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) +include($ENV{PW_ROOT}/pw_trace/backend.cmake) + pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) pw_set_backend(pw_log pw_log_basic) pw_set_backend(pw_assert.check pw_assert_log.check_backend) diff --git a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt index 31be1f41050a74..6b0dc3f6f0d6ca 100644 --- a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt @@ -243,6 +243,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_log pw_rpc.server pw_sys_io + pw_trace pw_trace_tokenized pw_trace_tokenized.trace_buffer pw_trace_tokenized.rpc_service diff --git a/examples/chef/esp32/main/CMakeLists.txt b/examples/chef/esp32/main/CMakeLists.txt index 777c891486b380..00a46722388cc9 100644 --- a/examples/chef/esp32/main/CMakeLists.txt +++ b/examples/chef/esp32/main/CMakeLists.txt @@ -194,6 +194,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_log pw_rpc.server pw_sys_io + pw_trace pw_trace_tokenized pw_trace_tokenized.trace_buffer pw_trace_tokenized.rpc_service diff --git a/examples/lighting-app/esp32/CMakeLists.txt b/examples/lighting-app/esp32/CMakeLists.txt index b865807ad8e076..746f70379ef1c1 100644 --- a/examples/lighting-app/esp32/CMakeLists.txt +++ b/examples/lighting-app/esp32/CMakeLists.txt @@ -53,6 +53,10 @@ flashing_script() if (CONFIG_ENABLE_PW_RPC) get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH) include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake) +include($ENV{PW_ROOT}/pw_assert/backend.cmake) +include($ENV{PW_ROOT}/pw_log/backend.cmake) +include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) +include($ENV{PW_ROOT}/pw_trace/backend.cmake) pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) diff --git a/examples/lighting-app/esp32/main/CMakeLists.txt b/examples/lighting-app/esp32/main/CMakeLists.txt index f7517c62295e8a..1e25058d3cb3d5 100644 --- a/examples/lighting-app/esp32/main/CMakeLists.txt +++ b/examples/lighting-app/esp32/main/CMakeLists.txt @@ -208,6 +208,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_log pw_rpc.server pw_sys_io + pw_trace pw_trace_tokenized pw_trace_tokenized.trace_buffer pw_trace_tokenized.rpc_service diff --git a/examples/lock-app/esp32/CMakeLists.txt b/examples/lock-app/esp32/CMakeLists.txt index 9cc498c3c6863a..24110deb8352c2 100644 --- a/examples/lock-app/esp32/CMakeLists.txt +++ b/examples/lock-app/esp32/CMakeLists.txt @@ -46,6 +46,10 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-error=maybe-uninitialized" APPEND) if (CONFIG_ENABLE_PW_RPC) get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH) include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake) +include($ENV{PW_ROOT}/pw_assert/backend.cmake) +include($ENV{PW_ROOT}/pw_log/backend.cmake) +include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) +include($ENV{PW_ROOT}/pw_trace/backend.cmake) pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) pw_set_backend(pw_log pw_log_basic) diff --git a/examples/ota-requestor-app/esp32/CMakeLists.txt b/examples/ota-requestor-app/esp32/CMakeLists.txt index 6d522a07c7d1fd..567bd30267ff78 100644 --- a/examples/ota-requestor-app/esp32/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/CMakeLists.txt @@ -46,6 +46,10 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-error=maybe-uninitialized" APPEND) if (CONFIG_ENABLE_PW_RPC) get_filename_component(CHIP_ROOT ./third_party/connectedhomeip REALPATH) include(third_party/connectedhomeip/third_party/pigweed/repo/pw_build/pigweed.cmake) +include($ENV{PW_ROOT}/pw_assert/backend.cmake) +include($ENV{PW_ROOT}/pw_log/backend.cmake) +include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) +include($ENV{PW_ROOT}/pw_trace/backend.cmake) pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) pw_set_backend(pw_log pw_log_basic) diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt index 184e29acd10a32..c711b84c438ef5 100644 --- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -177,6 +177,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_log pw_rpc.server pw_sys_io + pw_trace pw_trace_tokenized pw_trace_tokenized.trace_buffer pw_trace_tokenized.rpc_service diff --git a/examples/pigweed-app/esp32/CMakeLists.txt b/examples/pigweed-app/esp32/CMakeLists.txt index 81aa021ac5d815..08d38727e94e1b 100644 --- a/examples/pigweed-app/esp32/CMakeLists.txt +++ b/examples/pigweed-app/esp32/CMakeLists.txt @@ -47,6 +47,10 @@ set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) +include($ENV{PW_ROOT}/pw_assert/backend.cmake) +include($ENV{PW_ROOT}/pw_log/backend.cmake) +include($ENV{PW_ROOT}/pw_sys_io/backend.cmake) +include($ENV{PW_ROOT}/pw_trace/backend.cmake) pw_set_module_config(pw_rpc_CONFIG pw_rpc.disable_global_mutex_config) pw_set_backend(pw_log pw_log_basic) diff --git a/examples/platform/ameba/pw_sys_io/CMakeLists.txt b/examples/platform/ameba/pw_sys_io/CMakeLists.txt index c0ff32a9f695cb..04bc802eda0eb8 100644 --- a/examples/platform/ameba/pw_sys_io/CMakeLists.txt +++ b/examples/platform/ameba/pw_sys_io/CMakeLists.txt @@ -1,11 +1,9 @@ include($ENV{PW_ROOT}/pw_build/pigweed.cmake) # This is compiled in gn build, just provide headers and let linker sort it out. -pw_add_module_library(pw_sys_io.ameba - SOURCES +pw_add_library(pw_sys_io.ameba INTERFACE PRIVATE_DEPS pw_sys_io HEADERS public ) - diff --git a/examples/platform/esp32/pw_sys_io/CMakeLists.txt b/examples/platform/esp32/pw_sys_io/CMakeLists.txt index 2ca42f77764a91..7002fb633d5b23 100644 --- a/examples/platform/esp32/pw_sys_io/CMakeLists.txt +++ b/examples/platform/esp32/pw_sys_io/CMakeLists.txt @@ -1,8 +1,7 @@ include($ENV{PW_ROOT}/pw_build/pigweed.cmake) # This is compiled in gn build, just provide headers and let linker sort it out. -pw_add_module_library(pw_sys_io.esp32 - SOURCES +pw_add_library(pw_sys_io.esp32 INTERFACE PRIVATE_DEPS pw_sys_io HEADERS diff --git a/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt b/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt index 9e3a33c158b099..329a95cc7ff8cc 100644 --- a/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt +++ b/examples/platform/nrfconnect/pw_sys_io/CMakeLists.txt @@ -8,9 +8,11 @@ target_compile_options(suppress_zephyr_warnings INTERFACE -Wno-undef ) -pw_add_module_library(pw_sys_io.nrfconnect +pw_add_library(pw_sys_io.nrfconnect STATIC SOURCES sys_io_nrfconnect.cc + PUBLIC_INCLUDES + public PRIVATE_DEPS pw_sys_io suppress_zephyr_warnings diff --git a/examples/platform/telink/pw_sys_io/CMakeLists.txt b/examples/platform/telink/pw_sys_io/CMakeLists.txt index 43263ad2fad2dc..f8675a4ec1f05a 100644 --- a/examples/platform/telink/pw_sys_io/CMakeLists.txt +++ b/examples/platform/telink/pw_sys_io/CMakeLists.txt @@ -8,7 +8,7 @@ target_compile_options(suppress_zephyr_warnings INTERFACE -Wno-undef ) -pw_add_module_library(pw_sys_io.telink +pw_add_library(pw_sys_io.telink STATIC SOURCES sys_io_telink.cc PRIVATE_DEPS diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index 68e49f160f79e0..dbf518ff18844a 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -168,6 +168,7 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC pw_log pw_rpc.server pw_sys_io + pw_trace pw_trace_tokenized pw_trace_tokenized.trace_buffer pw_trace_tokenized.rpc_service diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index 9264e6862cc408..8659ed5997578e 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit 9264e6862cc40868a902e5e4ac4e43e2f7eb040d +Subproject commit 8659ed5997578ec62e89029a8e7b450b665d374d From d68ea642b9a7172207bdb73e49b10597a78d79d7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 15:35:13 -0500 Subject: [PATCH 09/30] Fix some loose ends from the acronym casing Darwin changes. (#23845) * Fix deprecation messages to reference the right selectors. * Fix bitmaps to handle cluster renames the same way enums do, instead of hardcoding UnitTesting/TestCluster. --- .../CHIP/templates/MTRBaseClusters.zapt | 34 ++++++-------- .../CHIP/zap-generated/MTRBaseClusters.h | 46 +++++++++---------- 2 files changed, 37 insertions(+), 43 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index e4135a870d455b..2184b7296fab3b 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -88,9 +88,6 @@ MTR_NEWLY_DEPRECATED("Please use {{objCEnumName (asUpperCamelCase ../name preser {{/unless}} ; -{{#if (isStrEqual (asUpperCamelCase ../name) "UnitTesting")}} - -{{/if}} {{/zcl_enums}} {{#zcl_bitmaps}} {{#*inline "bitmapDef"}} @@ -100,29 +97,26 @@ typedef NS_OPTIONS({{asUnderlyingZclType name}}, {{objCEnumName clusterName labe {{/zcl_bitmap_items}} } {{! TODO: We need a better setup for the API_AVALABLE annotations here; this does not scale at all sanely. }} -{{#if (isStrEqual (asUpperCamelCase ../name) "Switch")}} +{{#if (isStrEqual (asUpperCamelCase clusterName) "Switch")}} {{#if (isStrEqual (asUpperCamelCase label) "SwitchFeature")}} API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) {{/if}} {{/if}} -{{#if (isStrEqual (asUpperCamelCase ../name) "MediaPlayback")}} +{{#if (isStrEqual (asUpperCamelCase clusterName) "MediaPlayback")}} {{#if (isStrEqual (asUpperCamelCase label) "MediaPlaybackFeature")}} API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) {{/if}} {{/if}} -{{#if (isStrEqual (asUpperCamelCase clusterName) "UnitTesting")}} -MTR_NEWLY_AVAILABLE -{{else if (isStrEqual (asUpperCamelCase clusterName) "TestCluster")}} -MTR_NEWLY_DEPRECATED("Please use {{objCEnumName "UnitTesting" label}}") -{{/if}} -; {{/inline}} -{{> bitmapDef name=name clusterName=../name label=label}} +{{> bitmapDef name=name clusterName=(asUpperCamelCase ../name preserveAcronyms=true) label=label}} +{{#unless (isStrEqual (asUpperCamelCase ../name preserveAcronyms=true) (compatClusterNameRemapping ../name))}} +MTR_NEWLY_AVAILABLE; -{{#if (isStrEqual (asUpperCamelCase ../name) "UnitTesting")}} -{{> bitmapDef name=name clusterName="TestCluster" label=label}} +{{> bitmapDef name=name clusterName=(compatClusterNameRemapping ../name) label=label}} +MTR_NEWLY_DEPRECATED("Please use {{objCEnumName (asUpperCamelCase ../name preserveAcronyms=true) label}}") +{{/unless}} +; -{{/if}} {{/zcl_bitmaps}} {{/zcl_clusters}} @@ -153,21 +147,21 @@ MTR_NEWLY_DEPRECATED("Please use {{objCEnumName "UnitTesting" label}}") CompletionHandler: {{~/if_is_fabric_scoped_struct~}} (void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{#if (isStrEqual (asUpperCamelCase parent.name) "UnitTesting")}}{{#if (isStrEqual (asUpperCamelCase name) "WriteOnlyInt8u")}}API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)){{/if}}{{/if}} - MTR_NEWLY_DEPRECATED("Please use read{{>attribute}}With{{#if_is_fabric_scoped_struct type}}Params:completion:{{else}}Completion:{{/if_is_fabric_scoped_struct}}"); + MTR_NEWLY_DEPRECATED("Please use readAttribute{{asUpperCamelCase name preserveAcronyms=true}}With{{#if_is_fabric_scoped_struct type}}Params:completion:{{else}}Completion:{{/if_is_fabric_scoped_struct}}"); {{#if isWritableAttribute}} - (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name compatRemapClusterName=true}})value completionHandler:(MTRStatusCompletion)completionHandler {{#if (isStrEqual (asUpperCamelCase parent.name) "UnitTesting")}}{{#if (isStrEqual (asUpperCamelCase name) "WriteOnlyInt8u")}}API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)){{/if}}{{/if}} - MTR_NEWLY_DEPRECATED("Please use write{{>attribute}}WithValue:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttribute{{asUpperCamelCase name preserveAcronyms=true}}WithValue:completion:"); - (void)write{{>attribute}}WithValue:({{asObjectiveCType type parent.name compatRemapClusterName=true}})value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler {{#if (isStrEqual (asUpperCamelCase parent.name) "UnitTesting")}}{{#if (isStrEqual (asUpperCamelCase name) "WriteOnlyInt8u")}}API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)){{/if}}{{/if}} - MTR_NEWLY_DEPRECATED("Please use write{{>attribute}}WithValue:params:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttribute{{asUpperCamelCase name preserveAcronyms=true}}WithValue:params:completion:"); {{/if}} {{#if isReportableAttribute}} {{! TODO: We need a better setup for the API_AVALABLE annotations here; this does not scale at all sanely. }} - (void) subscribe{{>attribute}}WithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))reportHandler {{#if (isStrEqual (asUpperCamelCase parent.name) "UnitTesting")}}{{#if (isStrEqual (asUpperCamelCase name) "WriteOnlyInt8u")}}API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)){{/if}}{{/if}} - MTR_NEWLY_DEPRECATED("Please use subscribe{{>attribute}}WithParams:subscriptionEstablished:"); + MTR_NEWLY_DEPRECATED("Please use subscribeAttribute{{asUpperCamelCase name preserveAcronyms=true}}WithParams:subscriptionEstablished:"); + (void) read{{>attribute}}WithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)({{asObjectiveCClass type parent.name compatRemapClusterName=true}} * _Nullable value, NSError * _Nullable error))completionHandler {{#if (isStrEqual (asUpperCamelCase parent.name) "UnitTesting")}}{{#if (isStrEqual (asUpperCamelCase name) "WriteOnlyInt8u")}}API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)){{/if}}{{/if}} - MTR_NEWLY_DEPRECATED("Please use read{{>attribute}}WithAttributeCache:endpoint:queue:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttribute{{asUpperCamelCase name preserveAcronyms=true}}WithAttributeCache:endpoint:queue:completion:"); {{/if}} {{/chip_server_cluster_attributes}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 4401bd2ac09009..c95fbc82912b39 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -18977,18 +18977,18 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { - (void)readAttributeDeviceListWithCompletionHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributeDeviceListWithCompletion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributeDeviceTypeListWithCompletion:"); - (void)subscribeAttributeDeviceListWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_DEPRECATED("Please use subscribeAttributeDeviceListWithParams:subscriptionEstablished:"); + MTR_NEWLY_DEPRECATED("Please use subscribeAttributeDeviceTypeListWithParams:subscriptionEstablished:"); + (void)readAttributeDeviceListWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributeDeviceListWithAttributeCache:endpoint:queue:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributeDeviceTypeListWithAttributeCache:endpoint:queue:completion:"); - (void)readAttributeServerListWithCompletionHandler: (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler @@ -19243,25 +19243,25 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { - (void)readAttributeAclWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributeAclWithParams:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributeACLWithParams:completion:"); - (void)writeAttributeAclWithValue:(NSArray * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributeAclWithValue:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributeACLWithValue:completion:"); - (void)writeAttributeAclWithValue:(NSArray * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributeAclWithValue:params:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributeACLWithValue:params:completion:"); - (void)subscribeAttributeAclWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_DEPRECATED("Please use subscribeAttributeAclWithParams:subscriptionEstablished:"); + MTR_NEWLY_DEPRECATED("Please use subscribeAttributeACLWithParams:subscriptionEstablished:"); + (void)readAttributeAclWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributeAclWithAttributeCache:endpoint:queue:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributeACLWithAttributeCache:endpoint:queue:completion:"); - (void)readAttributeExtensionWithParams:(MTRReadParams * _Nullable)params completionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler @@ -32044,14 +32044,14 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { - (void)readAttributePirOccupiedToUnoccupiedDelayWithCompletionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributePirOccupiedToUnoccupiedDelayWithCompletion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributePIROccupiedToUnoccupiedDelayWithCompletion:"); - (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributePirOccupiedToUnoccupiedDelayWithValue:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributePIROccupiedToUnoccupiedDelayWithValue:completion:"); - (void)writeAttributePirOccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributePirOccupiedToUnoccupiedDelayWithValue:params:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributePIROccupiedToUnoccupiedDelayWithValue:params:completion:"); - (void)subscribeAttributePirOccupiedToUnoccupiedDelayWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params @@ -32059,24 +32059,24 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { (MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_DEPRECATED("Please use subscribeAttributePirOccupiedToUnoccupiedDelayWithParams:subscriptionEstablished:"); + MTR_NEWLY_DEPRECATED("Please use subscribeAttributePIROccupiedToUnoccupiedDelayWithParams:subscriptionEstablished:"); + (void)readAttributePirOccupiedToUnoccupiedDelayWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributePirOccupiedToUnoccupiedDelayWithAttributeCache:endpoint:queue:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributePIROccupiedToUnoccupiedDelayWithAttributeCache:endpoint:queue:completion:"); - (void)readAttributePirUnoccupiedToOccupiedDelayWithCompletionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributePirUnoccupiedToOccupiedDelayWithCompletion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributePIRUnoccupiedToOccupiedDelayWithCompletion:"); - (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributePirUnoccupiedToOccupiedDelayWithValue:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributePIRUnoccupiedToOccupiedDelayWithValue:completion:"); - (void)writeAttributePirUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributePirUnoccupiedToOccupiedDelayWithValue:params:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributePIRUnoccupiedToOccupiedDelayWithValue:params:completion:"); - (void)subscribeAttributePirUnoccupiedToOccupiedDelayWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params @@ -32084,24 +32084,24 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { (MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_DEPRECATED("Please use subscribeAttributePirUnoccupiedToOccupiedDelayWithParams:subscriptionEstablished:"); + MTR_NEWLY_DEPRECATED("Please use subscribeAttributePIRUnoccupiedToOccupiedDelayWithParams:subscriptionEstablished:"); + (void)readAttributePirUnoccupiedToOccupiedDelayWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributePirUnoccupiedToOccupiedDelayWithAttributeCache:endpoint:queue:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributePIRUnoccupiedToOccupiedDelayWithAttributeCache:endpoint:queue:completion:"); - (void)readAttributePirUnoccupiedToOccupiedThresholdWithCompletionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributePirUnoccupiedToOccupiedThresholdWithCompletion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributePIRUnoccupiedToOccupiedThresholdWithCompletion:"); - (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributePirUnoccupiedToOccupiedThresholdWithValue:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributePIRUnoccupiedToOccupiedThresholdWithValue:completion:"); - (void)writeAttributePirUnoccupiedToOccupiedThresholdWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler - MTR_NEWLY_DEPRECATED("Please use writeAttributePirUnoccupiedToOccupiedThresholdWithValue:params:completion:"); + MTR_NEWLY_DEPRECATED("Please use writeAttributePIRUnoccupiedToOccupiedThresholdWithValue:params:completion:"); - (void)subscribeAttributePirUnoccupiedToOccupiedThresholdWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params @@ -32109,13 +32109,13 @@ typedef NS_ENUM(uint8_t, MTRFaultInjectionFaultType) { (MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_DEPRECATED("Please use subscribeAttributePirUnoccupiedToOccupiedThresholdWithParams:subscriptionEstablished:"); + MTR_NEWLY_DEPRECATED("Please use subscribeAttributePIRUnoccupiedToOccupiedThresholdWithParams:subscriptionEstablished:"); + (void)readAttributePirUnoccupiedToOccupiedThresholdWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler - MTR_NEWLY_DEPRECATED("Please use readAttributePirUnoccupiedToOccupiedThresholdWithAttributeCache:endpoint:queue:completion:"); + MTR_NEWLY_DEPRECATED("Please use readAttributePIRUnoccupiedToOccupiedThresholdWithAttributeCache:endpoint:queue:completion:"); - (void)readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler From efbb120f40868dcd1cbc58b443cc57c0445a3789 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 16:19:53 -0500 Subject: [PATCH 10/30] Make sure we don't use the Matter dispatch queue when it's not running. (#23859) We've had issues where things get queued to the Matter dispatch queue while it's not running, and then when we start it up again those things run too early in startup and break in interesting ways. The fix is to make sure we only queue things to the Matter dispatch queue when they're associated with a currently-running controller. Fixes https://github.com/project-chip/connectedhomeip/issues/22847 --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 85 +- .../CHIP/MTRCallbackBridgeBase_internal.h | 35 +- .../CHIP/MTRClusterStateCacheContainer.mm | 153 +- .../MTRClusterStateCacheContainer_Internal.h | 5 +- .../CHIP/templates/MTRBaseClusters-src.zapt | 2 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 28617 ++++++++-------- 6 files changed, 14904 insertions(+), 13993 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index c5cbd062975dce..eb39a8609f7350 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -107,7 +107,24 @@ static void AddReadClientContainer(uint64_t deviceId, MTRReadClientContainer * c [readClientContainersLock unlock]; } -static void PurgeReadClientContainers(uint64_t deviceId, dispatch_queue_t queue, void (^_Nullable completion)(void)) +static void ReinstateReadClientList(NSMutableArray * readClientList, NSNumber * key, + dispatch_queue_t queue, dispatch_block_t _Nullable completion) +{ + [readClientContainersLock lock]; + auto existingList = readClientContainers[key]; + if (existingList) { + [existingList addObjectsFromArray:readClientList]; + } else { + readClientContainers[key] = readClientList; + } + [readClientContainersLock unlock]; + if (completion) { + dispatch_async(queue, completion); + } +} + +static void PurgeReadClientContainers( + MTRDeviceController * controller, uint64_t deviceId, dispatch_queue_t queue, void (^_Nullable completion)(void)) { InitializeReadClientContainers(); @@ -119,22 +136,28 @@ static void PurgeReadClientContainers(uint64_t deviceId, dispatch_queue_t queue, [readClientContainersLock unlock]; // Destroy read clients in the work queue - dispatch_async(DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ - for (MTRReadClientContainer * container in listToDelete) { - if (container.readClientPtr) { - Platform::Delete(container.readClientPtr); - container.readClientPtr = nullptr; + [controller + asyncDispatchToMatterQueue:^(Controller::DeviceCommissioner * commissioner) { + for (MTRReadClientContainer * container in listToDelete) { + if (container.readClientPtr) { + Platform::Delete(container.readClientPtr); + container.readClientPtr = nullptr; + } + if (container.pathParams) { + Platform::Delete(container.pathParams); + container.pathParams = nullptr; + } } - if (container.pathParams) { - Platform::Delete(container.pathParams); - container.pathParams = nullptr; + [listToDelete removeAllObjects]; + if (completion) { + dispatch_async(queue, completion); } } - [listToDelete removeAllObjects]; - if (completion) { - dispatch_async(queue, completion); - } - }); + errorHandler:^(NSError * error) { + // Can't delete things. Just put them back, and hope we + // can delete them later. + ReinstateReadClientList(listToDelete, key, queue, completion); + }]; } static void PurgeCompletedReadClientContainers(uint64_t deviceId) @@ -157,7 +180,8 @@ static void PurgeCompletedReadClientContainers(uint64_t deviceId) #ifdef DEBUG // This function is for unit testing only. This function closes all read clients. -static void CauseReadClientFailure(uint64_t deviceId, dispatch_queue_t queue, void (^_Nullable completion)(void)) +static void CauseReadClientFailure( + MTRDeviceController * controller, uint64_t deviceId, dispatch_queue_t queue, void (^_Nullable completion)(void)) { InitializeReadClientContainers(); @@ -168,18 +192,23 @@ static void CauseReadClientFailure(uint64_t deviceId, dispatch_queue_t queue, vo [readClientContainers removeObjectForKey:key]; [readClientContainersLock unlock]; - dispatch_async(DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ - for (MTRReadClientContainer * container in listToFail) { - // Send auto resubscribe request again by read clients, which must fail. - chip::app::ReadPrepareParams readParams; - if (container.readClientPtr) { - container.readClientPtr->SendAutoResubscribeRequest(std::move(readParams)); + [controller + asyncDispatchToMatterQueue:^(Controller::DeviceCommissioner * commissioner) { + for (MTRReadClientContainer * container in listToFail) { + // Send auto resubscribe request again by read clients, which must fail. + chip::app::ReadPrepareParams readParams; + if (container.readClientPtr) { + container.readClientPtr->SendAutoResubscribeRequest(std::move(readParams)); + } + } + if (completion) { + dispatch_async(queue, completion); } } - if (completion) { - dispatch_async(queue, completion); - } - }); + errorHandler:^(NSError * error) { + // Can't fail things. Just put them back. + ReinstateReadClientList(listToFail, key, queue, completion); + }]; } #endif @@ -321,6 +350,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue MTRClusterStateCacheContainer * container = weakPtr; if (container) { container.cppClusterStateCache = nullptr; + container.baseDevice = nil; } }; } @@ -393,6 +423,7 @@ - (void)subscribeWithQueue:(dispatch_queue_t)queue clusterStateCacheContainer.cppClusterStateCache = clusterStateCache.get(); // ClusterStateCache will be deleted when OnDone is called. callback->AdoptClusterStateCache(std::move(clusterStateCache)); + clusterStateCacheContainer.baseDevice = self; } // Callback and ReadClient will be deleted when OnDone is called. callback->AdoptReadClient(std::move(readClient)); @@ -1243,7 +1274,7 @@ - (void)deregisterReportHandlersWithQueue:(dispatch_queue_t)queue completion:(di { // This method must only be used for MTRDeviceOverXPC. However, for unit testing purpose, the method purges all read clients. MTR_LOG_DEBUG("Unexpected call to deregister report handlers"); - PurgeReadClientContainers(self.nodeID, queue, completion); + PurgeReadClientContainers(self.deviceController, self.nodeID, queue, completion); } namespace { @@ -1389,7 +1420,7 @@ - (void)openCommissioningWindowWithSetupPasscode:(NSNumber *)setupPasscode - (void)failSubscribers:(dispatch_queue_t)queue completion:(void (^)(void))completion { MTR_LOG_DEBUG("Causing failure in subscribers on purpose"); - CauseReadClientFailure(self.nodeID, queue, completion); + CauseReadClientFailure(self.deviceController, self.nodeID, queue, completion); } #endif diff --git a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h index 2205023338a214..c6ef366925302f 100644 --- a/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h +++ b/src/darwin/Framework/CHIP/MTRCallbackBridgeBase_internal.h @@ -121,29 +121,38 @@ template class MTRCallbackBridge : public MTRCallbackBridgeBase { } /** - * Run the given MTRLocalActionBlock on the Matter thread, then handle + * Try to run the given MTRLocalActionBlock on the Matter thread, if we have + * a device and it's attached to a running controller, then handle * converting the value produced by the success callback to the right type * so it can be passed to a callback of the type we're templated over. * * Does not attempt to establish any sessions to devices. Must not be used * with any action blocks that need a session. */ - void DispatchLocalAction(MTRLocalActionBlock _Nonnull action) + void DispatchLocalAction(MTRBaseDevice * _Nullable device, MTRLocalActionBlock _Nonnull action) { - LogRequestStart(); + if (!device) { + OnFailureFn(this, CHIP_ERROR_INCORRECT_STATE); + return; + } - // For now keep sync dispatch here. - dispatch_sync(chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ - CHIP_ERROR err = action(mSuccess, mFailure); - if (err != CHIP_NO_ERROR) { - NSLog(@"Failure performing action. C++-mangled success callback type: '%s', error: %s", typeid(T).name(), - chip::ErrorStr(err)); + LogRequestStart(); - // Take the normal async error-reporting codepath. This will also - // handle cleaning us up properly. - OnFailureFn(this, err); + [device.deviceController + asyncDispatchToMatterQueue:^(chip::Controller::DeviceCommissioner *) { + CHIP_ERROR err = action(mSuccess, mFailure); + if (err != CHIP_NO_ERROR) { + NSLog(@"Failure performing action. C++-mangled success callback type: '%s', error: %s", typeid(T).name(), + chip::ErrorStr(err)); + + // Take the normal async error-reporting codepath. This will also + // handle cleaning us up properly. + OnFailureFn(this, err); + } } - }); + errorHandler:^(NSError * error) { + DispatchFailure(this, error); + }]; } void ActionWithPASEDevice(MTRBaseDevice * device) diff --git a/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer.mm b/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer.mm index 72c5517d28f13e..7550e1ef3f2448 100644 --- a/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer.mm +++ b/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer.mm @@ -21,6 +21,7 @@ #import "MTRCluster.h" #import "MTRClusterStateCacheContainer_Internal.h" #import "MTRDeviceControllerXPCConnection.h" +#import "MTRDeviceController_Internal.h" #import "MTRError.h" #import "MTRError_Internal.h" #import "MTRLogging_Internal.h" @@ -31,12 +32,20 @@ using namespace chip; +@interface MTRClusterStateCacheContainer () +@property (nonatomic, readwrite, copy) NSNumber * deviceID; +@property (nonatomic, readwrite, weak, nullable) MTRDeviceControllerXPCConnection * xpcConnection; +@property (nonatomic, readwrite, strong, nullable) id xpcControllerID; +@property (atomic, readwrite) BOOL shouldUseXPC; +@end + @implementation MTRClusterStateCacheContainer - (instancetype)init { if ([super init]) { _cppClusterStateCache = nullptr; + _baseDevice = nil; _shouldUseXPC = NO; } return self; @@ -94,7 +103,7 @@ - (void)readAttributesWithEndpointID:(NSNumber * _Nullable)endpointID MTRDeviceControllerXPCConnection * xpcConnection = self.xpcConnection; if (!xpcConnection) { MTR_LOG_ERROR("Attribute cache read failed: MTRDeviceController was already disposed"); - completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); return; } __auto_type controllerId = self.xpcControllerID; @@ -102,81 +111,93 @@ - (void)readAttributesWithEndpointID:(NSNumber * _Nullable)endpointID [xpcConnection getProxyHandleWithCompletion:^(dispatch_queue_t _Nonnull queue, MTRDeviceControllerXPCProxyHandle * _Nullable handle) { if (handle) { - [handle.proxy readAttributeCacheWithController:controllerId - nodeId:nodeId.unsignedLongLongValue - endpointId:endpointID - clusterId:clusterID - attributeId:attributeID - completion:^(id _Nullable values, NSError * _Nullable error) { - completion([MTRDeviceController decodeXPCResponseValues:values], error); - __auto_type handleRetainer = handle; - (void) handleRetainer; - }]; + [handle.proxy + readAttributeCacheWithController:controllerId + nodeId:nodeId.unsignedLongLongValue + endpointId:endpointID + clusterId:clusterID + attributeId:attributeID + completion:^(id _Nullable values, NSError * _Nullable error) { + completionHandler([MTRDeviceController decodeXPCResponseValues:values], error); + __auto_type handleRetainer = handle; + (void) handleRetainer; + }]; } else { MTR_LOG_ERROR("Attribute cache read failed due to XPC connection failure"); - completion(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); } }]; return; } - dispatch_async(DeviceLayer::PlatformMgrImpl().GetWorkQueue(), ^{ - if (endpointID == nil && clusterID == nil) { - MTR_LOG_ERROR("Error: currently read from attribute cache does not support wildcards for both endpoint and cluster"); - completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeInvalidArgument userInfo:nil]); - return; - } - - if (!self.cppClusterStateCache) { - MTR_LOG_ERROR("Error: No attribute cache available to read from"); - completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); - return; - } + if (!self.baseDevice) { + MTR_LOG_ERROR("Error: No attribute cache available to read from"); + completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + return; + } - NSMutableArray * result = [[NSMutableArray alloc] init]; - CHIP_ERROR err = CHIP_NO_ERROR; - if (endpointID == nil) { - err = self.cppClusterStateCache->ForEachAttribute( - static_cast([clusterID unsignedLongValue]), [&](const app::ConcreteAttributePath & path) { - if (attributeID == nil - || static_cast([attributeID unsignedLongValue]) == path.mAttributeId) { + [self.baseDevice.deviceController + asyncDispatchToMatterQueue:^(Controller::DeviceCommissioner *) { + if (endpointID == nil && clusterID == nil) { + MTR_LOG_ERROR( + "Error: currently read from attribute cache does not support wildcards for both endpoint and cluster"); + completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeInvalidArgument userInfo:nil]); + return; + } + + if (!self.cppClusterStateCache) { + MTR_LOG_ERROR("Error: No attribute cache available to read from"); + completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeGeneralError userInfo:nil]); + return; + } + + NSMutableArray * result = [[NSMutableArray alloc] init]; + CHIP_ERROR err = CHIP_NO_ERROR; + if (endpointID == nil) { + err = self.cppClusterStateCache->ForEachAttribute( + static_cast([clusterID unsignedLongValue]), [&](const app::ConcreteAttributePath & path) { + if (attributeID == nil + || static_cast([attributeID unsignedLongValue]) == path.mAttributeId) { + (void) AppendAttributeValueToArray(path, self.cppClusterStateCache, result); + } + return CHIP_NO_ERROR; + }); + } else if (clusterID == nil) { + err = self.cppClusterStateCache->ForEachCluster( + static_cast([endpointID unsignedShortValue]), [&](chip::ClusterId enumeratedClusterId) { + (void) self.cppClusterStateCache->ForEachAttribute( + static_cast([endpointID unsignedShortValue]), enumeratedClusterId, + [&](const app::ConcreteAttributePath & path) { + if (attributeID == nil + || static_cast([attributeID unsignedLongValue]) == path.mAttributeId) { + (void) AppendAttributeValueToArray(path, self.cppClusterStateCache, result); + } + return CHIP_NO_ERROR; + }); + return CHIP_NO_ERROR; + }); + } else if (attributeID == nil) { + err = self.cppClusterStateCache->ForEachAttribute(static_cast([endpointID unsignedShortValue]), + static_cast([clusterID unsignedLongValue]), [&](const app::ConcreteAttributePath & path) { (void) AppendAttributeValueToArray(path, self.cppClusterStateCache, result); - } - return CHIP_NO_ERROR; - }); - } else if (clusterID == nil) { - err = self.cppClusterStateCache->ForEachCluster( - static_cast([endpointID unsignedShortValue]), [&](chip::ClusterId enumeratedClusterId) { - (void) self.cppClusterStateCache->ForEachAttribute( - static_cast([endpointID unsignedShortValue]), enumeratedClusterId, - [&](const app::ConcreteAttributePath & path) { - if (attributeID == nil - || static_cast([attributeID unsignedLongValue]) == path.mAttributeId) { - (void) AppendAttributeValueToArray(path, self.cppClusterStateCache, result); - } - return CHIP_NO_ERROR; - }); - return CHIP_NO_ERROR; - }); - } else if (attributeID == nil) { - err = self.cppClusterStateCache->ForEachAttribute(static_cast([endpointID unsignedShortValue]), - static_cast([clusterID unsignedLongValue]), [&](const app::ConcreteAttributePath & path) { - (void) AppendAttributeValueToArray(path, self.cppClusterStateCache, result); - return CHIP_NO_ERROR; - }); - } else { - app::ConcreteAttributePath path; - path.mEndpointId = static_cast([endpointID unsignedShortValue]); - path.mClusterId = static_cast([clusterID unsignedLongValue]); - path.mAttributeId = static_cast([attributeID unsignedLongValue]); - err = AppendAttributeValueToArray(path, self.cppClusterStateCache, result); - } - if (err == CHIP_NO_ERROR) { - completionHandler(result, nil); - } else { - completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:err.AsInteger() userInfo:nil]); + return CHIP_NO_ERROR; + }); + } else { + app::ConcreteAttributePath path; + path.mEndpointId = static_cast([endpointID unsignedShortValue]); + path.mClusterId = static_cast([clusterID unsignedLongValue]); + path.mAttributeId = static_cast([attributeID unsignedLongValue]); + err = AppendAttributeValueToArray(path, self.cppClusterStateCache, result); + } + if (err == CHIP_NO_ERROR) { + completionHandler(result, nil); + } else { + completionHandler(nil, [NSError errorWithDomain:MTRErrorDomain code:err.AsInteger() userInfo:nil]); + } } - }); + errorHandler:^(NSError * error) { + completionHandler(nil, error); + }]; } @end diff --git a/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer_Internal.h b/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer_Internal.h index 4b6c6eb47a3c62..d515cf2b325cbb 100644 --- a/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer_Internal.h +++ b/src/darwin/Framework/CHIP/MTRClusterStateCacheContainer_Internal.h @@ -27,10 +27,7 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRClusterStateCacheContainer () @property (atomic, readwrite, nullable) chip::app::ClusterStateCache * cppClusterStateCache; -@property (nonatomic, readwrite, copy) NSNumber * deviceID; -@property (nonatomic, readwrite, weak, nullable) MTRDeviceControllerXPCConnection * xpcConnection; -@property (nonatomic, readwrite, strong, nullable) id xpcControllerID; -@property (atomic, readwrite) BOOL shouldUseXPC; +@property (nonatomic, readwrite, nullable) MTRBaseDevice * baseDevice; @end diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index 5e0ed71d98c53b..f94760b6257782 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -181,7 +181,7 @@ reportHandler:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value + (void) read{{>attribute}}WithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTR{{>attribute_data_callback_name}}CallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^({{>attribute_data_callback_name}}Callback successCb, MTRErrorCallback failureCb) { + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^({{>attribute_data_callback_name}}Callback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; using TypeInfo = {{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index e894ea0d38c9d4..1ff77268b3df8d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -173,22 +173,23 @@ + (void)readAttributeIdentifyTimeWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Identify::Attributes::IdentifyTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Identify::Attributes::IdentifyTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeIdentifyTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -215,22 +216,23 @@ + (void)readAttributeIdentifyTypeWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Identify::Attributes::IdentifyType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Identify::Attributes::IdentifyType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -259,7 +261,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRIdentifyGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(IdentifyGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -304,7 +306,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRIdentifyAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(IdentifyAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -347,22 +349,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRIdentifyAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(IdentifyAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Identify::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(IdentifyAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Identify::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -389,22 +392,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Identify::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Identify::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -432,22 +436,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Identify::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Identify::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -1013,22 +1018,23 @@ + (void)readAttributeNameSupportWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Groups::Attributes::NameSupport::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Groups::Attributes::NameSupport::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -1057,7 +1063,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GroupsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -1102,22 +1108,23 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(GroupsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Groups::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(GroupsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Groups::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -1144,22 +1151,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(GroupsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Groups::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(GroupsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Groups::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -1186,22 +1194,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Groups::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Groups::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -1229,22 +1238,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Groups::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Groups::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -2050,22 +2060,23 @@ + (void)readAttributeSceneCountWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::SceneCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::SceneCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentSceneWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2092,22 +2103,23 @@ + (void)readAttributeCurrentSceneWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::CurrentScene::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::CurrentScene::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentGroupWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2134,22 +2146,23 @@ + (void)readAttributeCurrentGroupWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::CurrentGroup::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::CurrentGroup::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSceneValidWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2176,22 +2189,23 @@ + (void)readAttributeSceneValidWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::SceneValid::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::SceneValid::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNameSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2218,22 +2232,23 @@ + (void)readAttributeNameSupportWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::NameSupport::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::NameSupport::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLastConfiguredByWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2261,22 +2276,23 @@ + (void)readAttributeLastConfiguredByWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::LastConfiguredBy::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::LastConfiguredBy::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -2305,7 +2321,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRScenesGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ScenesGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -2350,22 +2366,23 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRScenesAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ScenesAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ScenesAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -2392,22 +2409,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRScenesAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ScenesAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ScenesAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2434,22 +2452,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -2477,22 +2496,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Scenes::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Scenes::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -3304,22 +3324,23 @@ + (void)readAttributeOnOffWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::OnOff::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::OnOff::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGlobalSceneControlWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -3348,22 +3369,23 @@ + (void)readAttributeGlobalSceneControlWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::GlobalSceneControl::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::GlobalSceneControl::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOnTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -3427,22 +3449,23 @@ + (void)readAttributeOnTimeWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::OnTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::OnTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOffWaitTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -3506,22 +3529,23 @@ + (void)readAttributeOffWaitTimeWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::OffWaitTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::OffWaitTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStartUpOnOffWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -3590,7 +3614,7 @@ + (void)readAttributeStartUpOnOffWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableOnOffClusterOnOffStartUpOnOffAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableOnOffClusterOnOffStartUpOnOffAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -3635,22 +3659,23 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROnOffGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(OnOffGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::GeneratedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OnOffGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -3679,22 +3704,23 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROnOffAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(OnOffAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(OnOffAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -3721,22 +3747,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROnOffAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(OnOffAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(OnOffAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -3763,22 +3790,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -3806,22 +3834,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOff::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOff::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -4380,22 +4409,23 @@ + (void)readAttributeSwitchTypeWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOffSwitchConfiguration::Attributes::SwitchType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSwitchActionsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -4459,22 +4489,23 @@ + (void)readAttributeSwitchActionsWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOffSwitchConfiguration::Attributes::SwitchActions::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -4504,7 +4535,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROnOffSwitchConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OnOffSwitchConfigurationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -4550,7 +4581,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROnOffSwitchConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OnOffSwitchConfigurationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -4593,7 +4624,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROnOffSwitchConfigurationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OnOffSwitchConfigurationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -4636,22 +4667,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOffSwitchConfiguration::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOffSwitchConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -4679,22 +4711,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OnOffSwitchConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -5384,22 +5417,23 @@ + (void)readAttributeCurrentLevelWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::CurrentLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::CurrentLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRemainingTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5426,22 +5460,23 @@ + (void)readAttributeRemainingTimeWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::RemainingTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::RemainingTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5468,22 +5503,23 @@ + (void)readAttributeMinLevelWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::MinLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::MinLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5510,22 +5546,23 @@ + (void)readAttributeMaxLevelWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::MaxLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::MaxLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentFrequencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5553,22 +5590,23 @@ + (void)readAttributeCurrentFrequencyWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::CurrentFrequency::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::CurrentFrequency::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinFrequencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5595,22 +5633,23 @@ + (void)readAttributeMinFrequencyWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::MinFrequency::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::MinFrequency::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxFrequencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5637,22 +5676,23 @@ + (void)readAttributeMaxFrequencyWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::MaxFrequency::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::MaxFrequency::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOptionsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5716,22 +5756,23 @@ + (void)readAttributeOptionsWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLevelControlOptionsAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(LevelControlOptionsAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::Options::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(LevelControlOptionsAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::Options::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOnOffTransitionTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5797,22 +5838,23 @@ + (void)readAttributeOnOffTransitionTimeWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::OnOffTransitionTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::OnOffTransitionTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOnLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5881,22 +5923,23 @@ + (void)readAttributeOnLevelWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::OnLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::OnLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOnTransitionTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -5966,22 +6009,23 @@ + (void)readAttributeOnTransitionTimeWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::OnTransitionTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::OnTransitionTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOffTransitionTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -6051,22 +6095,23 @@ + (void)readAttributeOffTransitionTimeWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::OffTransitionTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::OffTransitionTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDefaultMoveRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -6136,22 +6181,23 @@ + (void)readAttributeDefaultMoveRateWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::DefaultMoveRate::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::DefaultMoveRate::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStartUpCurrentLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -6222,22 +6268,23 @@ + (void)readAttributeStartUpCurrentLevelWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::StartUpCurrentLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -6266,7 +6313,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLevelControlGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LevelControlGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -6311,7 +6358,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLevelControlAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LevelControlAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -6354,22 +6401,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLevelControlAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(LevelControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(LevelControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -6396,22 +6444,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -6439,22 +6488,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LevelControl::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LevelControl::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -7485,22 +7535,23 @@ + (void)readAttributeActiveTextWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::ActiveText::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::ActiveText::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDescriptionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -7564,22 +7615,23 @@ + (void)readAttributeDescriptionWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::Description::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::Description::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInactiveTextWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -7643,22 +7695,23 @@ + (void)readAttributeInactiveTextWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::InactiveText::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::InactiveText::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOutOfServiceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -7722,22 +7775,23 @@ + (void)readAttributeOutOfServiceWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::OutOfService::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::OutOfService::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePolarityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -7764,22 +7818,23 @@ + (void)readAttributePolarityWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::Polarity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::Polarity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePresentValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -7843,22 +7898,23 @@ + (void)readAttributePresentValueWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::PresentValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::PresentValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReliabilityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -7922,22 +7978,23 @@ + (void)readAttributeReliabilityWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::Reliability::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::Reliability::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStatusFlagsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -7964,22 +8021,23 @@ + (void)readAttributeStatusFlagsWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::StatusFlags::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::StatusFlags::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeApplicationTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -8007,22 +8065,23 @@ + (void)readAttributeApplicationTypeWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::ApplicationType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::ApplicationType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -8051,7 +8110,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBinaryInputBasicGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BinaryInputBasicGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -8096,7 +8155,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBinaryInputBasicAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BinaryInputBasicAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -8139,7 +8198,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBinaryInputBasicAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BinaryInputBasicAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -8182,22 +8241,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -8225,22 +8285,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BinaryInputBasic::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BinaryInputBasic::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -8958,22 +9019,23 @@ + (void)readAttributeDeviceTypeListWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorDeviceTypeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DescriptorDeviceTypeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::DeviceTypeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(DescriptorDeviceTypeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::DeviceTypeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeServerListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -9000,22 +9062,23 @@ + (void)readAttributeServerListWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorServerListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DescriptorServerListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::ServerList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(DescriptorServerListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::ServerList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClientListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -9042,22 +9105,23 @@ + (void)readAttributeClientListWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorClientListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DescriptorClientListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::ClientList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(DescriptorClientListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::ClientList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePartsListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -9084,22 +9148,23 @@ + (void)readAttributePartsListWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorPartsListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DescriptorPartsListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::PartsList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(DescriptorPartsListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::PartsList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -9128,7 +9193,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DescriptorGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -9173,7 +9238,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DescriptorAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -9216,22 +9281,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDescriptorAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DescriptorAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(DescriptorAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -9258,22 +9324,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -9301,22 +9368,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Descriptor::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Descriptor::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -9831,22 +9899,23 @@ + (void)readAttributeBindingWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBindingBindingListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BindingBindingListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Binding::Attributes::Binding::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BindingBindingListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Binding::Attributes::Binding::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -9875,7 +9944,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBindingGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BindingGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -9920,7 +9989,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBindingAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BindingAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -9963,22 +10032,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBindingAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BindingAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Binding::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BindingAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Binding::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -10005,22 +10075,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Binding::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Binding::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -10048,22 +10119,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Binding::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Binding::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -10524,22 +10596,23 @@ + (void)readAttributeACLWithClusterStateCache:(MTRClusterStateCacheContainer *)c completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccessControlACLListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(AccessControlACLListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::Acl::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(AccessControlACLListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::Acl::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeExtensionWithParams:(MTRReadParams * _Nullable)params @@ -10626,22 +10699,23 @@ + (void)readAttributeExtensionWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccessControlExtensionListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(AccessControlExtensionListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::Extension::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(AccessControlExtensionListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::Extension::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSubjectsPerAccessControlEntryWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -10672,22 +10746,23 @@ + (void)readAttributeSubjectsPerAccessControlEntryWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::SubjectsPerAccessControlEntry::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::SubjectsPerAccessControlEntry::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTargetsPerAccessControlEntryWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -10718,22 +10793,23 @@ + (void)readAttributeTargetsPerAccessControlEntryWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::TargetsPerAccessControlEntry::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::TargetsPerAccessControlEntry::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAccessControlEntriesPerFabricWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -10764,22 +10840,23 @@ + (void)readAttributeAccessControlEntriesPerFabricWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::AccessControlEntriesPerFabric::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::AccessControlEntriesPerFabric::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -10808,7 +10885,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccessControlGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AccessControlGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -10853,7 +10930,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccessControlAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AccessControlAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -10896,7 +10973,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccessControlAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AccessControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -10939,22 +11016,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -10982,22 +11060,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccessControl::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccessControl::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -11904,22 +11983,23 @@ + (void)readAttributeActionListWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRActionsActionListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ActionsActionListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Actions::Attributes::ActionList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ActionsActionListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Actions::Attributes::ActionList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEndpointListsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -11946,22 +12026,23 @@ + (void)readAttributeEndpointListsWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRActionsEndpointListsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ActionsEndpointListsListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Actions::Attributes::EndpointLists::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ActionsEndpointListsListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Actions::Attributes::EndpointLists::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSetupURLWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -11988,22 +12069,23 @@ + (void)readAttributeSetupURLWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Actions::Attributes::SetupURL::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Actions::Attributes::SetupURL::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -12032,7 +12114,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRActionsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ActionsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -12077,7 +12159,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRActionsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ActionsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -12120,22 +12202,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRActionsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ActionsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Actions::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ActionsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Actions::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -12162,22 +12245,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Actions::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Actions::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -12205,22 +12289,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Actions::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Actions::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -12710,22 +12795,23 @@ + (void)readAttributeDataModelRevisionWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::DataModelRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::DataModelRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeVendorNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -12752,22 +12838,23 @@ + (void)readAttributeVendorNameWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::VendorName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::VendorName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeVendorIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -12794,22 +12881,23 @@ + (void)readAttributeVendorIDWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRVendorIdAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::VendorID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::VendorID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -12836,22 +12924,23 @@ + (void)readAttributeProductNameWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::ProductName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::ProductName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -12878,22 +12967,23 @@ + (void)readAttributeProductIDWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::ProductID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::ProductID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNodeLabelWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -12957,22 +13047,23 @@ + (void)readAttributeNodeLabelWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::NodeLabel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::NodeLabel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLocationWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13036,22 +13127,23 @@ + (void)readAttributeLocationWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::Location::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::Location::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeHardwareVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -13079,22 +13171,23 @@ + (void)readAttributeHardwareVersionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::HardwareVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::HardwareVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeHardwareVersionStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13123,22 +13216,23 @@ + (void)readAttributeHardwareVersionStringWithClusterStateCache:(MTRClusterState (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::HardwareVersionString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::HardwareVersionString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSoftwareVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -13166,22 +13260,23 @@ + (void)readAttributeSoftwareVersionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::SoftwareVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::SoftwareVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSoftwareVersionStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13210,22 +13305,23 @@ + (void)readAttributeSoftwareVersionStringWithClusterStateCache:(MTRClusterState (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::SoftwareVersionString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::SoftwareVersionString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeManufacturingDateWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13253,22 +13349,23 @@ + (void)readAttributeManufacturingDateWithClusterStateCache:(MTRClusterStateCach (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::ManufacturingDate::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::ManufacturingDate::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePartNumberWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13295,22 +13392,23 @@ + (void)readAttributePartNumberWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::PartNumber::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::PartNumber::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductURLWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13337,22 +13435,23 @@ + (void)readAttributeProductURLWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::ProductURL::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::ProductURL::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductLabelWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13379,22 +13478,23 @@ + (void)readAttributeProductLabelWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::ProductLabel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::ProductLabel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSerialNumberWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13421,22 +13521,23 @@ + (void)readAttributeSerialNumberWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::SerialNumber::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::SerialNumber::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLocalConfigDisabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -13502,22 +13603,23 @@ + (void)readAttributeLocalConfigDisabledWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::LocalConfigDisabled::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::LocalConfigDisabled::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReachableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -13544,22 +13646,23 @@ + (void)readAttributeReachableWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::Reachable::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::Reachable::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUniqueIDWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -13586,22 +13689,23 @@ + (void)readAttributeUniqueIDWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::UniqueID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::UniqueID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCapabilityMinimaWithCompletion:(void (^)(MTRBasicClusterCapabilityMinimaStruct * _Nullable value, @@ -13632,22 +13736,23 @@ + (void)readAttributeCapabilityMinimaWithClusterStateCache:(MTRClusterStateCache NSError * _Nullable error))completion { auto * bridge = new MTRBasicCapabilityMinimaStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BasicCapabilityMinimaStructAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::CapabilityMinima::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(BasicCapabilityMinimaStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::CapabilityMinima::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -13676,22 +13781,23 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBasicGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BasicGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::GeneratedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(BasicGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -13720,22 +13826,23 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBasicAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BasicAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(BasicAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -13762,22 +13869,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBasicAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BasicAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BasicAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -13804,22 +13912,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -13847,22 +13956,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Basic::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Basic::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -15173,7 +15283,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateProviderGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateProviderGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -15219,7 +15329,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateProviderAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateProviderAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -15262,7 +15372,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateProviderAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateProviderAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -15305,22 +15415,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OtaSoftwareUpdateProvider::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OtaSoftwareUpdateProvider::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -15348,22 +15459,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OtaSoftwareUpdateProvider::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -15768,7 +15880,7 @@ + (void)readAttributeDefaultOtaProvidersWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateRequestorDefaultOtaProvidersListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -15811,22 +15923,23 @@ + (void)readAttributeUpdatePossibleWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdatePossible::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUpdateStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -15854,7 +15967,7 @@ + (void)readAttributeUpdateStateWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateRequestorClusterOTAUpdateStateEnumAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateRequestorClusterOTAUpdateStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -15899,22 +16012,23 @@ + (void)readAttributeUpdateStateProgressWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::UpdateStateProgress::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -15944,7 +16058,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateRequestorGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateRequestorGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -15990,7 +16104,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateRequestorAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateRequestorAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -16034,7 +16148,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROTASoftwareUpdateRequestorAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OTASoftwareUpdateRequestorAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -16077,22 +16191,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -16120,22 +16235,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OtaSoftwareUpdateRequestor::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -16642,22 +16758,23 @@ + (void)readAttributeActiveLocaleWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LocalizationConfiguration::Attributes::ActiveLocale::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSupportedLocalesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -16686,7 +16803,7 @@ + (void)readAttributeSupportedLocalesWithClusterStateCache:(MTRClusterStateCache (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLocalizationConfigurationSupportedLocalesListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LocalizationConfigurationSupportedLocalesListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -16732,7 +16849,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLocalizationConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LocalizationConfigurationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -16778,7 +16895,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLocalizationConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LocalizationConfigurationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -16821,7 +16938,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLocalizationConfigurationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LocalizationConfigurationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -16864,22 +16981,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LocalizationConfiguration::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LocalizationConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -16907,22 +17025,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LocalizationConfiguration::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LocalizationConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -17328,7 +17447,7 @@ + (void)readAttributeHourFormatWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTimeFormatLocalizationClusterHourFormatAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TimeFormatLocalizationClusterHourFormatAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -17410,7 +17529,7 @@ + (void)readAttributeActiveCalendarTypeWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTimeFormatLocalizationClusterCalendarTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TimeFormatLocalizationClusterCalendarTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -17456,7 +17575,7 @@ + (void)readAttributeSupportedCalendarTypesWithClusterStateCache:(MTRClusterStat (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTimeFormatLocalizationSupportedCalendarTypesListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TimeFormatLocalizationSupportedCalendarTypesListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -17502,7 +17621,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTimeFormatLocalizationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TimeFormatLocalizationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -17548,7 +17667,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTimeFormatLocalizationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TimeFormatLocalizationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -17591,7 +17710,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTimeFormatLocalizationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TimeFormatLocalizationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -17634,22 +17753,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TimeFormatLocalization::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TimeFormatLocalization::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -17677,22 +17797,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TimeFormatLocalization::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TimeFormatLocalization::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -18155,7 +18276,7 @@ + (void)readAttributeTemperatureUnitWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitLocalizationClusterTempUnitAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitLocalizationClusterTempUnitAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18200,7 +18321,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitLocalizationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitLocalizationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18245,7 +18366,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitLocalizationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitLocalizationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18288,7 +18409,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitLocalizationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitLocalizationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18331,22 +18452,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitLocalization::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitLocalization::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -18374,22 +18496,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitLocalization::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitLocalization::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -18715,7 +18838,7 @@ + (void)readAttributeSourcesWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceConfigurationSourcesListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceConfigurationSourcesListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18761,7 +18884,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceConfigurationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18807,7 +18930,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceConfigurationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18850,7 +18973,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceConfigurationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceConfigurationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -18893,22 +19016,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSourceConfiguration::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSourceConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -18936,22 +19060,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSourceConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -19264,7 +19389,7 @@ + (void)readAttributeStatusWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceClusterPowerSourceStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceClusterPowerSourceStatusAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -19307,22 +19432,23 @@ + (void)readAttributeOrderWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::Order::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::Order::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDescriptionWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -19349,22 +19475,23 @@ + (void)readAttributeDescriptionWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::Description::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::Description::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWiredAssessedInputVoltageWithCompletion:(void (^)( @@ -19394,22 +19521,23 @@ + (void)readAttributeWiredAssessedInputVoltageWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWiredAssessedInputFrequencyWithCompletion:(void (^)( @@ -19439,22 +19567,23 @@ + (void)readAttributeWiredAssessedInputFrequencyWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredAssessedInputFrequency::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWiredCurrentTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19482,7 +19611,7 @@ + (void)readAttributeWiredCurrentTypeWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceClusterWiredCurrentTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceClusterWiredCurrentTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -19527,22 +19656,23 @@ + (void)readAttributeWiredAssessedCurrentWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::WiredAssessedCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredAssessedCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWiredNominalVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19571,22 +19701,23 @@ + (void)readAttributeWiredNominalVoltageWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::WiredNominalVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredNominalVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWiredMaximumCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19615,22 +19746,23 @@ + (void)readAttributeWiredMaximumCurrentWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::WiredMaximumCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredMaximumCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWiredPresentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19657,22 +19789,23 @@ + (void)readAttributeWiredPresentWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::WiredPresent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::WiredPresent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveWiredFaultsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -19700,7 +19833,7 @@ + (void)readAttributeActiveWiredFaultsWithClusterStateCache:(MTRClusterStateCach (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceActiveWiredFaultsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceActiveWiredFaultsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -19743,22 +19876,23 @@ + (void)readAttributeBatVoltageWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatPercentRemainingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19787,22 +19921,23 @@ + (void)readAttributeBatPercentRemainingWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatPercentRemaining::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatPercentRemaining::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatTimeRemainingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19830,22 +19965,23 @@ + (void)readAttributeBatTimeRemainingWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatTimeRemaining::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatTimeRemaining::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatChargeLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19872,7 +20008,7 @@ + (void)readAttributeBatChargeLevelWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceClusterBatChargeLevelAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceClusterBatChargeLevelAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -19917,22 +20053,23 @@ + (void)readAttributeBatReplacementNeededWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatReplacementNeeded::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatReplacementNeeded::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatReplaceabilityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -19960,7 +20097,7 @@ + (void)readAttributeBatReplaceabilityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceClusterBatReplaceabilityAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceClusterBatReplaceabilityAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -20003,22 +20140,23 @@ + (void)readAttributeBatPresentWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatPresent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatPresent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveBatFaultsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -20045,7 +20183,7 @@ + (void)readAttributeActiveBatFaultsWithClusterStateCache:(MTRClusterStateCacheC completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceActiveBatFaultsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceActiveBatFaultsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -20091,22 +20229,23 @@ + (void)readAttributeBatReplacementDescriptionWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatReplacementDescription::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatReplacementDescription::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatCommonDesignationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20135,22 +20274,23 @@ + (void)readAttributeBatCommonDesignationWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatCommonDesignation::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatCommonDesignation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatANSIDesignationWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -20179,22 +20319,23 @@ + (void)readAttributeBatANSIDesignationWithClusterStateCache:(MTRClusterStateCac (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatANSIDesignation::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatANSIDesignation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatIECDesignationWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -20222,22 +20363,23 @@ + (void)readAttributeBatIECDesignationWithClusterStateCache:(MTRClusterStateCach (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatIECDesignation::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatIECDesignation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatApprovedChemistryWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20266,22 +20408,23 @@ + (void)readAttributeBatApprovedChemistryWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatApprovedChemistry::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatApprovedChemistry::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatCapacityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20308,22 +20451,23 @@ + (void)readAttributeBatCapacityWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatCapacity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatCapacity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatQuantityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20350,22 +20494,23 @@ + (void)readAttributeBatQuantityWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatQuantity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatQuantity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatChargeStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20392,7 +20537,7 @@ + (void)readAttributeBatChargeStateWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceClusterBatChargeStateAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceClusterBatChargeStateAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -20437,22 +20582,23 @@ + (void)readAttributeBatTimeToFullChargeWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatTimeToFullCharge::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatTimeToFullCharge::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatFunctionalWhileChargingWithCompletion:(void (^)( @@ -20482,22 +20628,23 @@ + (void)readAttributeBatFunctionalWhileChargingWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatFunctionalWhileCharging::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatFunctionalWhileCharging::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBatChargingCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20526,22 +20673,23 @@ + (void)readAttributeBatChargingCurrentWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::BatChargingCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::BatChargingCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveBatChargeFaultsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -20570,7 +20718,7 @@ + (void)readAttributeActiveBatChargeFaultsWithClusterStateCache:(MTRClusterState (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceActiveBatChargeFaultsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceActiveBatChargeFaultsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -20615,7 +20763,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -20660,7 +20808,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PowerSourceAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -20703,22 +20851,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPowerSourceAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(PowerSourceAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(PowerSourceAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20745,22 +20894,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -20788,22 +20938,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PowerSource::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PowerSource::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -22570,22 +22721,23 @@ + (void)readAttributeBreadcrumbWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralCommissioning::Attributes::Breadcrumb::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBasicCommissioningInfoWithCompletion: @@ -22620,7 +22772,7 @@ - (void)subscribeAttributeBasicCommissioningInfoWithParams:(MTRSubscribeParams * NSError * _Nullable error))completion { auto * bridge = new MTRGeneralCommissioningBasicCommissioningInfoStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralCommissioningBasicCommissioningInfoStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -22665,7 +22817,7 @@ + (void)readAttributeRegulatoryConfigWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralCommissioningClusterRegulatoryLocationTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralCommissioningClusterRegulatoryLocationTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -22711,7 +22863,7 @@ + (void)readAttributeLocationCapabilityWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralCommissioningClusterRegulatoryLocationTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralCommissioningClusterRegulatoryLocationTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -22758,22 +22910,23 @@ + (void)readAttributeSupportsConcurrentConnectionWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralCommissioning::Attributes::SupportsConcurrentConnection::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralCommissioning::Attributes::SupportsConcurrentConnection::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -22803,7 +22956,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralCommissioningGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralCommissioningGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -22849,7 +23002,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralCommissioningAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralCommissioningAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -22892,7 +23045,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralCommissioningAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralCommissioningAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -22935,22 +23088,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralCommissioning::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralCommissioning::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -22978,22 +23132,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralCommissioning::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -23751,22 +23906,23 @@ + (void)readAttributeMaxNetworksWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::MaxNetworks::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::MaxNetworks::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNetworksWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -23793,7 +23949,7 @@ + (void)readAttributeNetworksWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNetworkCommissioningNetworksListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NetworkCommissioningNetworksListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -23838,22 +23994,23 @@ + (void)readAttributeScanMaxTimeSecondsWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::ScanMaxTimeSeconds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeConnectMaxTimeSecondsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -23882,22 +24039,23 @@ + (void)readAttributeConnectMaxTimeSecondsWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::ConnectMaxTimeSeconds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInterfaceEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -23962,22 +24120,23 @@ + (void)readAttributeInterfaceEnabledWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::InterfaceEnabled::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLastNetworkingStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -24007,7 +24166,7 @@ + (void)readAttributeLastNetworkingStatusWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableNetworkCommissioningClusterNetworkCommissioningStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableNetworkCommissioningClusterNetworkCommissioningStatusAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -24050,22 +24209,23 @@ + (void)readAttributeLastNetworkIDWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableOctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::LastNetworkID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::LastNetworkID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLastConnectErrorValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -24094,22 +24254,23 @@ + (void)readAttributeLastConnectErrorValueWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::LastConnectErrorValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::LastConnectErrorValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -24139,7 +24300,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNetworkCommissioningGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NetworkCommissioningGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -24185,7 +24346,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNetworkCommissioningAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NetworkCommissioningAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -24228,7 +24389,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNetworkCommissioningAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NetworkCommissioningAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -24271,22 +24432,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -24314,22 +24476,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = NetworkCommissioning::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -25065,7 +25228,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDiagnosticLogsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DiagnosticLogsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25110,7 +25273,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDiagnosticLogsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DiagnosticLogsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25153,7 +25316,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDiagnosticLogsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DiagnosticLogsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25196,22 +25359,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DiagnosticLogs::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DiagnosticLogs::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -25239,22 +25403,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DiagnosticLogs::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DiagnosticLogs::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -25569,7 +25734,7 @@ + (void)readAttributeNetworkInterfacesWithClusterStateCache:(MTRClusterStateCach (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsNetworkInterfacesListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsNetworkInterfacesListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25612,22 +25777,23 @@ + (void)readAttributeRebootCountWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::RebootCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::RebootCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUpTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -25654,22 +25820,23 @@ + (void)readAttributeUpTimeWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::UpTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::UpTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTotalOperationalHoursWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -25698,22 +25865,23 @@ + (void)readAttributeTotalOperationalHoursWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::TotalOperationalHours::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBootReasonsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -25740,22 +25908,23 @@ + (void)readAttributeBootReasonsWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::BootReasons::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::BootReasons::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveHardwareFaultsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -25784,7 +25953,7 @@ + (void)readAttributeActiveHardwareFaultsWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsActiveHardwareFaultsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsActiveHardwareFaultsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25828,7 +25997,7 @@ + (void)readAttributeActiveRadioFaultsWithClusterStateCache:(MTRClusterStateCach (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsActiveRadioFaultsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsActiveRadioFaultsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25873,7 +26042,7 @@ + (void)readAttributeActiveNetworkFaultsWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsActiveNetworkFaultsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsActiveNetworkFaultsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -25919,22 +26088,23 @@ + (void)readAttributeTestEventTriggersEnabledWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::TestEventTriggersEnabled::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::TestEventTriggersEnabled::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -25963,7 +26133,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -26008,7 +26178,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -26051,7 +26221,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGeneralDiagnosticsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GeneralDiagnosticsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -26094,22 +26264,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -26137,22 +26308,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GeneralDiagnostics::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -26857,7 +27029,7 @@ + (void)readAttributeThreadMetricsWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSoftwareDiagnosticsThreadMetricsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(SoftwareDiagnosticsThreadMetricsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -26901,22 +27073,23 @@ + (void)readAttributeCurrentHeapFreeWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapFree::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentHeapUsedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -26944,22 +27117,23 @@ + (void)readAttributeCurrentHeapUsedWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapUsed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentHeapHighWatermarkWithCompletion:(void (^)( @@ -26989,22 +27163,23 @@ + (void)readAttributeCurrentHeapHighWatermarkWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SoftwareDiagnostics::Attributes::CurrentHeapHighWatermark::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -27034,7 +27209,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSoftwareDiagnosticsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(SoftwareDiagnosticsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -27079,7 +27254,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSoftwareDiagnosticsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(SoftwareDiagnosticsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -27122,7 +27297,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSoftwareDiagnosticsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(SoftwareDiagnosticsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -27165,22 +27340,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SoftwareDiagnostics::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -27208,22 +27384,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SoftwareDiagnostics::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -27713,22 +27890,23 @@ + (void)readAttributeChannelWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::Channel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRoutingRoleWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -27756,7 +27934,7 @@ + (void)readAttributeRoutingRoleWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableThreadNetworkDiagnosticsClusterRoutingRoleAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableThreadNetworkDiagnosticsClusterRoutingRoleAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -27799,22 +27977,23 @@ + (void)readAttributeNetworkNameWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableCharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableCharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::NetworkName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePanIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -27841,22 +28020,23 @@ + (void)readAttributePanIdWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::PanId::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeExtendedPanIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -27883,22 +28063,23 @@ + (void)readAttributeExtendedPanIdWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ExtendedPanId::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeshLocalPrefixWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion @@ -27925,22 +28106,23 @@ + (void)readAttributeMeshLocalPrefixWithClusterStateCache:(MTRClusterStateCacheC completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableOctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::MeshLocalPrefix::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOverrunCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -27967,22 +28149,23 @@ + (void)readAttributeOverrunCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNeighborTableListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -28011,7 +28194,7 @@ + (void)readAttributeNeighborTableListWithClusterStateCache:(MTRClusterStateCach (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsNeighborTableListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsNeighborTableListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -28054,7 +28237,7 @@ + (void)readAttributeRouteTableListWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsRouteTableListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsRouteTableListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -28097,22 +28280,23 @@ + (void)readAttributePartitionIdWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionId::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWeightingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28139,22 +28323,23 @@ + (void)readAttributeWeightingWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::Weighting::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDataVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28181,22 +28366,23 @@ + (void)readAttributeDataVersionWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::DataVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStableDataVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28224,22 +28410,23 @@ + (void)readAttributeStableDataVersionWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::StableDataVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLeaderRouterIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28266,22 +28453,23 @@ + (void)readAttributeLeaderRouterIdWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRouterId::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDetachedRoleCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28309,22 +28497,23 @@ + (void)readAttributeDetachedRoleCountWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::DetachedRoleCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeChildRoleCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28351,22 +28540,23 @@ + (void)readAttributeChildRoleCountWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChildRoleCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRouterRoleCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28394,22 +28584,23 @@ + (void)readAttributeRouterRoleCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RouterRoleCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLeaderRoleCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28437,22 +28628,23 @@ + (void)readAttributeLeaderRoleCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::LeaderRoleCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAttachAttemptCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28481,22 +28673,23 @@ + (void)readAttributeAttachAttemptCountWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::AttachAttemptCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePartitionIdChangeCountWithCompletion:(void (^)( @@ -28526,22 +28719,23 @@ + (void)readAttributePartitionIdChangeCountWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::PartitionIdChangeCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBetterPartitionAttachAttemptCountWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -28573,22 +28767,23 @@ + (void)readAttributeBetterPartitionAttachAttemptCountWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::BetterPartitionAttachAttemptCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeParentChangeCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28616,22 +28811,23 @@ + (void)readAttributeParentChangeCountWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ParentChangeCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxTotalCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28658,22 +28854,23 @@ + (void)readAttributeTxTotalCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxTotalCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxUnicastCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28700,22 +28897,23 @@ + (void)readAttributeTxUnicastCountWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxUnicastCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxBroadcastCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28743,22 +28941,23 @@ + (void)readAttributeTxBroadcastCountWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBroadcastCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxAckRequestedCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28787,22 +28986,23 @@ + (void)readAttributeTxAckRequestedCountWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckRequestedCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxAckedCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28829,22 +29029,23 @@ + (void)readAttributeTxAckedCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxAckedCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxNoAckRequestedCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28873,22 +29074,23 @@ + (void)readAttributeTxNoAckRequestedCountWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxNoAckRequestedCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxDataCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28915,22 +29117,23 @@ + (void)readAttributeTxDataCountWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxDataPollCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -28958,22 +29161,23 @@ + (void)readAttributeTxDataPollCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDataPollCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxBeaconCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29000,22 +29204,23 @@ + (void)readAttributeTxBeaconCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxBeaconRequestCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29044,22 +29249,23 @@ + (void)readAttributeTxBeaconRequestCountWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxBeaconRequestCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxOtherCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29086,22 +29292,23 @@ + (void)readAttributeTxOtherCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxOtherCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxRetryCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29128,22 +29335,23 @@ + (void)readAttributeTxRetryCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxRetryCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxDirectMaxRetryExpiryCountWithCompletion:(void (^)( @@ -29173,22 +29381,23 @@ + (void)readAttributeTxDirectMaxRetryExpiryCountWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxIndirectMaxRetryExpiryCountWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -29219,22 +29428,23 @@ + (void)readAttributeTxIndirectMaxRetryExpiryCountWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxErrCcaCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29261,22 +29471,23 @@ + (void)readAttributeTxErrCcaCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrCcaCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxErrAbortCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29304,22 +29515,23 @@ + (void)readAttributeTxErrAbortCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrAbortCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxErrBusyChannelCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29348,22 +29560,23 @@ + (void)readAttributeTxErrBusyChannelCountWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::TxErrBusyChannelCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxTotalCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29390,22 +29603,23 @@ + (void)readAttributeRxTotalCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxTotalCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxUnicastCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29432,22 +29646,23 @@ + (void)readAttributeRxUnicastCountWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxUnicastCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxBroadcastCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29475,22 +29690,23 @@ + (void)readAttributeRxBroadcastCountWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBroadcastCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxDataCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29517,22 +29733,23 @@ + (void)readAttributeRxDataCountWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxDataPollCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29560,22 +29777,23 @@ + (void)readAttributeRxDataPollCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDataPollCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxBeaconCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29602,22 +29820,23 @@ + (void)readAttributeRxBeaconCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxBeaconRequestCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29646,22 +29865,23 @@ + (void)readAttributeRxBeaconRequestCountWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxBeaconRequestCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxOtherCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29688,22 +29908,23 @@ + (void)readAttributeRxOtherCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxOtherCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxAddressFilteredCountWithCompletion:(void (^)( @@ -29733,22 +29954,23 @@ + (void)readAttributeRxAddressFilteredCountWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxAddressFilteredCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxDestAddrFilteredCountWithCompletion:(void (^)( @@ -29778,22 +30000,23 @@ + (void)readAttributeRxDestAddrFilteredCountWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDestAddrFilteredCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxDuplicatedCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29821,22 +30044,23 @@ + (void)readAttributeRxDuplicatedCountWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxDuplicatedCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxErrNoFrameCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29864,22 +30088,23 @@ + (void)readAttributeRxErrNoFrameCountWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrNoFrameCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxErrUnknownNeighborCountWithCompletion:(void (^)( @@ -29909,22 +30134,23 @@ + (void)readAttributeRxErrUnknownNeighborCountWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrUnknownNeighborCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxErrInvalidSrcAddrCountWithCompletion:(void (^)( @@ -29954,22 +30180,23 @@ + (void)readAttributeRxErrInvalidSrcAddrCountWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrInvalidSrcAddrCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxErrSecCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -29996,22 +30223,23 @@ + (void)readAttributeRxErrSecCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrSecCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxErrFcsCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30038,22 +30266,23 @@ + (void)readAttributeRxErrFcsCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrFcsCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRxErrOtherCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30081,22 +30310,23 @@ + (void)readAttributeRxErrOtherCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::RxErrOtherCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30124,22 +30354,23 @@ + (void)readAttributeActiveTimestampWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ActiveTimestamp::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePendingTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30167,22 +30398,23 @@ + (void)readAttributePendingTimestampWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::PendingTimestamp::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDelayWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30209,22 +30441,23 @@ + (void)readAttributeDelayWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::Delay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSecurityPolicyWithCompletion:(void (^)(MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value, @@ -30256,7 +30489,7 @@ + (void)readAttributeSecurityPolicyWithClusterStateCache:(MTRClusterStateCacheCo NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsSecurityPolicyStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsSecurityPolicyStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -30299,22 +30532,23 @@ + (void)readAttributeChannelPage0MaskWithClusterStateCache:(MTRClusterStateCache completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableOctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ChannelPage0Mask::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOperationalDatasetComponentsWithCompletion: @@ -30352,7 +30586,7 @@ - (void)readAttributeOperationalDatasetComponentsWithCompletion: NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsOperationalDatasetComponentsStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsOperationalDatasetComponentsStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -30399,7 +30633,7 @@ + (void)readAttributeActiveNetworkFaultsListWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -30445,7 +30679,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -30491,7 +30725,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -30534,7 +30768,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThreadNetworkDiagnosticsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThreadNetworkDiagnosticsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -30577,22 +30811,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -30620,22 +30855,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThreadNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -33748,22 +33984,23 @@ + (void)readAttributeBssidWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableOctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::Bssid::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSecurityTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -33791,7 +34028,7 @@ + (void)readAttributeSecurityTypeWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableWiFiNetworkDiagnosticsClusterSecurityTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableWiFiNetworkDiagnosticsClusterSecurityTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -33835,7 +34072,7 @@ + (void)readAttributeWiFiVersionWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableWiFiNetworkDiagnosticsClusterWiFiVersionTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableWiFiNetworkDiagnosticsClusterWiFiVersionTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -33878,22 +34115,23 @@ + (void)readAttributeChannelNumberWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::ChannelNumber::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRssiWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -33920,22 +34158,23 @@ + (void)readAttributeRssiWithClusterStateCache:(MTRClusterStateCacheContainer *) completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::Rssi::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBeaconLostCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -33963,22 +34202,23 @@ + (void)readAttributeBeaconLostCountWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconLostCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBeaconRxCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -34005,22 +34245,23 @@ + (void)readAttributeBeaconRxCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::BeaconRxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePacketMulticastRxCountWithCompletion:(void (^)( @@ -34050,22 +34291,23 @@ + (void)readAttributePacketMulticastRxCountWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastRxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePacketMulticastTxCountWithCompletion:(void (^)( @@ -34095,22 +34337,23 @@ + (void)readAttributePacketMulticastTxCountWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketMulticastTxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePacketUnicastRxCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -34139,22 +34382,23 @@ + (void)readAttributePacketUnicastRxCountWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastRxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePacketUnicastTxCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -34183,22 +34427,23 @@ + (void)readAttributePacketUnicastTxCountWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::PacketUnicastTxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentMaxRateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -34225,22 +34470,23 @@ + (void)readAttributeCurrentMaxRateWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::CurrentMaxRate::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOverrunCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -34267,22 +34513,23 @@ + (void)readAttributeOverrunCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -34312,7 +34559,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWiFiNetworkDiagnosticsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WiFiNetworkDiagnosticsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -34358,7 +34605,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWiFiNetworkDiagnosticsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WiFiNetworkDiagnosticsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -34401,7 +34648,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWiFiNetworkDiagnosticsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WiFiNetworkDiagnosticsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -34444,22 +34691,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -34487,22 +34735,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WiFiNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -35384,7 +35633,7 @@ + (void)readAttributePHYRateWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableEthernetNetworkDiagnosticsClusterPHYRateTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableEthernetNetworkDiagnosticsClusterPHYRateTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -35427,22 +35676,23 @@ + (void)readAttributeFullDuplexWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableBooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableBooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::FullDuplex::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePacketRxCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35469,22 +35719,23 @@ + (void)readAttributePacketRxCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketRxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePacketTxCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35511,22 +35762,23 @@ + (void)readAttributePacketTxCountWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::PacketTxCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTxErrCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35553,22 +35805,23 @@ + (void)readAttributeTxErrCountWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::TxErrCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCollisionCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35595,22 +35848,23 @@ + (void)readAttributeCollisionCountWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::CollisionCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOverrunCountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35637,22 +35891,23 @@ + (void)readAttributeOverrunCountWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::OverrunCount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCarrierDetectWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35679,22 +35934,23 @@ + (void)readAttributeCarrierDetectWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableBooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableBooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::CarrierDetect::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTimeSinceResetWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35721,22 +35977,23 @@ + (void)readAttributeTimeSinceResetWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::TimeSinceReset::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -35766,7 +36023,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTREthernetNetworkDiagnosticsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(EthernetNetworkDiagnosticsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -35812,7 +36069,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTREthernetNetworkDiagnosticsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(EthernetNetworkDiagnosticsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -35856,7 +36113,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTREthernetNetworkDiagnosticsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(EthernetNetworkDiagnosticsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -35899,22 +36156,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -35942,22 +36200,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = EthernetNetworkDiagnostics::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -36627,22 +36886,23 @@ + (void)readAttributeVendorNameWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::VendorName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::VendorName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeVendorIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -36669,22 +36929,23 @@ + (void)readAttributeVendorIDWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRVendorIdAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::VendorID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::VendorID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -36711,22 +36972,23 @@ + (void)readAttributeProductNameWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::ProductName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNodeLabelWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -36790,22 +37052,23 @@ + (void)readAttributeNodeLabelWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::NodeLabel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeHardwareVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -36833,22 +37096,23 @@ + (void)readAttributeHardwareVersionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeHardwareVersionStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -36877,22 +37141,23 @@ + (void)readAttributeHardwareVersionStringWithClusterStateCache:(MTRClusterState (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::HardwareVersionString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSoftwareVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -36920,22 +37185,23 @@ + (void)readAttributeSoftwareVersionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSoftwareVersionStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -36964,22 +37230,23 @@ + (void)readAttributeSoftwareVersionStringWithClusterStateCache:(MTRClusterState (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::SoftwareVersionString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeManufacturingDateWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -37007,22 +37274,23 @@ + (void)readAttributeManufacturingDateWithClusterStateCache:(MTRClusterStateCach (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::ManufacturingDate::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePartNumberWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -37049,22 +37317,23 @@ + (void)readAttributePartNumberWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::PartNumber::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::PartNumber::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductURLWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -37091,22 +37360,23 @@ + (void)readAttributeProductURLWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductURL::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::ProductURL::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductLabelWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -37133,22 +37403,23 @@ + (void)readAttributeProductLabelWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::ProductLabel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSerialNumberWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -37175,22 +37446,23 @@ + (void)readAttributeSerialNumberWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::SerialNumber::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReachableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -37217,22 +37489,23 @@ + (void)readAttributeReachableWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::Reachable::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::Reachable::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUniqueIDWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -37259,22 +37532,23 @@ + (void)readAttributeUniqueIDWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::UniqueID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::UniqueID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -37303,7 +37577,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBridgedDeviceBasicGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BridgedDeviceBasicGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -37348,7 +37622,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBridgedDeviceBasicAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BridgedDeviceBasicAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -37391,7 +37665,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBridgedDeviceBasicAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BridgedDeviceBasicAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -37434,22 +37708,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -37477,22 +37752,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BridgedDeviceBasic::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -38421,22 +38697,23 @@ + (void)readAttributeNumberOfPositionsWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::NumberOfPositions::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::NumberOfPositions::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentPositionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -38464,22 +38741,23 @@ + (void)readAttributeCurrentPositionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::CurrentPosition::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::CurrentPosition::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMultiPressMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -38506,22 +38784,23 @@ + (void)readAttributeMultiPressMaxWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::MultiPressMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -38550,7 +38829,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSwitchGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(SwitchGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -38595,22 +38874,23 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSwitchAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(SwitchAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SwitchAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -38637,22 +38917,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRSwitchAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(SwitchAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(SwitchAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -38679,22 +38960,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -38722,22 +39004,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Switch::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -39246,7 +39529,7 @@ + (void)readAttributeWindowStatusWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAdministratorCommissioningClusterCommissioningWindowStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AdministratorCommissioningClusterCommissioningWindowStatusAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -39290,22 +39573,23 @@ + (void)readAttributeAdminFabricIndexWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AdministratorCommissioning::Attributes::AdminFabricIndex::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAdminVendorIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -39332,22 +39616,23 @@ + (void)readAttributeAdminVendorIdWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AdministratorCommissioning::Attributes::AdminVendorId::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -39377,7 +39662,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAdministratorCommissioningGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AdministratorCommissioningGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -39423,7 +39708,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAdministratorCommissioningAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AdministratorCommissioningAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -39467,7 +39752,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAdministratorCommissioningAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AdministratorCommissioningAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -39510,22 +39795,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AdministratorCommissioning::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AdministratorCommissioning::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -39553,22 +39839,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AdministratorCommissioning::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -40226,7 +40513,7 @@ + (void)readAttributeNOCsWithClusterStateCache:(MTRClusterStateCacheContainer *) completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROperationalCredentialsNOCsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OperationalCredentialsNOCsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -40270,7 +40557,7 @@ + (void)readAttributeFabricsWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROperationalCredentialsFabricsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OperationalCredentialsFabricsListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -40314,22 +40601,23 @@ + (void)readAttributeSupportedFabricsWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalCredentials::Attributes::SupportedFabrics::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCommissionedFabricsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -40358,22 +40646,23 @@ + (void)readAttributeCommissionedFabricsWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalCredentials::Attributes::CommissionedFabrics::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTrustedRootCertificatesWithCompletion:(void (^)( @@ -40404,7 +40693,7 @@ + (void)readAttributeTrustedRootCertificatesWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTROperationalCredentialsTrustedRootCertificatesListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OperationalCredentialsTrustedRootCertificatesListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -40449,22 +40738,23 @@ + (void)readAttributeCurrentFabricIndexWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalCredentials::Attributes::CurrentFabricIndex::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -40494,7 +40784,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROperationalCredentialsGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OperationalCredentialsGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -40540,7 +40830,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROperationalCredentialsAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OperationalCredentialsAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -40583,7 +40873,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROperationalCredentialsAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OperationalCredentialsAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -40626,22 +40916,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OperationalCredentials::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalCredentials::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -40669,22 +40960,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OperationalCredentials::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OperationalCredentials::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -41534,7 +41826,7 @@ + (void)readAttributeGroupKeyMapWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupKeyManagementGroupKeyMapListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GroupKeyManagementGroupKeyMapListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -41578,7 +41870,7 @@ + (void)readAttributeGroupTableWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupKeyManagementGroupTableListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GroupKeyManagementGroupTableListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -41623,22 +41915,23 @@ + (void)readAttributeMaxGroupsPerFabricWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupsPerFabric::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxGroupKeysPerFabricWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -41667,22 +41960,23 @@ + (void)readAttributeMaxGroupKeysPerFabricWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GroupKeyManagement::Attributes::MaxGroupKeysPerFabric::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -41711,7 +42005,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupKeyManagementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GroupKeyManagementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -41756,7 +42050,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupKeyManagementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GroupKeyManagementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -41799,7 +42093,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRGroupKeyManagementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(GroupKeyManagementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -41842,22 +42136,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GroupKeyManagement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GroupKeyManagement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -41885,22 +42180,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = GroupKeyManagement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -42391,22 +42687,23 @@ + (void)readAttributeLabelListWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFixedLabelLabelListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(FixedLabelLabelListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FixedLabel::Attributes::LabelList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(FixedLabelLabelListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FixedLabel::Attributes::LabelList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -42435,7 +42732,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFixedLabelGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FixedLabelGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -42480,7 +42777,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFixedLabelAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FixedLabelAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -42523,22 +42820,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFixedLabelAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(FixedLabelAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FixedLabel::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(FixedLabelAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FixedLabel::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -42565,22 +42863,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FixedLabel::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FixedLabel::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -42608,22 +42907,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FixedLabel::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FixedLabel::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -42996,22 +43296,23 @@ + (void)readAttributeLabelListWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUserLabelLabelListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UserLabelLabelListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UserLabel::Attributes::LabelList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(UserLabelLabelListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UserLabel::Attributes::LabelList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -43040,7 +43341,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUserLabelGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UserLabelGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -43085,7 +43386,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUserLabelAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UserLabelAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -43128,22 +43429,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUserLabelAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UserLabelAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UserLabel::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UserLabelAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UserLabel::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -43170,22 +43472,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UserLabel::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UserLabel::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -43213,22 +43516,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UserLabel::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UserLabel::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -43552,22 +43856,23 @@ + (void)readAttributeStateValueWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BooleanState::Attributes::StateValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BooleanState::Attributes::StateValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -43596,7 +43901,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanStateGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BooleanStateGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -43641,7 +43946,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanStateAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BooleanStateAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -43684,22 +43989,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanStateAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BooleanState::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(BooleanStateAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BooleanState::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -43726,22 +44032,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BooleanState::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BooleanState::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -43769,22 +44076,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BooleanState::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BooleanState::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -44126,22 +44434,23 @@ + (void)readAttributeDescriptionWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::Description::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStandardNamespaceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -44169,22 +44478,23 @@ + (void)readAttributeStandardNamespaceWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::StandardNamespace::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSupportedModesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -44211,22 +44521,23 @@ + (void)readAttributeSupportedModesWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRModeSelectSupportedModesListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ModeSelectSupportedModesListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::SupportedModes::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ModeSelectSupportedModesListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::SupportedModes::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -44253,22 +44564,23 @@ + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::CurrentMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -44337,22 +44649,23 @@ + (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::StartUpMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -44421,22 +44734,23 @@ + (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::OnMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -44465,7 +44779,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRModeSelectGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ModeSelectGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -44510,7 +44824,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRModeSelectAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ModeSelectAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -44553,22 +44867,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRModeSelectAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ModeSelectAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ModeSelectAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -44595,22 +44910,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -44638,22 +44954,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -45828,7 +46145,7 @@ + (void)readAttributeLockStateWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableDoorLockClusterDlLockStateAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableDoorLockClusterDlLockStateAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -45871,22 +46188,23 @@ + (void)readAttributeLockTypeWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockClusterDlLockTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DoorLockClusterDlLockTypeAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::LockType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(DoorLockClusterDlLockTypeAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::LockType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActuatorEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -45914,22 +46232,23 @@ + (void)readAttributeActuatorEnabledWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::ActuatorEnabled::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::ActuatorEnabled::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDoorStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -45956,7 +46275,7 @@ + (void)readAttributeDoorStateWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableDoorLockClusterDlDoorStateAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableDoorLockClusterDlDoorStateAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -46036,22 +46355,23 @@ + (void)readAttributeDoorOpenEventsWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::DoorOpenEvents::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::DoorOpenEvents::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDoorClosedEventsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46116,22 +46436,23 @@ + (void)readAttributeDoorClosedEventsWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::DoorClosedEvents::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::DoorClosedEvents::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOpenPeriodWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46195,22 +46516,23 @@ + (void)readAttributeOpenPeriodWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::OpenPeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::OpenPeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfTotalUsersSupportedWithCompletion:(void (^)( @@ -46240,22 +46562,23 @@ + (void)readAttributeNumberOfTotalUsersSupportedWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfTotalUsersSupported::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfTotalUsersSupported::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfPINUsersSupportedWithCompletion:(void (^)( @@ -46285,22 +46608,23 @@ + (void)readAttributeNumberOfPINUsersSupportedWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfPINUsersSupported::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfPINUsersSupported::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfRFIDUsersSupportedWithCompletion:(void (^)( @@ -46330,22 +46654,23 @@ + (void)readAttributeNumberOfRFIDUsersSupportedWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfRFIDUsersSupported::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfRFIDUsersSupported::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -46377,22 +46702,23 @@ + (void)readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithClusterStateCac NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -46424,22 +46750,23 @@ + (void)readAttributeNumberOfYearDaySchedulesSupportedPerUserWithClusterStateCac NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfHolidaySchedulesSupportedWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -46471,22 +46798,23 @@ + (void)readAttributeNumberOfHolidaySchedulesSupportedWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxPINCodeLengthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46514,22 +46842,23 @@ + (void)readAttributeMaxPINCodeLengthWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::MaxPINCodeLength::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::MaxPINCodeLength::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinPINCodeLengthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46557,22 +46886,23 @@ + (void)readAttributeMinPINCodeLengthWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::MinPINCodeLength::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::MinPINCodeLength::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxRFIDCodeLengthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46600,22 +46930,23 @@ + (void)readAttributeMaxRFIDCodeLengthWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::MaxRFIDCodeLength::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::MaxRFIDCodeLength::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinRFIDCodeLengthWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46643,22 +46974,23 @@ + (void)readAttributeMinRFIDCodeLengthWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::MinRFIDCodeLength::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::MinRFIDCodeLength::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCredentialRulesSupportWithCompletion:(void (^)( @@ -46688,7 +47020,7 @@ + (void)readAttributeCredentialRulesSupportWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockCredentialRulesSupportAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockCredentialRulesSupportAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -46736,22 +47068,23 @@ + (void)readAttributeNumberOfCredentialsSupportedPerUserWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLanguageWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -46815,22 +47148,23 @@ + (void)readAttributeLanguageWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::Language::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::Language::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLEDSettingsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46894,22 +47228,23 @@ + (void)readAttributeLEDSettingsWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::LEDSettings::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::LEDSettings::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAutoRelockTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -46973,22 +47308,23 @@ + (void)readAttributeAutoRelockTimeWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::AutoRelockTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::AutoRelockTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSoundVolumeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47052,22 +47388,23 @@ + (void)readAttributeSoundVolumeWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::SoundVolume::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::SoundVolume::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOperatingModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47131,7 +47468,7 @@ + (void)readAttributeOperatingModeWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockClusterDlOperatingModeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockClusterDlOperatingModeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -47177,7 +47514,7 @@ + (void)readAttributeSupportedOperatingModesWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockSupportedOperatingModesAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockSupportedOperatingModesAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -47224,7 +47561,7 @@ + (void)readAttributeDefaultConfigurationRegisterWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockDefaultConfigurationRegisterAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockDefaultConfigurationRegisterAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -47307,22 +47644,23 @@ + (void)readAttributeEnableLocalProgrammingWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::EnableLocalProgramming::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::EnableLocalProgramming::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnableOneTouchLockingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47388,22 +47726,23 @@ + (void)readAttributeEnableOneTouchLockingWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::EnableOneTouchLocking::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnableInsideStatusLEDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47469,22 +47808,23 @@ + (void)readAttributeEnableInsideStatusLEDWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::EnableInsideStatusLED::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::EnableInsideStatusLED::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnablePrivacyModeButtonWithCompletion:(void (^)( @@ -47551,22 +47891,23 @@ + (void)readAttributeEnablePrivacyModeButtonWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::EnablePrivacyModeButton::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLocalProgrammingFeaturesWithCompletion:(void (^)( @@ -47633,7 +47974,7 @@ + (void)readAttributeLocalProgrammingFeaturesWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockLocalProgrammingFeaturesAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockLocalProgrammingFeaturesAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -47715,22 +48056,23 @@ + (void)readAttributeWrongCodeEntryLimitWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::WrongCodeEntryLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUserCodeTemporaryDisableTimeWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -47798,22 +48140,23 @@ + (void)readAttributeUserCodeTemporaryDisableTimeWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::UserCodeTemporaryDisableTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::UserCodeTemporaryDisableTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSendPINOverTheAirWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -47878,22 +48221,23 @@ + (void)readAttributeSendPINOverTheAirWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::SendPINOverTheAir::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::SendPINOverTheAir::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRequirePINforRemoteOperationWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -47961,22 +48305,23 @@ + (void)readAttributeRequirePINforRemoteOperationWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::RequirePINforRemoteOperation::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::RequirePINforRemoteOperation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeExpiringUserTimeoutWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -48042,22 +48387,23 @@ + (void)readAttributeExpiringUserTimeoutWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::ExpiringUserTimeout::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::ExpiringUserTimeout::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -48086,7 +48432,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -48131,7 +48477,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(DoorLockAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -48174,22 +48520,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDoorLockAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DoorLockAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(DoorLockAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -48216,22 +48563,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -48259,22 +48607,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = DoorLock::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = DoorLock::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -50675,22 +51024,23 @@ + (void)readAttributeTypeWithClusterStateCache:(MTRClusterStateCacheContainer *) completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringClusterTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(WindowCoveringClusterTypeAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::Type::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(WindowCoveringClusterTypeAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::Type::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhysicalClosedLimitLiftWithCompletion:(void (^)( @@ -50720,22 +51070,23 @@ + (void)readAttributePhysicalClosedLimitLiftWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::PhysicalClosedLimitLift::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::PhysicalClosedLimitLift::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhysicalClosedLimitTiltWithCompletion:(void (^)( @@ -50765,22 +51116,23 @@ + (void)readAttributePhysicalClosedLimitTiltWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::PhysicalClosedLimitTilt::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::PhysicalClosedLimitTilt::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentPositionLiftWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -50809,22 +51161,23 @@ + (void)readAttributeCurrentPositionLiftWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::CurrentPositionLift::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentPositionTiltWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -50853,22 +51206,23 @@ + (void)readAttributeCurrentPositionTiltWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::CurrentPositionTilt::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfActuationsLiftWithCompletion:(void (^)( @@ -50898,22 +51252,23 @@ + (void)readAttributeNumberOfActuationsLiftWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::NumberOfActuationsLift::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::NumberOfActuationsLift::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfActuationsTiltWithCompletion:(void (^)( @@ -50943,22 +51298,23 @@ + (void)readAttributeNumberOfActuationsTiltWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::NumberOfActuationsTilt::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::NumberOfActuationsTilt::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeConfigStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -50985,22 +51341,23 @@ + (void)readAttributeConfigStatusWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringConfigStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(WindowCoveringConfigStatusAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::ConfigStatus::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(WindowCoveringConfigStatusAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::ConfigStatus::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentPositionLiftPercentageWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -51031,22 +51388,23 @@ + (void)readAttributeCurrentPositionLiftPercentageWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercentage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentPositionTiltPercentageWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -51077,22 +51435,23 @@ + (void)readAttributeCurrentPositionTiltPercentageWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercentage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOperationalStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -51120,7 +51479,7 @@ + (void)readAttributeOperationalStatusWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringOperationalStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WindowCoveringOperationalStatusAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -51168,22 +51527,23 @@ + (void)readAttributeTargetPositionLiftPercent100thsWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::TargetPositionLiftPercent100ths::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTargetPositionTiltPercent100thsWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -51215,22 +51575,23 @@ + (void)readAttributeTargetPositionTiltPercent100thsWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::TargetPositionTiltPercent100ths::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEndProductTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -51257,7 +51618,7 @@ + (void)readAttributeEndProductTypeWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringClusterEndProductTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WindowCoveringClusterEndProductTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -51305,22 +51666,23 @@ + (void)readAttributeCurrentPositionLiftPercent100thsWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::CurrentPositionLiftPercent100ths::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentPositionTiltPercent100thsWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -51352,22 +51714,23 @@ + (void)readAttributeCurrentPositionTiltPercent100thsWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::CurrentPositionTiltPercent100ths::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstalledOpenLimitLiftWithCompletion:(void (^)( @@ -51397,22 +51760,23 @@ + (void)readAttributeInstalledOpenLimitLiftWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitLift::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstalledClosedLimitLiftWithCompletion:(void (^)( @@ -51442,22 +51806,23 @@ + (void)readAttributeInstalledClosedLimitLiftWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitLift::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstalledOpenLimitTiltWithCompletion:(void (^)( @@ -51487,22 +51852,23 @@ + (void)readAttributeInstalledOpenLimitTiltWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::InstalledOpenLimitTilt::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstalledClosedLimitTiltWithCompletion:(void (^)( @@ -51532,22 +51898,23 @@ + (void)readAttributeInstalledClosedLimitTiltWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::InstalledClosedLimitTilt::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -51611,22 +51978,23 @@ + (void)readAttributeModeWithClusterStateCache:(MTRClusterStateCacheContainer *) completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringModeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(WindowCoveringModeAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::Mode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(WindowCoveringModeAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::Mode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSafetyStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -51653,22 +52021,23 @@ + (void)readAttributeSafetyStatusWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringSafetyStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(WindowCoveringSafetyStatusAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::SafetyStatus::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(WindowCoveringSafetyStatusAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::SafetyStatus::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -51697,7 +52066,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WindowCoveringGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -51742,7 +52111,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WindowCoveringAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -51785,7 +52154,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWindowCoveringAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WindowCoveringAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -51828,22 +52197,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -51871,22 +52241,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WindowCovering::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WindowCovering::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -53260,22 +53631,23 @@ + (void)readAttributeBarrierMovingStateWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierMovingState::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierMovingState::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierSafetyStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53304,22 +53676,23 @@ + (void)readAttributeBarrierSafetyStatusWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierSafetyStatus::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierCapabilitiesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53348,22 +53721,23 @@ + (void)readAttributeBarrierCapabilitiesWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierCapabilities::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierCapabilities::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierOpenEventsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53428,22 +53802,23 @@ + (void)readAttributeBarrierOpenEventsWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierOpenEvents::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierOpenEvents::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierCloseEventsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53509,22 +53884,23 @@ + (void)readAttributeBarrierCloseEventsWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierCloseEvents::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierCloseEvents::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierCommandOpenEventsWithCompletion:(void (^)( @@ -53591,22 +53967,23 @@ + (void)readAttributeBarrierCommandOpenEventsWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierCommandOpenEvents::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierCommandOpenEvents::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierCommandCloseEventsWithCompletion:(void (^)( @@ -53673,22 +54050,23 @@ + (void)readAttributeBarrierCommandCloseEventsWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierCommandCloseEvents::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierCommandCloseEvents::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierOpenPeriodWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53753,22 +54131,23 @@ + (void)readAttributeBarrierOpenPeriodWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierOpenPeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierOpenPeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierClosePeriodWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53834,22 +54213,23 @@ + (void)readAttributeBarrierClosePeriodWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierClosePeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierClosePeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBarrierPositionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -53877,22 +54257,23 @@ + (void)readAttributeBarrierPositionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::BarrierPosition::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::BarrierPosition::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -53921,7 +54302,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBarrierControlGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BarrierControlGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -53966,7 +54347,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBarrierControlAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BarrierControlAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -54009,7 +54390,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBarrierControlAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BarrierControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -54052,22 +54433,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -54095,22 +54477,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BarrierControl::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BarrierControl::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -54910,22 +55293,23 @@ + (void)readAttributeMaxPressureWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxPressure::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxSpeedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -54952,22 +55336,23 @@ + (void)readAttributeMaxSpeedWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxSpeed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxFlowWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -54994,22 +55379,23 @@ + (void)readAttributeMaxFlowWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxFlow::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinConstPressureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55037,22 +55423,23 @@ + (void)readAttributeMinConstPressureWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstPressure::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxConstPressureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55080,22 +55467,23 @@ + (void)readAttributeMaxConstPressureWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstPressure::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinCompPressureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55123,22 +55511,23 @@ + (void)readAttributeMinCompPressureWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MinCompPressure::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxCompPressureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55166,22 +55555,23 @@ + (void)readAttributeMaxCompPressureWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxCompPressure::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinConstSpeedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55208,22 +55598,23 @@ + (void)readAttributeMinConstSpeedWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstSpeed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxConstSpeedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55250,22 +55641,23 @@ + (void)readAttributeMaxConstSpeedWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstSpeed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinConstFlowWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55292,22 +55684,23 @@ + (void)readAttributeMinConstFlowWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstFlow::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxConstFlowWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55334,22 +55727,23 @@ + (void)readAttributeMaxConstFlowWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstFlow::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinConstTempWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55376,22 +55770,23 @@ + (void)readAttributeMinConstTempWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MinConstTemp::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxConstTempWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55418,22 +55813,23 @@ + (void)readAttributeMaxConstTempWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::MaxConstTemp::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePumpStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55460,7 +55856,7 @@ + (void)readAttributePumpStatusWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlPumpStatusAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlPumpStatusAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -55507,7 +55903,7 @@ + (void)readAttributeEffectiveOperationModeWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlClusterPumpOperationModeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlClusterPumpOperationModeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -55553,7 +55949,7 @@ + (void)readAttributeEffectiveControlModeWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlClusterPumpControlModeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlClusterPumpControlModeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -55596,22 +55992,23 @@ + (void)readAttributeCapacityWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::Capacity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSpeedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55638,22 +56035,23 @@ + (void)readAttributeSpeedWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::Speed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::Speed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLifetimeRunningHoursWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55724,22 +56122,23 @@ + (void)readAttributeLifetimeRunningHoursWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::LifetimeRunningHours::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55766,22 +56165,23 @@ + (void)readAttributePowerWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::Power::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::Power::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLifetimeEnergyConsumedWithCompletion:(void (^)( @@ -55853,22 +56253,23 @@ + (void)readAttributeLifetimeEnergyConsumedWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::LifetimeEnergyConsumed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOperationModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -55933,7 +56334,7 @@ + (void)readAttributeOperationModeWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlClusterPumpOperationModeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlClusterPumpOperationModeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -56014,7 +56415,7 @@ + (void)readAttributeControlModeWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlClusterPumpControlModeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlClusterPumpControlModeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -56060,7 +56461,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -56106,7 +56507,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -56150,7 +56551,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPumpConfigurationAndControlAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PumpConfigurationAndControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -56193,22 +56594,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -56236,22 +56638,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PumpConfigurationAndControl::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -57719,22 +58122,23 @@ + (void)readAttributeLocalTemperatureWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::LocalTemperature::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::LocalTemperature::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOutdoorTemperatureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -57763,22 +58167,23 @@ + (void)readAttributeOutdoorTemperatureWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::OutdoorTemperature::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::OutdoorTemperature::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupancyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -57805,22 +58210,23 @@ + (void)readAttributeOccupancyWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::Occupancy::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::Occupancy::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAbsMinHeatSetpointLimitWithCompletion:(void (^)( @@ -57850,22 +58256,23 @@ + (void)readAttributeAbsMinHeatSetpointLimitWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::AbsMinHeatSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAbsMaxHeatSetpointLimitWithCompletion:(void (^)( @@ -57895,22 +58302,23 @@ + (void)readAttributeAbsMaxHeatSetpointLimitWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::AbsMaxHeatSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAbsMinCoolSetpointLimitWithCompletion:(void (^)( @@ -57940,22 +58348,23 @@ + (void)readAttributeAbsMinCoolSetpointLimitWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::AbsMinCoolSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAbsMaxCoolSetpointLimitWithCompletion:(void (^)( @@ -57985,22 +58394,23 @@ + (void)readAttributeAbsMaxCoolSetpointLimitWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePICoolingDemandWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58028,22 +58438,23 @@ + (void)readAttributePICoolingDemandWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::PICoolingDemand::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::PICoolingDemand::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePIHeatingDemandWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58071,22 +58482,23 @@ + (void)readAttributePIHeatingDemandWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::PIHeatingDemand::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::PIHeatingDemand::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeHVACSystemTypeConfigurationWithCompletion:(void (^)( @@ -58153,22 +58565,23 @@ + (void)readAttributeHVACSystemTypeConfigurationWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLocalTemperatureCalibrationWithCompletion:(void (^)( @@ -58235,22 +58648,23 @@ + (void)readAttributeLocalTemperatureCalibrationWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::LocalTemperatureCalibration::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::LocalTemperatureCalibration::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupiedCoolingSetpointWithCompletion:(void (^)( @@ -58317,22 +58731,23 @@ + (void)readAttributeOccupiedCoolingSetpointWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::OccupiedCoolingSetpoint::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupiedHeatingSetpointWithCompletion:(void (^)( @@ -58399,22 +58814,23 @@ + (void)readAttributeOccupiedHeatingSetpointWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::OccupiedHeatingSetpoint::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUnoccupiedCoolingSetpointWithCompletion:(void (^)( @@ -58481,22 +58897,23 @@ + (void)readAttributeUnoccupiedCoolingSetpointWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::UnoccupiedCoolingSetpoint::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::UnoccupiedCoolingSetpoint::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUnoccupiedHeatingSetpointWithCompletion:(void (^)( @@ -58563,22 +58980,23 @@ + (void)readAttributeUnoccupiedHeatingSetpointWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::UnoccupiedHeatingSetpoint::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::UnoccupiedHeatingSetpoint::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinHeatSetpointLimitWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58644,22 +59062,23 @@ + (void)readAttributeMinHeatSetpointLimitWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::MinHeatSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxHeatSetpointLimitWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58725,22 +59144,23 @@ + (void)readAttributeMaxHeatSetpointLimitWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::MaxHeatSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinCoolSetpointLimitWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58806,22 +59226,23 @@ + (void)readAttributeMinCoolSetpointLimitWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::MinCoolSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxCoolSetpointLimitWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58887,22 +59308,23 @@ + (void)readAttributeMaxCoolSetpointLimitWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::MaxCoolSetpointLimit::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinSetpointDeadBandWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -58968,22 +59390,23 @@ + (void)readAttributeMinSetpointDeadBandWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::MinSetpointDeadBand::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRemoteSensingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59047,22 +59470,23 @@ + (void)readAttributeRemoteSensingWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::RemoteSensing::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::RemoteSensing::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeControlSequenceOfOperationWithCompletion:(void (^)( @@ -59130,7 +59554,7 @@ + (void)readAttributeControlSequenceOfOperationWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRThermostatClusterThermostatControlSequenceAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThermostatClusterThermostatControlSequenceAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -59210,22 +59634,23 @@ + (void)readAttributeSystemModeWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::SystemMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::SystemMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeThermostatRunningModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59254,22 +59679,23 @@ + (void)readAttributeThermostatRunningModeWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ThermostatRunningMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ThermostatRunningMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStartOfWeekWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59296,22 +59722,23 @@ + (void)readAttributeStartOfWeekWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::StartOfWeek::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::StartOfWeek::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfWeeklyTransitionsWithCompletion:(void (^)( @@ -59341,22 +59768,23 @@ + (void)readAttributeNumberOfWeeklyTransitionsWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::NumberOfWeeklyTransitions::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfDailyTransitionsWithCompletion:(void (^)( @@ -59386,22 +59814,23 @@ + (void)readAttributeNumberOfDailyTransitionsWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::NumberOfDailyTransitions::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTemperatureSetpointHoldWithCompletion:(void (^)( @@ -59468,22 +59897,23 @@ + (void)readAttributeTemperatureSetpointHoldWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::TemperatureSetpointHold::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::TemperatureSetpointHold::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTemperatureSetpointHoldDurationWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -59558,22 +59988,23 @@ + (void)readAttributeTemperatureSetpointHoldDurationWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::TemperatureSetpointHoldDuration::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::TemperatureSetpointHoldDuration::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeThermostatProgrammingOperationModeWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -59643,22 +60074,23 @@ + (void)readAttributeThermostatProgrammingOperationModeWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ThermostatProgrammingOperationMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ThermostatProgrammingOperationMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeThermostatRunningStateWithCompletion:(void (^)( @@ -59688,22 +60120,23 @@ + (void)readAttributeThermostatRunningStateWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ThermostatRunningState::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ThermostatRunningState::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSetpointChangeSourceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59732,22 +60165,23 @@ + (void)readAttributeSetpointChangeSourceWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::SetpointChangeSource::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::SetpointChangeSource::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSetpointChangeAmountWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59776,22 +60210,23 @@ + (void)readAttributeSetpointChangeAmountWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::SetpointChangeAmount::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::SetpointChangeAmount::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSetpointChangeSourceTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -59822,22 +60257,23 @@ + (void)readAttributeSetpointChangeSourceTimestampWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::SetpointChangeSourceTimestamp::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::SetpointChangeSourceTimestamp::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupiedSetbackWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59907,22 +60343,23 @@ + (void)readAttributeOccupiedSetbackWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::OccupiedSetback::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::OccupiedSetback::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupiedSetbackMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59951,22 +60388,23 @@ + (void)readAttributeOccupiedSetbackMinWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::OccupiedSetbackMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::OccupiedSetbackMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupiedSetbackMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -59995,22 +60433,23 @@ + (void)readAttributeOccupiedSetbackMaxWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::OccupiedSetbackMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::OccupiedSetbackMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUnoccupiedSetbackWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60080,22 +60519,23 @@ + (void)readAttributeUnoccupiedSetbackWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::UnoccupiedSetback::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::UnoccupiedSetback::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUnoccupiedSetbackMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60124,22 +60564,23 @@ + (void)readAttributeUnoccupiedSetbackMinWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::UnoccupiedSetbackMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::UnoccupiedSetbackMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUnoccupiedSetbackMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60168,22 +60609,23 @@ + (void)readAttributeUnoccupiedSetbackMaxWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::UnoccupiedSetbackMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::UnoccupiedSetbackMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEmergencyHeatDeltaWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60249,22 +60691,23 @@ + (void)readAttributeEmergencyHeatDeltaWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::EmergencyHeatDelta::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::EmergencyHeatDelta::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60328,22 +60771,23 @@ + (void)readAttributeACTypeWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACCapacityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60407,22 +60851,23 @@ + (void)readAttributeACCapacityWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACCapacity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACCapacity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACRefrigerantTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60487,22 +60932,23 @@ + (void)readAttributeACRefrigerantTypeWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACRefrigerantType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACRefrigerantType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACCompressorTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60567,22 +61013,23 @@ + (void)readAttributeACCompressorTypeWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACCompressorType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACCompressorType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACErrorCodeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60646,22 +61093,23 @@ + (void)readAttributeACErrorCodeWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACErrorCode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACErrorCode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACLouverPositionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60726,22 +61174,23 @@ + (void)readAttributeACLouverPositionWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACLouverPosition::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACLouverPosition::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACCoilTemperatureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60769,22 +61218,23 @@ + (void)readAttributeACCoilTemperatureWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACCoilTemperature::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACCoilTemperature::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -60849,22 +61299,23 @@ + (void)readAttributeACCapacityformatWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -60893,7 +61344,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThermostatGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThermostatGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -60938,7 +61389,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThermostatAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThermostatAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -60981,22 +61432,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThermostatAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ThermostatAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ThermostatAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -61023,22 +61475,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -61066,22 +61519,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Thermostat::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Thermostat::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -63890,22 +64344,23 @@ + (void)readAttributeFanModeWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFanControlClusterFanModeTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(FanControlClusterFanModeTypeAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::FanMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(FanControlClusterFanModeTypeAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::FanMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFanModeSequenceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -63970,7 +64425,7 @@ + (void)readAttributeFanModeSequenceWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFanControlClusterFanModeSequenceTypeAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FanControlClusterFanModeSequenceTypeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -64055,22 +64510,23 @@ + (void)readAttributePercentSettingWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::PercentSetting::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::PercentSetting::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePercentCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64097,22 +64553,23 @@ + (void)readAttributePercentCurrentWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::PercentCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSpeedMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64139,22 +64596,23 @@ + (void)readAttributeSpeedMaxWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::SpeedMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSpeedSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64223,22 +64681,23 @@ + (void)readAttributeSpeedSettingWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::SpeedSetting::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::SpeedSetting::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSpeedCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64265,22 +64724,23 @@ + (void)readAttributeSpeedCurrentWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::SpeedCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRockSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64307,22 +64767,23 @@ + (void)readAttributeRockSupportWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::RockSupport::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRockSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64386,22 +64847,23 @@ + (void)readAttributeRockSettingWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::RockSetting::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::RockSetting::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWindSupportWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64428,22 +64890,23 @@ + (void)readAttributeWindSupportWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::WindSupport::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWindSettingWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64507,22 +64970,23 @@ + (void)readAttributeWindSettingWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::WindSetting::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::WindSetting::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -64551,7 +65015,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFanControlGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FanControlGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -64596,7 +65060,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFanControlAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FanControlAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -64639,22 +65103,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFanControlAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(FanControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(FanControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64681,22 +65146,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -64724,22 +65190,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FanControl::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FanControl::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -65584,22 +66051,23 @@ + (void)readAttributeTemperatureDisplayModeWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeKeypadLockoutWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -65663,22 +66131,23 @@ + (void)readAttributeKeypadLockoutWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeScheduleProgrammingVisibilityWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -65746,22 +66215,23 @@ + (void)readAttributeScheduleProgrammingVisibilityWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -65791,7 +66261,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThermostatUserInterfaceConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThermostatUserInterfaceConfigurationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -65837,7 +66307,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThermostatUserInterfaceConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThermostatUserInterfaceConfigurationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -65881,7 +66351,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRThermostatUserInterfaceConfigurationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ThermostatUserInterfaceConfigurationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -65924,22 +66394,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -65967,22 +66438,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ThermostatUserInterfaceConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -67034,22 +67506,23 @@ + (void)readAttributeCurrentHueWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::CurrentHue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::CurrentHue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentSaturationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67077,22 +67550,23 @@ + (void)readAttributeCurrentSaturationWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::CurrentSaturation::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::CurrentSaturation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRemainingTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67119,22 +67593,23 @@ + (void)readAttributeRemainingTimeWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::RemainingTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::RemainingTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentXWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67161,22 +67636,23 @@ + (void)readAttributeCurrentXWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::CurrentX::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::CurrentX::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentYWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67203,22 +67679,23 @@ + (void)readAttributeCurrentYWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::CurrentY::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::CurrentY::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDriftCompensationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67246,22 +67723,23 @@ + (void)readAttributeDriftCompensationWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::DriftCompensation::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::DriftCompensation::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCompensationTextWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -67289,22 +67767,23 @@ + (void)readAttributeCompensationTextWithClusterStateCache:(MTRClusterStateCache (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::CompensationText::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::CompensationText::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorTemperatureMiredsWithCompletion:(void (^)( @@ -67334,22 +67813,23 @@ + (void)readAttributeColorTemperatureMiredsWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorTemperatureMireds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorTemperatureMireds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67376,22 +67856,23 @@ + (void)readAttributeColorModeWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOptionsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67455,22 +67936,23 @@ + (void)readAttributeOptionsWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Options::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Options::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNumberOfPrimariesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67498,22 +67980,23 @@ + (void)readAttributeNumberOfPrimariesWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::NumberOfPrimaries::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::NumberOfPrimaries::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary1XWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67540,22 +68023,23 @@ + (void)readAttributePrimary1XWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary1X::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary1X::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary1YWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67582,22 +68066,23 @@ + (void)readAttributePrimary1YWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary1Y::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary1Y::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary1IntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67625,22 +68110,23 @@ + (void)readAttributePrimary1IntensityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary1Intensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary1Intensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary2XWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67667,22 +68153,23 @@ + (void)readAttributePrimary2XWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary2X::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary2X::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary2YWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67709,22 +68196,23 @@ + (void)readAttributePrimary2YWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary2Y::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary2Y::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary2IntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67752,22 +68240,23 @@ + (void)readAttributePrimary2IntensityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary2Intensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary2Intensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary3XWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67794,22 +68283,23 @@ + (void)readAttributePrimary3XWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary3X::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary3X::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary3YWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67836,22 +68326,23 @@ + (void)readAttributePrimary3YWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary3Y::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary3Y::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary3IntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67879,22 +68370,23 @@ + (void)readAttributePrimary3IntensityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary3Intensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary3Intensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary4XWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67921,22 +68413,23 @@ + (void)readAttributePrimary4XWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary4X::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary4X::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary4YWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -67963,22 +68456,23 @@ + (void)readAttributePrimary4YWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary4Y::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary4Y::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary4IntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68006,22 +68500,23 @@ + (void)readAttributePrimary4IntensityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary4Intensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary4Intensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary5XWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68048,22 +68543,23 @@ + (void)readAttributePrimary5XWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary5X::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary5X::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary5YWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68090,22 +68586,23 @@ + (void)readAttributePrimary5YWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary5Y::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary5Y::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary5IntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68133,22 +68630,23 @@ + (void)readAttributePrimary5IntensityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary5Intensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary5Intensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary6XWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68175,22 +68673,23 @@ + (void)readAttributePrimary6XWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary6X::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary6X::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary6YWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68217,22 +68716,23 @@ + (void)readAttributePrimary6YWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary6Y::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary6Y::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePrimary6IntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68260,22 +68760,23 @@ + (void)readAttributePrimary6IntensityWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::Primary6Intensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::Primary6Intensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWhitePointXWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68339,22 +68840,23 @@ + (void)readAttributeWhitePointXWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::WhitePointX::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::WhitePointX::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWhitePointYWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68418,22 +68920,23 @@ + (void)readAttributeWhitePointYWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::WhitePointY::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::WhitePointY::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointRXWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68497,22 +69000,23 @@ + (void)readAttributeColorPointRXWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointRX::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointRX::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointRYWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68576,22 +69080,23 @@ + (void)readAttributeColorPointRYWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointRY::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointRY::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointRIntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68662,22 +69167,23 @@ + (void)readAttributeColorPointRIntensityWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointRIntensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointRIntensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointGXWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68741,22 +69247,23 @@ + (void)readAttributeColorPointGXWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointGX::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointGX::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointGYWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68820,22 +69327,23 @@ + (void)readAttributeColorPointGYWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointGY::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointGY::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointGIntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68906,22 +69414,23 @@ + (void)readAttributeColorPointGIntensityWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointGIntensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointGIntensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointBXWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -68985,22 +69494,23 @@ + (void)readAttributeColorPointBXWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointBX::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointBX::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointBYWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69064,22 +69574,23 @@ + (void)readAttributeColorPointBYWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointBY::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointBY::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorPointBIntensityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69150,22 +69661,23 @@ + (void)readAttributeColorPointBIntensityWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorPointBIntensity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorPointBIntensity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnhancedCurrentHueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69194,22 +69706,23 @@ + (void)readAttributeEnhancedCurrentHueWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::EnhancedCurrentHue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnhancedColorModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69237,22 +69750,23 @@ + (void)readAttributeEnhancedColorModeWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::EnhancedColorMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::EnhancedColorMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorLoopActiveWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69280,22 +69794,23 @@ + (void)readAttributeColorLoopActiveWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorLoopActive::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorLoopActive::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorLoopDirectionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69324,22 +69839,23 @@ + (void)readAttributeColorLoopDirectionWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorLoopDirection::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorLoopDirection::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorLoopTimeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69366,22 +69882,23 @@ + (void)readAttributeColorLoopTimeWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorLoopTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorLoopTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorLoopStartEnhancedHueWithCompletion:(void (^)( @@ -69411,22 +69928,23 @@ + (void)readAttributeColorLoopStartEnhancedHueWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorLoopStartEnhancedHue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorLoopStoredEnhancedHueWithCompletion:(void (^)( @@ -69456,22 +69974,23 @@ + (void)readAttributeColorLoopStoredEnhancedHueWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorLoopStoredEnhancedHue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorCapabilitiesWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69499,22 +70018,23 @@ + (void)readAttributeColorCapabilitiesWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorCapabilities::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorCapabilities::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorTempPhysicalMinMiredsWithCompletion:(void (^)( @@ -69544,22 +70064,23 @@ + (void)readAttributeColorTempPhysicalMinMiredsWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMinMireds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMinMireds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeColorTempPhysicalMaxMiredsWithCompletion:(void (^)( @@ -69589,22 +70110,23 @@ + (void)readAttributeColorTempPhysicalMaxMiredsWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMaxMireds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ColorTempPhysicalMaxMireds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCoupleColorTempToLevelMinMiredsWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -69636,22 +70158,23 @@ + (void)readAttributeCoupleColorTempToLevelMinMiredsWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStartUpColorTemperatureMiredsWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -69724,22 +70247,23 @@ + (void)readAttributeStartUpColorTemperatureMiredsWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::StartUpColorTemperatureMireds::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -69768,7 +70292,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRColorControlGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ColorControlGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -69813,7 +70337,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRColorControlAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ColorControlAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -69856,22 +70380,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRColorControlAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ColorControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ColorControlAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69898,22 +70423,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -69941,22 +70467,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ColorControl::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ColorControl::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -72723,22 +73250,23 @@ + (void)readAttributePhysicalMinLevelWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::PhysicalMinLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhysicalMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -72766,22 +73294,23 @@ + (void)readAttributePhysicalMaxLevelWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::PhysicalMaxLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBallastStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -72808,22 +73337,23 @@ + (void)readAttributeBallastStatusWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -72887,22 +73417,23 @@ + (void)readAttributeMinLevelWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::MinLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxLevelWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -72966,22 +73497,23 @@ + (void)readAttributeMaxLevelWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::MaxLevel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeIntrinsicBalanceFactorWithCompletion:(void (^)( @@ -73053,22 +73585,23 @@ + (void)readAttributeIntrinsicBalanceFactorWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::IntrinsicBalanceFactor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBallastFactorAdjustmentWithCompletion:(void (^)( @@ -73140,22 +73673,23 @@ + (void)readAttributeBallastFactorAdjustmentWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::BallastFactorAdjustment::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampQuantityWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -73182,22 +73716,23 @@ + (void)readAttributeLampQuantityWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampQuantity::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampQuantity::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampTypeWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -73261,22 +73796,23 @@ + (void)readAttributeLampTypeWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampManufacturerWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -73341,22 +73877,23 @@ + (void)readAttributeLampManufacturerWithClusterStateCache:(MTRClusterStateCache (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampManufacturer::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampRatedHoursWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -73425,22 +73962,23 @@ + (void)readAttributeLampRatedHoursWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampRatedHours::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampBurnHoursWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -73509,22 +74047,23 @@ + (void)readAttributeLampBurnHoursWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHours::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampAlarmModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -73588,22 +74127,23 @@ + (void)readAttributeLampAlarmModeWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLampBurnHoursTripPointWithCompletion:(void (^)( @@ -73675,22 +74215,23 @@ + (void)readAttributeLampBurnHoursTripPointWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::LampBurnHoursTripPoint::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -73720,7 +74261,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BallastConfigurationGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -73766,7 +74307,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBallastConfigurationAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BallastConfigurationAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -73809,7 +74350,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBallastConfigurationAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BallastConfigurationAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -73852,22 +74393,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -73895,22 +74437,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = BallastConfiguration::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = BallastConfiguration::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -74897,22 +75440,23 @@ + (void)readAttributeMeasuredValueWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::MeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -74940,22 +75484,23 @@ + (void)readAttributeMinMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::MinMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -74983,22 +75528,23 @@ + (void)readAttributeMaxMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeToleranceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -75025,22 +75571,23 @@ + (void)readAttributeToleranceWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::Tolerance::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLightSensorTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -75068,22 +75615,23 @@ + (void)readAttributeLightSensorTypeWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::LightSensorType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -75113,7 +75661,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRIlluminanceMeasurementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(IlluminanceMeasurementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -75159,7 +75707,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRIlluminanceMeasurementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(IlluminanceMeasurementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -75202,7 +75750,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRIlluminanceMeasurementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(IlluminanceMeasurementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -75245,22 +75793,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -75288,22 +75837,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = IlluminanceMeasurement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -75793,22 +76343,23 @@ + (void)readAttributeMeasuredValueWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TemperatureMeasurement::Attributes::MeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -75836,22 +76387,23 @@ + (void)readAttributeMinMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TemperatureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -75879,22 +76431,23 @@ + (void)readAttributeMaxMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TemperatureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeToleranceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -75921,22 +76474,23 @@ + (void)readAttributeToleranceWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TemperatureMeasurement::Attributes::Tolerance::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TemperatureMeasurement::Attributes::Tolerance::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -75966,7 +76520,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTemperatureMeasurementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TemperatureMeasurementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -76012,7 +76566,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTemperatureMeasurementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TemperatureMeasurementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -76055,7 +76609,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTemperatureMeasurementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TemperatureMeasurementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -76098,22 +76652,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TemperatureMeasurement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TemperatureMeasurement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76141,22 +76696,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TemperatureMeasurement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -76602,22 +77158,23 @@ + (void)readAttributeMeasuredValueWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::MeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::MeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76645,22 +77202,23 @@ + (void)readAttributeMinMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::MinMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76688,22 +77246,23 @@ + (void)readAttributeMaxMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeToleranceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76730,22 +77289,23 @@ + (void)readAttributeToleranceWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::Tolerance::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::Tolerance::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeScaledValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76772,22 +77332,23 @@ + (void)readAttributeScaledValueWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::ScaledValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::ScaledValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinScaledValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76814,22 +77375,23 @@ + (void)readAttributeMinScaledValueWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::MinScaledValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::MinScaledValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxScaledValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76856,22 +77418,23 @@ + (void)readAttributeMaxScaledValueWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::MaxScaledValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::MaxScaledValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeScaledToleranceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76899,22 +77462,23 @@ + (void)readAttributeScaledToleranceWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::ScaledTolerance::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::ScaledTolerance::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeScaleWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -76941,22 +77505,23 @@ + (void)readAttributeScaleWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::Scale::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::Scale::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -76986,7 +77551,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPressureMeasurementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PressureMeasurementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -77031,7 +77596,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPressureMeasurementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PressureMeasurementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -77074,7 +77639,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRPressureMeasurementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(PressureMeasurementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -77117,22 +77682,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -77160,22 +77726,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = PressureMeasurement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = PressureMeasurement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -77837,22 +78404,23 @@ + (void)readAttributeMeasuredValueWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FlowMeasurement::Attributes::MeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FlowMeasurement::Attributes::MeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -77880,22 +78448,23 @@ + (void)readAttributeMinMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FlowMeasurement::Attributes::MinMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -77923,22 +78492,23 @@ + (void)readAttributeMaxMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FlowMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeToleranceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -77965,22 +78535,23 @@ + (void)readAttributeToleranceWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FlowMeasurement::Attributes::Tolerance::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FlowMeasurement::Attributes::Tolerance::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -78009,7 +78580,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFlowMeasurementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FlowMeasurementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -78054,7 +78625,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFlowMeasurementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FlowMeasurementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -78097,7 +78668,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFlowMeasurementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(FlowMeasurementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -78140,22 +78711,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FlowMeasurement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FlowMeasurement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -78183,22 +78755,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = FlowMeasurement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = FlowMeasurement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -78644,22 +79217,23 @@ + (void)readAttributeMeasuredValueWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RelativeHumidityMeasurement::Attributes::MeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMinMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -78687,22 +79261,23 @@ + (void)readAttributeMinMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMaxMeasuredValueWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -78730,22 +79305,23 @@ + (void)readAttributeMaxMeasuredValueWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeToleranceWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -78772,22 +79348,23 @@ + (void)readAttributeToleranceWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RelativeHumidityMeasurement::Attributes::Tolerance::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -78817,7 +79394,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRRelativeHumidityMeasurementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(RelativeHumidityMeasurementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -78863,7 +79440,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRRelativeHumidityMeasurementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(RelativeHumidityMeasurementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -78907,7 +79484,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRRelativeHumidityMeasurementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(RelativeHumidityMeasurementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -78950,22 +79527,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = RelativeHumidityMeasurement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RelativeHumidityMeasurement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -78993,22 +79571,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = RelativeHumidityMeasurement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -79454,22 +80033,23 @@ + (void)readAttributeOccupancyWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::Occupancy::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::Occupancy::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupancySensorTypeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -79498,22 +80078,23 @@ + (void)readAttributeOccupancySensorTypeWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::OccupancySensorType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::OccupancySensorType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOccupancySensorTypeBitmapWithCompletion:(void (^)( @@ -79543,22 +80124,23 @@ + (void)readAttributeOccupancySensorTypeBitmapWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::OccupancySensorTypeBitmap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePIROccupiedToUnoccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -79626,22 +80208,23 @@ + (void)readAttributePIROccupiedToUnoccupiedDelayWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::PirOccupiedToUnoccupiedDelay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::PirOccupiedToUnoccupiedDelay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePIRUnoccupiedToOccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -79709,22 +80292,23 @@ + (void)readAttributePIRUnoccupiedToOccupiedDelayWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::PirUnoccupiedToOccupiedDelay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::PirUnoccupiedToOccupiedDelay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePIRUnoccupiedToOccupiedThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -79794,22 +80378,23 @@ + (void)readAttributePIRUnoccupiedToOccupiedThresholdWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::PirUnoccupiedToOccupiedThreshold::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::PirUnoccupiedToOccupiedThreshold::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -79879,22 +80464,23 @@ + (void)readAttributeUltrasonicOccupiedToUnoccupiedDelayWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUltrasonicUnoccupiedToOccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -79964,22 +80550,23 @@ + (void)readAttributeUltrasonicUnoccupiedToOccupiedDelayWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -80051,22 +80638,23 @@ + (void)readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithClusterStateCach NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -80138,22 +80726,23 @@ + (void)readAttributePhysicalContactOccupiedToUnoccupiedDelayWithClusterStateCac NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -80225,22 +80814,23 @@ + (void)readAttributePhysicalContactUnoccupiedToOccupiedDelayWithClusterStateCac NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -80312,22 +80902,23 @@ + (void)readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -80356,7 +80947,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROccupancySensingGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OccupancySensingGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -80401,7 +80992,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROccupancySensingAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OccupancySensingAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -80444,7 +81035,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROccupancySensingAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(OccupancySensingAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -80487,22 +81078,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -80530,22 +81122,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = OccupancySensing::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = OccupancySensing::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -81482,22 +82075,23 @@ + (void)readAttributeMACAddressWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WakeOnLan::Attributes::MACAddress::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WakeOnLan::Attributes::MACAddress::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -81526,7 +82120,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWakeOnLANGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WakeOnLANGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -81571,7 +82165,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWakeOnLANAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(WakeOnLANAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -81614,22 +82208,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRWakeOnLANAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(WakeOnLANAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WakeOnLan::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(WakeOnLANAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WakeOnLan::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -81656,22 +82251,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WakeOnLan::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WakeOnLan::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -81699,22 +82295,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = WakeOnLan::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = WakeOnLan::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -82115,22 +82712,23 @@ + (void)readAttributeChannelListWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRChannelChannelListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ChannelChannelListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Channel::Attributes::ChannelList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ChannelChannelListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Channel::Attributes::ChannelList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLineupWithCompletion:(void (^)( @@ -82160,22 +82758,23 @@ + (void)readAttributeLineupWithClusterStateCache:(MTRClusterStateCacheContainer NSError * _Nullable error))completion { auto * bridge = new MTRChannelLineupStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ChannelLineupStructAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Channel::Attributes::Lineup::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ChannelLineupStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Channel::Attributes::Lineup::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentChannelWithCompletion:(void (^)(MTRChannelClusterChannelInfo * _Nullable value, @@ -82206,22 +82805,23 @@ + (void)readAttributeCurrentChannelWithClusterStateCache:(MTRClusterStateCacheCo NSError * _Nullable error))completion { auto * bridge = new MTRChannelCurrentChannelStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ChannelCurrentChannelStructAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Channel::Attributes::CurrentChannel::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(ChannelCurrentChannelStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Channel::Attributes::CurrentChannel::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -82250,7 +82850,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRChannelGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ChannelGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -82295,7 +82895,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRChannelAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ChannelAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -82338,22 +82938,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRChannelAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(ChannelAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Channel::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(ChannelAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Channel::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -82380,22 +82981,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Channel::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Channel::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -82423,22 +83025,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = Channel::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -82892,22 +83495,23 @@ + (void)readAttributeTargetListWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTargetNavigatorTargetListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(TargetNavigatorTargetListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TargetNavigator::Attributes::TargetList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(TargetNavigatorTargetListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TargetNavigator::Attributes::TargetList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentTargetWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -82934,22 +83538,23 @@ + (void)readAttributeCurrentTargetWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TargetNavigator::Attributes::CurrentTarget::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TargetNavigator::Attributes::CurrentTarget::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -82978,7 +83583,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTargetNavigatorGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TargetNavigatorGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -83023,7 +83628,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTargetNavigatorAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TargetNavigatorAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -83066,7 +83671,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRTargetNavigatorAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(TargetNavigatorAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -83109,22 +83714,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TargetNavigator::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TargetNavigator::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -83152,22 +83758,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TargetNavigator::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TargetNavigator::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -83866,7 +84473,7 @@ + (void)readAttributeCurrentStateWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaPlaybackClusterPlaybackStateEnumAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaPlaybackClusterPlaybackStateEnumAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -83909,22 +84516,23 @@ + (void)readAttributeStartTimeWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::StartTime::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::StartTime::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDurationWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -83951,22 +84559,23 @@ + (void)readAttributeDurationWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::Duration::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::Duration::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSampledPositionWithCompletion:(void (^)(MTRMediaPlaybackClusterPlaybackPosition * _Nullable value, @@ -83997,7 +84606,7 @@ + (void)readAttributeSampledPositionWithClusterStateCache:(MTRClusterStateCacheC NSError * _Nullable error))completion { auto * bridge = new MTRMediaPlaybackSampledPositionStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaPlaybackSampledPositionStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -84040,22 +84649,23 @@ + (void)readAttributePlaybackSpeedWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFloatAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(FloatAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::PlaybackSpeed::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(FloatAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::PlaybackSpeed::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSeekRangeEndWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -84082,22 +84692,23 @@ + (void)readAttributeSeekRangeEndWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::SeekRangeEnd::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeSeekRangeStartWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -84124,22 +84735,23 @@ + (void)readAttributeSeekRangeStartWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::SeekRangeStart::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::SeekRangeStart::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -84168,7 +84780,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaPlaybackGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaPlaybackGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -84213,7 +84825,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaPlaybackAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaPlaybackAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -84256,7 +84868,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaPlaybackAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaPlaybackAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -84299,22 +84911,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -84342,22 +84955,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaPlayback::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaPlayback::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -85207,22 +85821,23 @@ + (void)readAttributeInputListWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaInputInputListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(MediaInputInputListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaInput::Attributes::InputList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(MediaInputInputListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaInput::Attributes::InputList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentInputWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -85249,22 +85864,23 @@ + (void)readAttributeCurrentInputWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaInput::Attributes::CurrentInput::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaInput::Attributes::CurrentInput::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -85293,7 +85909,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaInputGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaInputGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -85338,7 +85954,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaInputAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(MediaInputAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -85381,22 +85997,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRMediaInputAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(MediaInputAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaInput::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(MediaInputAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaInput::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -85423,22 +86040,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaInput::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaInput::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -85466,22 +86084,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = MediaInput::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = MediaInput::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -85900,7 +86519,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLowPowerGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LowPowerGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -85945,7 +86564,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLowPowerAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(LowPowerAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -85988,22 +86607,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRLowPowerAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(LowPowerAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LowPower::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(LowPowerAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LowPower::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -86030,22 +86650,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LowPower::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LowPower::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -86073,22 +86694,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = LowPower::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = LowPower::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -86397,7 +87019,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRKeypadInputGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(KeypadInputGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -86442,7 +87064,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRKeypadInputAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(KeypadInputAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -86485,22 +87107,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRKeypadInputAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(KeypadInputAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = KeypadInput::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(KeypadInputAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = KeypadInput::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -86527,22 +87150,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = KeypadInput::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = KeypadInput::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -86570,22 +87194,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = KeypadInput::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = KeypadInput::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -87076,7 +87701,7 @@ + (void)readAttributeAcceptHeaderWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRContentLauncherAcceptHeaderListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ContentLauncherAcceptHeaderListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -87159,22 +87784,23 @@ + (void)readAttributeSupportedStreamingProtocolsWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ContentLauncher::Attributes::SupportedStreamingProtocols::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -87203,7 +87829,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRContentLauncherGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ContentLauncherGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -87248,7 +87874,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRContentLauncherAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ContentLauncherAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -87291,7 +87917,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRContentLauncherAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ContentLauncherAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -87334,22 +87960,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ContentLauncher::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ContentLauncher::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -87377,22 +88004,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ContentLauncher::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ContentLauncher::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -87841,22 +88469,23 @@ + (void)readAttributeOutputListWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAudioOutputOutputListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(AudioOutputOutputListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AudioOutput::Attributes::OutputList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(AudioOutputOutputListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AudioOutput::Attributes::OutputList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentOutputWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -87883,22 +88512,23 @@ + (void)readAttributeCurrentOutputWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AudioOutput::Attributes::CurrentOutput::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AudioOutput::Attributes::CurrentOutput::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -87927,7 +88557,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAudioOutputGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AudioOutputGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -87972,7 +88602,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAudioOutputAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AudioOutputAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -88015,22 +88645,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAudioOutputAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(AudioOutputAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AudioOutput::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(AudioOutputAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AudioOutput::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -88057,22 +88688,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AudioOutput::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AudioOutput::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -88100,22 +88732,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AudioOutput::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AudioOutput::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -88572,7 +89205,7 @@ + (void)readAttributeCatalogListWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationLauncherCatalogListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationLauncherCatalogListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -88669,7 +89302,7 @@ + (void)readAttributeCurrentAppWithClusterStateCache:(MTRClusterStateCacheContai NSError * _Nullable error))completion { auto * bridge = new MTRApplicationLauncherCurrentAppStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationLauncherCurrentAppStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -88715,7 +89348,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationLauncherGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationLauncherGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -88760,7 +89393,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationLauncherAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationLauncherAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -88803,7 +89436,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationLauncherAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationLauncherAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -88846,22 +89479,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationLauncher::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationLauncher::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -88889,22 +89523,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationLauncher::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationLauncher::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -89308,22 +89943,23 @@ + (void)readAttributeVendorNameWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::VendorName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::VendorName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeVendorIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -89350,22 +89986,23 @@ + (void)readAttributeVendorIDWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRVendorIdAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::VendorID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::VendorID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeApplicationNameWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -89393,22 +90030,23 @@ + (void)readAttributeApplicationNameWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::ApplicationName::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::ApplicationName::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeProductIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -89435,22 +90073,23 @@ + (void)readAttributeProductIDWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::ProductID::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::ProductID::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeApplicationWithCompletion:(void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, @@ -89482,7 +90121,7 @@ + (void)readAttributeApplicationWithClusterStateCache:(MTRClusterStateCacheConta NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicApplicationStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationBasicApplicationStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -89526,7 +90165,7 @@ + (void)readAttributeStatusWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicClusterApplicationStatusEnumAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationBasicClusterApplicationStatusEnumAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -89571,22 +90210,23 @@ + (void)readAttributeApplicationVersionWithClusterStateCache:(MTRClusterStateCac (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::ApplicationVersion::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::ApplicationVersion::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAllowedVendorListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -89614,7 +90254,7 @@ + (void)readAttributeAllowedVendorListWithClusterStateCache:(MTRClusterStateCach (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicAllowedVendorListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationBasicAllowedVendorListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -89659,7 +90299,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationBasicGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -89704,7 +90344,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationBasicAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -89747,7 +90387,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ApplicationBasicAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -89790,22 +90430,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -89833,22 +90474,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ApplicationBasic::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ApplicationBasic::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -90570,7 +91212,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccountLoginGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AccountLoginGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -90615,7 +91257,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccountLoginAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(AccountLoginAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -90658,22 +91300,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRAccountLoginAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(AccountLoginAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccountLogin::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(AccountLoginAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccountLogin::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -90700,22 +91343,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccountLogin::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccountLogin::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -90743,22 +91387,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AccountLogin::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = AccountLogin::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -91118,22 +91763,23 @@ + (void)readAttributeMeasurementTypeWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasurementType::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91160,22 +91806,23 @@ + (void)readAttributeDcVoltageWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcVoltageMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91202,22 +91849,23 @@ + (void)readAttributeDcVoltageMinWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcVoltageMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91244,22 +91892,23 @@ + (void)readAttributeDcVoltageMaxWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91286,22 +91935,23 @@ + (void)readAttributeDcCurrentWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcCurrentMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91328,22 +91978,23 @@ + (void)readAttributeDcCurrentMinWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcCurrentMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91370,22 +92021,23 @@ + (void)readAttributeDcCurrentMaxWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91412,22 +92064,23 @@ + (void)readAttributeDcPowerWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcPower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcPower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcPowerMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91454,22 +92107,23 @@ + (void)readAttributeDcPowerMinWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcPowerMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91496,22 +92150,23 @@ + (void)readAttributeDcPowerMaxWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcVoltageMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91540,22 +92195,23 @@ + (void)readAttributeDcVoltageMultiplierWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcVoltageDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91583,22 +92239,23 @@ + (void)readAttributeDcVoltageDivisorWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcVoltageDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcCurrentMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91627,22 +92284,23 @@ + (void)readAttributeDcCurrentMultiplierWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcCurrentDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91670,22 +92328,23 @@ + (void)readAttributeDcCurrentDivisorWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcCurrentDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcPowerMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91713,22 +92372,23 @@ + (void)readAttributeDcPowerMultiplierWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeDcPowerDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91755,22 +92415,23 @@ + (void)readAttributeDcPowerDivisorWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::DcPowerDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::DcPowerDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcFrequencyWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91797,22 +92458,23 @@ + (void)readAttributeAcFrequencyWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcFrequency::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequency::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcFrequencyMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91839,22 +92501,23 @@ + (void)readAttributeAcFrequencyMinWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcFrequencyMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91881,22 +92544,23 @@ + (void)readAttributeAcFrequencyMaxWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNeutralCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91923,22 +92587,23 @@ + (void)readAttributeNeutralCurrentWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::NeutralCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::NeutralCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTotalActivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -91966,22 +92631,23 @@ + (void)readAttributeTotalActivePowerWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::TotalActivePower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTotalReactivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92010,22 +92676,23 @@ + (void)readAttributeTotalReactivePowerWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::TotalReactivePower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::TotalReactivePower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeTotalApparentPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92054,22 +92721,23 @@ + (void)readAttributeTotalApparentPowerWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::TotalApparentPower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::TotalApparentPower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasured1stHarmonicCurrentWithCompletion:(void (^)( @@ -92099,22 +92767,23 @@ + (void)readAttributeMeasured1stHarmonicCurrentWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasured3rdHarmonicCurrentWithCompletion:(void (^)( @@ -92144,22 +92813,23 @@ + (void)readAttributeMeasured3rdHarmonicCurrentWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasured5thHarmonicCurrentWithCompletion:(void (^)( @@ -92189,22 +92859,23 @@ + (void)readAttributeMeasured5thHarmonicCurrentWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasured7thHarmonicCurrentWithCompletion:(void (^)( @@ -92234,22 +92905,23 @@ + (void)readAttributeMeasured7thHarmonicCurrentWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasured9thHarmonicCurrentWithCompletion:(void (^)( @@ -92279,22 +92951,23 @@ + (void)readAttributeMeasured9thHarmonicCurrentWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasured11thHarmonicCurrentWithCompletion:(void (^)( @@ -92324,22 +92997,23 @@ + (void)readAttributeMeasured11thHarmonicCurrentWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasuredPhase1stHarmonicCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92371,22 +93045,23 @@ + (void)readAttributeMeasuredPhase1stHarmonicCurrentWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasuredPhase3rdHarmonicCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92418,22 +93093,23 @@ + (void)readAttributeMeasuredPhase3rdHarmonicCurrentWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasuredPhase5thHarmonicCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92465,22 +93141,23 @@ + (void)readAttributeMeasuredPhase5thHarmonicCurrentWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasuredPhase7thHarmonicCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92512,22 +93189,23 @@ + (void)readAttributeMeasuredPhase7thHarmonicCurrentWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasuredPhase9thHarmonicCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92559,22 +93237,23 @@ + (void)readAttributeMeasuredPhase9thHarmonicCurrentWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeMeasuredPhase11thHarmonicCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92606,22 +93285,23 @@ + (void)readAttributeMeasuredPhase11thHarmonicCurrentWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcFrequencyMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92650,22 +93330,23 @@ + (void)readAttributeAcFrequencyMultiplierWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcFrequencyDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92694,22 +93375,23 @@ + (void)readAttributeAcFrequencyDivisorWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcFrequencyDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePowerMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92737,22 +93419,23 @@ + (void)readAttributePowerMultiplierWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::PowerMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::PowerMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePowerDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92779,22 +93462,23 @@ + (void)readAttributePowerDivisorWithClusterStateCache:(MTRClusterStateCacheCont completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::PowerDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::PowerDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeHarmonicCurrentMultiplierWithCompletion:(void (^)( @@ -92824,22 +93508,23 @@ + (void)readAttributeHarmonicCurrentMultiplierWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePhaseHarmonicCurrentMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -92870,22 +93555,23 @@ + (void)readAttributePhaseHarmonicCurrentMultiplierWithClusterStateCache:(MTRClu NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstantaneousVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -92914,22 +93600,23 @@ + (void)readAttributeInstantaneousVoltageWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstantaneousLineCurrentWithCompletion:(void (^)( @@ -92959,22 +93646,23 @@ + (void)readAttributeInstantaneousLineCurrentWithClusterStateCache:(MTRClusterSt NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousLineCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousLineCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstantaneousActiveCurrentWithCompletion:(void (^)( @@ -93004,22 +93692,23 @@ + (void)readAttributeInstantaneousActiveCurrentWithClusterStateCache:(MTRCluster NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstantaneousReactiveCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -93050,22 +93739,23 @@ + (void)readAttributeInstantaneousReactiveCurrentWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInstantaneousPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93094,22 +93784,23 @@ + (void)readAttributeInstantaneousPowerWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousPower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::InstantaneousPower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93136,22 +93827,23 @@ + (void)readAttributeRmsVoltageWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93178,22 +93870,23 @@ + (void)readAttributeRmsVoltageMinWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93220,22 +93913,23 @@ + (void)readAttributeRmsVoltageMaxWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93262,22 +93956,23 @@ + (void)readAttributeRmsCurrentWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrent::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93304,22 +93999,23 @@ + (void)readAttributeRmsCurrentMinWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93346,22 +94042,23 @@ + (void)readAttributeRmsCurrentMaxWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93388,22 +94085,23 @@ + (void)readAttributeActivePowerWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerMinWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93430,22 +94128,23 @@ + (void)readAttributeActivePowerMinWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMin::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerMaxWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93472,22 +94171,23 @@ + (void)readAttributeActivePowerMaxWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMax::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReactivePowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93514,22 +94214,23 @@ + (void)readAttributeReactivePowerWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ReactivePower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ReactivePower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeApparentPowerWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93556,22 +94257,23 @@ + (void)readAttributeApparentPowerWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ApparentPower::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ApparentPower::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePowerFactorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -93598,22 +94300,23 @@ + (void)readAttributePowerFactorWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::PowerFactor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::PowerFactor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsVoltageMeasurementPeriodWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -93683,22 +94386,23 @@ + (void)readAttributeAverageRmsVoltageMeasurementPeriodWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsUnderVoltageCounterWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -93766,22 +94470,23 @@ + (void)readAttributeAverageRmsUnderVoltageCounterWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounter::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounter::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeOverVoltagePeriodWithCompletion:(void (^)( @@ -93848,22 +94553,23 @@ + (void)readAttributeRmsExtremeOverVoltagePeriodWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeUnderVoltagePeriodWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -93931,22 +94637,23 @@ + (void)readAttributeRmsExtremeUnderVoltagePeriodWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSagPeriodWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94012,22 +94719,23 @@ + (void)readAttributeRmsVoltageSagPeriodWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSwellPeriodWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94093,22 +94801,23 @@ + (void)readAttributeRmsVoltageSwellPeriodWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriod::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriod::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcVoltageMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94137,22 +94846,23 @@ + (void)readAttributeAcVoltageMultiplierWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcVoltageDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94180,22 +94890,23 @@ + (void)readAttributeAcVoltageDivisorWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcCurrentMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94224,22 +94935,23 @@ + (void)readAttributeAcCurrentMultiplierWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcCurrentDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94267,22 +94979,23 @@ + (void)readAttributeAcCurrentDivisorWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcPowerMultiplierWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94310,22 +95023,23 @@ + (void)readAttributeAcPowerMultiplierWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcPowerMultiplier::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcPowerMultiplier::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcPowerDivisorWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94352,22 +95066,23 @@ + (void)readAttributeAcPowerDivisorWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcPowerDivisor::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcPowerDivisor::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOverloadAlarmsMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94433,22 +95148,23 @@ + (void)readAttributeOverloadAlarmsMaskWithClusterStateCache:(MTRClusterStateCac (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::OverloadAlarmsMask::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::OverloadAlarmsMask::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeVoltageOverloadWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94476,22 +95192,23 @@ + (void)readAttributeVoltageOverloadWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::VoltageOverload::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::VoltageOverload::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCurrentOverloadWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94519,22 +95236,23 @@ + (void)readAttributeCurrentOverloadWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::CurrentOverload::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::CurrentOverload::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcOverloadAlarmsMaskWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94600,22 +95318,23 @@ + (void)readAttributeAcOverloadAlarmsMaskWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcOverloadAlarmsMask::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcOverloadAlarmsMask::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcVoltageOverloadWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94643,22 +95362,23 @@ + (void)readAttributeAcVoltageOverloadWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageOverload::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcVoltageOverload::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcCurrentOverloadWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94686,22 +95406,23 @@ + (void)readAttributeAcCurrentOverloadWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentOverload::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcCurrentOverload::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcActivePowerOverloadWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94730,22 +95451,23 @@ + (void)readAttributeAcActivePowerOverloadWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcActivePowerOverload::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcActivePowerOverload::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAcReactivePowerOverloadWithCompletion:(void (^)( @@ -94775,22 +95497,23 @@ + (void)readAttributeAcReactivePowerOverloadWithClusterStateCache:(MTRClusterSta NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AcReactivePowerOverload::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AcReactivePowerOverload::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsOverVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94819,22 +95542,23 @@ + (void)readAttributeAverageRmsOverVoltageWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsUnderVoltageWithCompletion:(void (^)( @@ -94864,22 +95588,23 @@ + (void)readAttributeAverageRmsUnderVoltageWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeOverVoltageWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94908,22 +95633,23 @@ + (void)readAttributeRmsExtremeOverVoltageWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeUnderVoltageWithCompletion:(void (^)( @@ -94953,22 +95679,23 @@ + (void)readAttributeRmsExtremeUnderVoltageWithClusterStateCache:(MTRClusterStat NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSagWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -94995,22 +95722,23 @@ + (void)readAttributeRmsVoltageSagWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSag::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSag::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSwellWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95038,22 +95766,23 @@ + (void)readAttributeRmsVoltageSwellWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwell::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwell::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLineCurrentPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95081,22 +95810,23 @@ + (void)readAttributeLineCurrentPhaseBWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::LineCurrentPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::LineCurrentPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveCurrentPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95125,22 +95855,23 @@ + (void)readAttributeActiveCurrentPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReactiveCurrentPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95169,22 +95900,23 @@ + (void)readAttributeReactiveCurrentPhaseBWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltagePhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95212,22 +95944,23 @@ + (void)readAttributeRmsVoltagePhaseBWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltagePhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltagePhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageMinPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95256,22 +95989,23 @@ + (void)readAttributeRmsVoltageMinPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageMaxPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95300,22 +96034,23 @@ + (void)readAttributeRmsVoltageMaxPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95343,22 +96078,23 @@ + (void)readAttributeRmsCurrentPhaseBWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentMinPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95387,22 +96123,23 @@ + (void)readAttributeRmsCurrentMinPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentMaxPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95431,22 +96168,23 @@ + (void)readAttributeRmsCurrentMaxPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95474,22 +96212,23 @@ + (void)readAttributeActivePowerPhaseBWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerMinPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95518,22 +96257,23 @@ + (void)readAttributeActivePowerMinPhaseBWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerMaxPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95562,22 +96302,23 @@ + (void)readAttributeActivePowerMaxPhaseBWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReactivePowerPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95606,22 +96347,23 @@ + (void)readAttributeReactivePowerPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ReactivePowerPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ReactivePowerPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeApparentPowerPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95650,22 +96392,23 @@ + (void)readAttributeApparentPowerPhaseBWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ApparentPowerPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ApparentPowerPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePowerFactorPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -95693,22 +96436,23 @@ + (void)readAttributePowerFactorPhaseBWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::PowerFactorPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::PowerFactorPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -95740,22 +96484,23 @@ + (void)readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithClusterStateCac NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsOverVoltageCounterPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -95787,22 +96532,23 @@ + (void)readAttributeAverageRmsOverVoltageCounterPhaseBWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsUnderVoltageCounterPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -95834,22 +96580,23 @@ + (void)readAttributeAverageRmsUnderVoltageCounterPhaseBWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeOverVoltagePeriodPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -95881,22 +96628,23 @@ + (void)readAttributeRmsExtremeOverVoltagePeriodPhaseBWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -95928,22 +96676,23 @@ + (void)readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSagPeriodPhaseBWithCompletion:(void (^)( @@ -95973,22 +96722,23 @@ + (void)readAttributeRmsVoltageSagPeriodPhaseBWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSwellPeriodPhaseBWithCompletion:(void (^)( @@ -96018,22 +96768,23 @@ + (void)readAttributeRmsVoltageSwellPeriodPhaseBWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLineCurrentPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96061,22 +96812,23 @@ + (void)readAttributeLineCurrentPhaseCWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::LineCurrentPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::LineCurrentPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActiveCurrentPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96105,22 +96857,23 @@ + (void)readAttributeActiveCurrentPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReactiveCurrentPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96149,22 +96902,23 @@ + (void)readAttributeReactiveCurrentPhaseCWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltagePhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96192,22 +96946,23 @@ + (void)readAttributeRmsVoltagePhaseCWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltagePhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltagePhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageMinPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96236,22 +96991,23 @@ + (void)readAttributeRmsVoltageMinPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageMaxPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96280,22 +97036,23 @@ + (void)readAttributeRmsVoltageMaxPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96323,22 +97080,23 @@ + (void)readAttributeRmsCurrentPhaseCWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentMinPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96367,22 +97125,23 @@ + (void)readAttributeRmsCurrentMinPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsCurrentMaxPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96411,22 +97170,23 @@ + (void)readAttributeRmsCurrentMaxPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96454,22 +97214,23 @@ + (void)readAttributeActivePowerPhaseCWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerMinPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96498,22 +97259,23 @@ + (void)readAttributeActivePowerMinPhaseCWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeActivePowerMaxPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96542,22 +97304,23 @@ + (void)readAttributeActivePowerMaxPhaseCWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeReactivePowerPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96586,22 +97349,23 @@ + (void)readAttributeReactivePowerPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ReactivePowerPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ReactivePowerPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeApparentPowerPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96630,22 +97394,23 @@ + (void)readAttributeApparentPowerPhaseCWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ApparentPowerPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ApparentPowerPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributePowerFactorPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -96673,22 +97438,23 @@ + (void)readAttributePowerFactorPhaseCWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::PowerFactorPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::PowerFactorPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -96720,22 +97486,23 @@ + (void)readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithClusterStateCac NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsOverVoltageCounterPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -96767,22 +97534,23 @@ + (void)readAttributeAverageRmsOverVoltageCounterPhaseCWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeAverageRmsUnderVoltageCounterPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -96814,22 +97582,23 @@ + (void)readAttributeAverageRmsUnderVoltageCounterPhaseCWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeOverVoltagePeriodPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -96861,22 +97630,23 @@ + (void)readAttributeRmsExtremeOverVoltagePeriodPhaseCWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -96908,22 +97678,23 @@ + (void)readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSagPeriodPhaseCWithCompletion:(void (^)( @@ -96953,22 +97724,23 @@ + (void)readAttributeRmsVoltageSagPeriodPhaseCWithClusterStateCache:(MTRClusterS NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRmsVoltageSwellPeriodPhaseCWithCompletion:(void (^)( @@ -96998,22 +97770,23 @@ + (void)readAttributeRmsVoltageSwellPeriodPhaseCWithClusterStateCache:(MTRCluste NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -97043,7 +97816,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRElectricalMeasurementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ElectricalMeasurementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -97089,7 +97862,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRElectricalMeasurementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ElectricalMeasurementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -97132,7 +97905,7 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRElectricalMeasurementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(ElectricalMeasurementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -97175,22 +97948,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -97218,22 +97992,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ElectricalMeasurement::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end @@ -104719,22 +105494,23 @@ + (void)readAttributeBooleanWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Boolean::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Boolean::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBitmap8WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -104798,22 +105574,23 @@ + (void)readAttributeBitmap8WithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingBitmap8AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingBitmap8AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Bitmap8::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(UnitTestingBitmap8AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Bitmap8::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBitmap16WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -104877,22 +105654,23 @@ + (void)readAttributeBitmap16WithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingBitmap16AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingBitmap16AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Bitmap16::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(UnitTestingBitmap16AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Bitmap16::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBitmap32WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -104956,22 +105734,23 @@ + (void)readAttributeBitmap32WithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingBitmap32AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingBitmap32AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Bitmap32::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(UnitTestingBitmap32AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Bitmap32::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeBitmap64WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105035,22 +105814,23 @@ + (void)readAttributeBitmap64WithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingBitmap64AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingBitmap64AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Bitmap64::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(UnitTestingBitmap64AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Bitmap64::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt8uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105114,22 +105894,23 @@ + (void)readAttributeInt8uWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int8u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int8u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt16uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105193,22 +105974,23 @@ + (void)readAttributeInt16uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int16u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int16u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt24uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105272,22 +106054,23 @@ + (void)readAttributeInt24uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int24u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int24u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt32uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105351,22 +106134,23 @@ + (void)readAttributeInt32uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int32u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int32u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt40uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105430,22 +106214,23 @@ + (void)readAttributeInt40uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int40u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int40u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt48uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105509,22 +106294,23 @@ + (void)readAttributeInt48uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int48u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int48u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt56uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105588,22 +106374,23 @@ + (void)readAttributeInt56uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int56u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int56u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt64uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105667,22 +106454,23 @@ + (void)readAttributeInt64uWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int64u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int64u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt8sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105746,22 +106534,23 @@ + (void)readAttributeInt8sWithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int8s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int8s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt16sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105825,22 +106614,23 @@ + (void)readAttributeInt16sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int16s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int16s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt24sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105904,22 +106694,23 @@ + (void)readAttributeInt24sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int24s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int24s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt32sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -105983,22 +106774,23 @@ + (void)readAttributeInt32sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int32s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int32s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt40sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106062,22 +106854,23 @@ + (void)readAttributeInt40sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int40s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int40s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt48sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106141,22 +106934,23 @@ + (void)readAttributeInt48sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int48s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int48s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt56sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106220,22 +107014,23 @@ + (void)readAttributeInt56sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int56s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int56s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeInt64sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106299,22 +107094,23 @@ + (void)readAttributeInt64sWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Int64s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Int64s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnum8WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106378,22 +107174,23 @@ + (void)readAttributeEnum8WithClusterStateCache:(MTRClusterStateCacheContainer * completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Enum8::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Enum8::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEnum16WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106457,22 +107254,23 @@ + (void)readAttributeEnum16WithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Enum16::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Enum16::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFloatSingleWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106536,22 +107334,23 @@ + (void)readAttributeFloatSingleWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRFloatAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(FloatAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::FloatSingle::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(FloatAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::FloatSingle::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFloatDoubleWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -106615,22 +107414,23 @@ + (void)readAttributeFloatDoubleWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRDoubleAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(DoubleAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::FloatDouble::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(DoubleAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::FloatDouble::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeOctetStringWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion @@ -106694,22 +107494,23 @@ + (void)readAttributeOctetStringWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(OctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::OctetString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(OctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::OctetString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeListInt8uWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -106794,22 +107595,23 @@ + (void)readAttributeListInt8uWithClusterStateCache:(MTRClusterStateCacheContain completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingListInt8uListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingListInt8uListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::ListInt8u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(UnitTestingListInt8uListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::ListInt8u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeListOctetStringWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -106894,7 +107696,7 @@ + (void)readAttributeListOctetStringWithClusterStateCache:(MTRClusterStateCacheC completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingListOctetStringListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingListOctetStringListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -106998,7 +107800,7 @@ + (void)readAttributeListStructOctetStringWithClusterStateCache:(MTRClusterState (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingListStructOctetStringListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingListStructOctetStringListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -107078,22 +107880,23 @@ + (void)readAttributeLongOctetStringWithClusterStateCache:(MTRClusterStateCacheC completion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTROctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(OctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::LongOctetString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(OctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::LongOctetString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeCharStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -107157,22 +107960,23 @@ + (void)readAttributeCharStringWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::CharString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::CharString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeLongCharStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -107236,22 +108040,23 @@ + (void)readAttributeLongCharStringWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::LongCharString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(CharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::LongCharString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEpochUsWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -107315,22 +108120,23 @@ + (void)readAttributeEpochUsWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::EpochUs::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::EpochUs::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeEpochSWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -107394,22 +108200,23 @@ + (void)readAttributeEpochSWithClusterStateCache:(MTRClusterStateCacheContainer completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::EpochS::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::EpochS::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeVendorIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -107473,22 +108280,23 @@ + (void)readAttributeVendorIdWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRVendorIdAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::VendorId::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(VendorIdAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::VendorId::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeListNullablesAndOptionalsStructWithCompletion:(void (^)(NSArray * _Nullable value, @@ -107751,7 +108559,7 @@ + (void)readAttributeListNullablesAndOptionalsStructWithClusterStateCache: NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingListNullablesAndOptionalsStructListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingListNullablesAndOptionalsStructListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -107831,22 +108639,23 @@ + (void)readAttributeEnumAttrWithClusterStateCache:(MTRClusterStateCacheContaine completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingClusterSimpleEnumAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingClusterSimpleEnumAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::EnumAttr::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingClusterSimpleEnumAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::EnumAttr::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeStructAttrWithCompletion:(void (^)(MTRUnitTestingClusterSimpleStruct * _Nullable value, @@ -107922,22 +108731,23 @@ + (void)readAttributeStructAttrWithClusterStateCache:(MTRClusterStateCacheContai NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingStructAttrStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingStructAttrStructAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::StructAttr::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingStructAttrStructAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::StructAttr::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRangeRestrictedInt8uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108003,22 +108813,23 @@ + (void)readAttributeRangeRestrictedInt8uWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRangeRestrictedInt8sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108084,22 +108895,23 @@ + (void)readAttributeRangeRestrictedInt8sWithClusterStateCache:(MTRClusterStateC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt8s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRangeRestrictedInt16uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108165,22 +108977,23 @@ + (void)readAttributeRangeRestrictedInt16uWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeRangeRestrictedInt16sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108246,22 +109059,23 @@ + (void)readAttributeRangeRestrictedInt16sWithClusterStateCache:(MTRClusterState (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::RangeRestrictedInt16s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeListLongOctetStringWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -108348,7 +109162,7 @@ + (void)readAttributeListLongOctetStringWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingListLongOctetStringListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingListLongOctetStringListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -108507,7 +109321,7 @@ + (void)readAttributeListFabricScopedWithClusterStateCache:(MTRClusterStateCache (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingListFabricScopedListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingListFabricScopedListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -108588,22 +109402,23 @@ + (void)readAttributeTimedWriteBooleanWithClusterStateCache:(MTRClusterStateCach (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::TimedWriteBoolean::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::TimedWriteBoolean::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneralErrorBooleanWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108669,22 +109484,23 @@ + (void)readAttributeGeneralErrorBooleanWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::GeneralErrorBoolean::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::GeneralErrorBoolean::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterErrorBooleanWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108750,22 +109566,23 @@ + (void)readAttributeClusterErrorBooleanWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::ClusterErrorBoolean::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::ClusterErrorBoolean::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeUnsupportedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108829,22 +109646,23 @@ + (void)readAttributeUnsupportedWithClusterStateCache:(MTRClusterStateCacheConta completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::Unsupported::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::Unsupported::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBooleanWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108914,22 +109732,23 @@ + (void)readAttributeNullableBooleanWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableBooleanAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableBooleanAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableBoolean::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableBooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableBoolean::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap8WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -108999,22 +109818,23 @@ + (void)readAttributeNullableBitmap8WithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingNullableBitmap8AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingNullableBitmap8AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableBitmap8::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingNullableBitmap8AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableBitmap8::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap16WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109084,22 +109904,23 @@ + (void)readAttributeNullableBitmap16WithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingNullableBitmap16AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingNullableBitmap16AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableBitmap16::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingNullableBitmap16AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableBitmap16::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap32WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109169,22 +109990,23 @@ + (void)readAttributeNullableBitmap32WithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingNullableBitmap32AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingNullableBitmap32AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableBitmap32::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingNullableBitmap32AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableBitmap32::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap64WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109254,22 +110076,23 @@ + (void)readAttributeNullableBitmap64WithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingNullableBitmap64AttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingNullableBitmap64AttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableBitmap64::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingNullableBitmap64AttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableBitmap64::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt8uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109338,22 +110161,23 @@ + (void)readAttributeNullableInt8uWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt8u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt8u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt16uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109422,22 +110246,23 @@ + (void)readAttributeNullableInt16uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt16u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt16u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt24uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109506,22 +110331,23 @@ + (void)readAttributeNullableInt24uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt24u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt24u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt32uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109590,22 +110416,23 @@ + (void)readAttributeNullableInt32uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt32u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt32u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt40uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109674,22 +110501,23 @@ + (void)readAttributeNullableInt40uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt40u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt40u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt48uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109758,22 +110586,23 @@ + (void)readAttributeNullableInt48uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt48u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt48u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt56uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109842,22 +110671,23 @@ + (void)readAttributeNullableInt56uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt56u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt56u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt64uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -109926,22 +110756,23 @@ + (void)readAttributeNullableInt64uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt64u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt64u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt8sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110010,22 +110841,23 @@ + (void)readAttributeNullableInt8sWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt8s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt8s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt16sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110094,22 +110926,23 @@ + (void)readAttributeNullableInt16sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt16s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt16s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt24sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110178,22 +111011,23 @@ + (void)readAttributeNullableInt24sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt24s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt24s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt32sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110262,22 +111096,23 @@ + (void)readAttributeNullableInt32sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt32sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt32sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt32s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt32sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt32s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt40sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110346,22 +111181,23 @@ + (void)readAttributeNullableInt40sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt40s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt40s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt48sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110430,22 +111266,23 @@ + (void)readAttributeNullableInt48sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt48s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt48s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt56sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110514,22 +111351,23 @@ + (void)readAttributeNullableInt56sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt56s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt56s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt64sWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110598,22 +111436,23 @@ + (void)readAttributeNullableInt64sWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt64sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableInt64s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt64sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableInt64s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableEnum8WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110682,22 +111521,23 @@ + (void)readAttributeNullableEnum8WithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableEnum8::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableEnum8::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableEnum16WithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110766,22 +111606,23 @@ + (void)readAttributeNullableEnum16WithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableEnum16::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableEnum16::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableFloatSingleWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110852,22 +111693,23 @@ + (void)readAttributeNullableFloatSingleWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableFloatAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableFloatAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableFloatSingle::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableFloatAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableFloatSingle::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableFloatDoubleWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -110938,22 +111780,23 @@ + (void)readAttributeNullableFloatDoubleWithClusterStateCache:(MTRClusterStateCa (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableDoubleAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableDoubleAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableFloatDouble::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableDoubleAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableFloatDouble::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableOctetStringWithCompletion:(void (^)(NSData * _Nullable value, NSError * _Nullable error))completion @@ -111023,22 +111866,23 @@ + (void)readAttributeNullableOctetStringWithClusterStateCache:(MTRClusterStateCa (void (^)(NSData * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableOctetStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableOctetString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableOctetStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableOctetString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableCharStringWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion @@ -111109,22 +111953,23 @@ + (void)readAttributeNullableCharStringWithClusterStateCache:(MTRClusterStateCac (void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableCharStringAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableCharStringAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableCharString::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableCharStringAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableCharString::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableEnumAttrWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -111194,7 +112039,7 @@ + (void)readAttributeNullableEnumAttrWithClusterStateCache:(MTRClusterStateCache (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRNullableUnitTestingClusterSimpleEnumAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(NullableUnitTestingClusterSimpleEnumAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -111293,7 +112138,7 @@ + (void)readAttributeNullableStructWithClusterStateCache:(MTRClusterStateCacheCo NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingNullableStructStructAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingNullableStructStructAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -111382,22 +112227,23 @@ + (void)readAttributeNullableRangeRestrictedInt8uWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt8u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt8u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableRangeRestrictedInt8sWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -111470,22 +112316,23 @@ + (void)readAttributeNullableRangeRestrictedInt8sWithClusterStateCache:(MTRClust NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt8sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt8sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt8s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt8sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt8s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableRangeRestrictedInt16uWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -111558,22 +112405,23 @@ + (void)readAttributeNullableRangeRestrictedInt16uWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt16u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt16u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableRangeRestrictedInt16sWithCompletion:(void (^)(NSNumber * _Nullable value, @@ -111646,22 +112494,23 @@ + (void)readAttributeNullableRangeRestrictedInt16sWithClusterStateCache:(MTRClus NSError * _Nullable error))completion { auto * bridge = new MTRNullableInt16sAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt16s::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(NullableInt16sAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::NullableRangeRestrictedInt16s::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeWriteOnlyInt8uWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -111725,22 +112574,23 @@ + (void)readAttributeWriteOnlyInt8uWithClusterStateCache:(MTRClusterStateCacheCo completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::WriteOnlyInt8u::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::WriteOnlyInt8u::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion @@ -111769,7 +112619,7 @@ + (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateC (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -111814,7 +112664,7 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(UnitTestingAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; @@ -111857,22 +112707,23 @@ + (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheCon completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRUnitTestingAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(UnitTestingAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(UnitTestingAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -111899,22 +112750,23 @@ + (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContai completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion @@ -111942,22 +112794,23 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = UnitTesting::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = UnitTesting::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); } @end From 144ec9460dd9d51e073953f7904a6a1e9aaa7c10 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 16:26:26 -0500 Subject: [PATCH 11/30] Switch to having just one typedef for MTRCertificateDERBytes. (#23855) Having two typedefs leads to some compilers complaining if they see both, even though they are identical. --- src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h index dfafee444916aa..8ff5775ed71279 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.h @@ -16,7 +16,7 @@ #import -typedef NSData * MTRCertificateDERBytes; +#import NS_ASSUME_NONNULL_BEGIN From 324135b284507c6e7a69ef912c373726f37e95e5 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 1 Dec 2022 16:32:20 -0500 Subject: [PATCH 12/30] Add a `--skip-build` option to docker image builds (#23836) * add a skip-build argument to build.sh, to allow pushing without building, assuming an image is already built * Restyle * Fix conditional --- integrations/docker/build.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/integrations/docker/build.sh b/integrations/docker/build.sh index cb063a2600b1da..8336b2689caf95 100755 --- a/integrations/docker/build.sh +++ b/integrations/docker/build.sh @@ -46,11 +46,12 @@ fi Build and (optionally tag as latest, push) a docker image from Dockerfile in CWD Options: - --no-cache passed as a docker build argument - --latest update latest to the current built version (\"$VERSION\") - --push push image(s) to docker.io (requires docker login for \"$ORG\") - --help get this message - --squash squash docker layers before push them to docker.io (requires docker-squash python module) + --no-cache passed as a docker build argument + --latest update latest to the current built version (\"$VERSION\") + --push push image(s) to docker.io (requires docker login for \"$ORG\") + --skip-build skip the build/prune step + --help get this message + --squash squash docker layers before push them to docker.io (requires docker-squash python module) " exit 0 @@ -80,8 +81,10 @@ if [[ ${*/--no-cache//} != "${*}" ]]; then BUILD_ARGS+=(--no-cache) fi -docker build "${BUILD_ARGS[@]}" --build-arg VERSION="$VERSION" -t "$ORG/$IMAGE:$VERSION" . -docker image prune --force +[[ ${*/--skip-build//} != "${*}" ]] || { + docker build "${BUILD_ARGS[@]}" --build-arg VERSION="$VERSION" -t "$ORG/$IMAGE:$VERSION" . + docker image prune --force +} [[ ${*/--latest//} != "${*}" ]] && { docker tag "$ORG"/"$IMAGE":"$VERSION" "$ORG"/"$IMAGE":latest From 20f55ecb51f036dec04f6a464cff030ee32a2292 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 17:09:26 -0500 Subject: [PATCH 13/30] Remove write-only variables. (#23860) This is triggering errors due to -Werror on some compilers. --- src/app/MessageDef/AttributeStatusIBs.cpp | 5 +---- src/app/MessageDef/EventPathIBs.cpp | 3 --- src/app/clusters/groups-server/groups-server.cpp | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/app/MessageDef/AttributeStatusIBs.cpp b/src/app/MessageDef/AttributeStatusIBs.cpp index 795c2805027a4c..88484fd28eb02f 100644 --- a/src/app/MessageDef/AttributeStatusIBs.cpp +++ b/src/app/MessageDef/AttributeStatusIBs.cpp @@ -47,8 +47,7 @@ AttributeStatusIBs::Builder & AttributeStatusIBs::Builder::EndOfAttributeStatuse #if CHIP_CONFIG_IM_PRETTY_PRINT CHIP_ERROR AttributeStatusIBs::Parser::PrettyPrint() const { - CHIP_ERROR err = CHIP_NO_ERROR; - size_t NumAttributeStatus = 0; + CHIP_ERROR err = CHIP_NO_ERROR; TLV::TLVReader reader; PRETTY_PRINT("AttributeStatusIBs ="); @@ -68,8 +67,6 @@ CHIP_ERROR AttributeStatusIBs::Parser::PrettyPrint() const ReturnErrorOnFailure(status.PrettyPrint()); PRETTY_PRINT_DECDEPTH(); } - - ++NumAttributeStatus; } PRETTY_PRINT("],"); diff --git a/src/app/MessageDef/EventPathIBs.cpp b/src/app/MessageDef/EventPathIBs.cpp index 40736baf97988b..0a6277e2e22ae3 100644 --- a/src/app/MessageDef/EventPathIBs.cpp +++ b/src/app/MessageDef/EventPathIBs.cpp @@ -32,7 +32,6 @@ namespace app { CHIP_ERROR EventPathIBs::Parser::PrettyPrint() const { CHIP_ERROR err = CHIP_NO_ERROR; - size_t NumPath = 0; TLV::TLVReader reader; PRETTY_PRINT("EventPathIBs ="); @@ -54,8 +53,6 @@ CHIP_ERROR EventPathIBs::Parser::PrettyPrint() const ReturnErrorOnFailure(path.PrettyPrint()); PRETTY_PRINT_DECDEPTH(); } - - ++NumPath; } PRETTY_PRINT("],"); diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp index 0ccf5c4c34eeb5..523fea8a76d4d5 100644 --- a/src/app/clusters/groups-server/groups-server.cpp +++ b/src/app/clusters/groups-server/groups-server.cpp @@ -211,7 +211,6 @@ struct GroupMembershipResponse { GroupDataProvider::GroupEndpoint mapping; size_t requestedCount = 0; - size_t matchCount = 0; ReturnErrorOnFailure(mCommandData.groupList.ComputeSize(&requestedCount)); if (0 == requestedCount) @@ -223,7 +222,6 @@ struct GroupMembershipResponse if (mapping.endpoint_id == mEndpoint) { ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag(), mapping.group_id)); - matchCount++; ChipLogDetail(Zcl, " 0x%02x", mapping.group_id); } } @@ -238,7 +236,6 @@ struct GroupMembershipResponse if (mapping.endpoint_id == mEndpoint && mapping.group_id == iter.GetValue()) { ReturnErrorOnFailure(app::DataModel::Encode(writer, TLV::AnonymousTag(), mapping.group_id)); - matchCount++; ChipLogDetail(Zcl, " 0x%02x", mapping.group_id); break; } From bcb8c97445f9ba8d1669330eabc86c869f874bd2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 1 Dec 2022 17:31:07 -0500 Subject: [PATCH 14/30] Avoid usage of a separate build environment for compile time codegen (#23861) * Try to disable virtual env usage for codegen * Fix IDL paths. also add missing callbackstubsource.jinja from the list for change detection * Restyle * Update chip script: need to ensure build environment is set up * Restyle * Fix typo * Fix cirque typo * Switch bootstrap with activate --- build/chip/chip_codegen.gni | 10 +++++++-- scripts/build/gn_gen_cirque.sh | 14 +++++++++---- scripts/idl/BUILD.gn | 33 +++++------------------------- scripts/idl/files.gni | 37 ++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 34 deletions(-) create mode 100644 scripts/idl/files.gni diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index fd5d69c40c513f..533cd02b27ea76 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -17,6 +17,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") +import("${chip_root}/scripts/idl/files.gni") declare_args() { # Location where code has been pre-generated @@ -37,6 +38,9 @@ template("_chip_build_time_codegen") { pw_python_action("${_name}_codegen") { script = "${chip_root}/scripts/codegen.py" + # TODO: this seems to touch internals. Is this ok? speeds up builds! + _pw_internal_run_in_venv = false + _idl_file = invoker.input _expected_outputs = "${target_gen_dir}/${_name}.expected.outputs" @@ -52,12 +56,14 @@ template("_chip_build_time_codegen") { rebase_path(_idl_file, root_build_dir), ] - deps = [ "${chip_root}/scripts/idl" ] - inputs = [ _idl_file, _expected_outputs, ] + + # ensure any change in codegen files will result in a rebuild + inputs += matter_idl_generator_files + sources = [ _idl_file ] outputs = [] diff --git a/scripts/build/gn_gen_cirque.sh b/scripts/build/gn_gen_cirque.sh index f65525bd6dfb7b..85da0c232745c5 100755 --- a/scripts/build/gn_gen_cirque.sh +++ b/scripts/build/gn_gen_cirque.sh @@ -27,10 +27,16 @@ set -x env -echo "Build: GN configure" +cd "$ROOT_PATH" -gn --root="$CHIP_ROOT" gen --check --fail-on-unused-args "$CHIP_ROOT/out/debug" --args='target_os="all"'"chip_build_tests=false chip_enable_wifi=false chip_im_force_fabric_quota_check=true enable_default_builds=false enable_host_gcc_build=true enable_standalone_chip_tool_build=true enable_linux_all_clusters_app_build=true enable_linux_lighting_app_build=true" +echo "Ensure submodules for Linux builds are checked out" +./scripts/checkout_submodules.py --shallow --platform linux -echo "Build: Ninja build" +echo "Setup build environment" +source "./scripts/activate.sh" -time ninja -C "$CHIP_ROOT/out/debug" all check +echo "Build: GN configure" +gn --root="$CHIP_ROOT" gen --check --fail-on-unused-args out/debug --args='target_os="all"'"chip_build_tests=false chip_enable_wifi=false chip_im_force_fabric_quota_check=true enable_default_builds=false enable_host_gcc_build=true enable_standalone_chip_tool_build=true enable_linux_all_clusters_app_build=true enable_linux_lighting_app_build=true" + +echo "Build: Ninja build" +time ninja -C out/debug all check diff --git a/scripts/idl/BUILD.gn b/scripts/idl/BUILD.gn index 359f50e89d4159..324ed3a737bbf0 100644 --- a/scripts/idl/BUILD.gn +++ b/scripts/idl/BUILD.gn @@ -18,20 +18,15 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") +import("${chip_root}/scripts/idl/files.gni") + pw_python_package("idl") { setup = [ "setup.py" ] - inputs = [ + inputs = matter_idl_generator_templates + inputs += [ # Dependency grammar "matter_grammar.lark", - # Templates used for generation - "generators/bridge/BridgeClustersCpp.jinja", - "generators/bridge/BridgeClustersCommon.jinja", - "generators/bridge/BridgeClustersGlobalStructs.jinja", - "generators/java/ChipClustersCpp.jinja", - "generators/java/ChipClustersRead.jinja", - "generators/cpp/application/PluginApplicationCallbacksHeader.jinja", - # Unit test data "tests/available_tests.yaml", "tests/inputs/cluster_struct_attribute.matter", @@ -70,25 +65,7 @@ pw_python_package("idl") { "tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp", ] - sources = [ - "__init__.py", - "generators/__init__.py", - "generators/bridge/__init__.py", - "generators/cpp/__init__.py", - "generators/cpp/application/__init__.py", - "generators/filters.py", - "generators/java/__init__.py", - "generators/types.py", - "matter_idl_parser.py", - "matter_idl_types.py", - "xml_parser.py", - "zapxml/__init__.py", - "zapxml/handlers/__init__.py", - "zapxml/handlers/base.py", - "zapxml/handlers/context.py", - "zapxml/handlers/handlers.py", - "zapxml/handlers/parsing.py", - ] + sources = matter_idl_generator_sources tests = [ "test_matter_idl_parser.py", diff --git a/scripts/idl/files.gni b/scripts/idl/files.gni new file mode 100644 index 00000000000000..997f1eab8b06c5 --- /dev/null +++ b/scripts/idl/files.gni @@ -0,0 +1,37 @@ +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +# Templates used for generation +matter_idl_generator_templates = [ + "${chip_root}/scripts/idl/generators/bridge/BridgeClustersCpp.jinja", + "${chip_root}/scripts/idl/generators/bridge/BridgeClustersCommon.jinja", + "${chip_root}/scripts/idl/generators/bridge/BridgeClustersGlobalStructs.jinja", + "${chip_root}/scripts/idl/generators/java/ChipClustersCpp.jinja", + "${chip_root}/scripts/idl/generators/java/ChipClustersRead.jinja", + "${chip_root}/scripts/idl/generators/cpp/application/CallbackStubSource.jinja", + "${chip_root}/scripts/idl/generators/cpp/application/PluginApplicationCallbacksHeader.jinja", +] + +matter_idl_generator_sources = [ + "${chip_root}/scripts/idl/__init__.py", + "${chip_root}/scripts/idl/generators/__init__.py", + "${chip_root}/scripts/idl/generators/bridge/__init__.py", + "${chip_root}/scripts/idl/generators/cpp/__init__.py", + "${chip_root}/scripts/idl/generators/cpp/application/__init__.py", + "${chip_root}/scripts/idl/generators/filters.py", + "${chip_root}/scripts/idl/generators/java/__init__.py", + "${chip_root}/scripts/idl/generators/types.py", + "${chip_root}/scripts/idl/matter_idl_parser.py", + "${chip_root}/scripts/idl/matter_idl_types.py", + "${chip_root}/scripts/idl/xml_parser.py", + "${chip_root}/scripts/idl/zapxml/__init__.py", + "${chip_root}/scripts/idl/zapxml/handlers/__init__.py", + "${chip_root}/scripts/idl/zapxml/handlers/base.py", + "${chip_root}/scripts/idl/zapxml/handlers/context.py", + "${chip_root}/scripts/idl/zapxml/handlers/handlers.py", + "${chip_root}/scripts/idl/zapxml/handlers/parsing.py", +] + +# All the files that the matter idl infrastructure will use +matter_idl_generator_files = + matter_idl_generator_templates + matter_idl_generator_sources From 02a25fac46cdfb32687087af7f8c314ebc30fac3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2022 17:31:24 -0500 Subject: [PATCH 15/30] Fix status report message when destination id is unknown. (#23858) * Fix status report message when destination id is unknown. We were ignoring the fact that we failed to match the destination id, pressing on to SendSigma2, and failing out, but that clobbered the "err" variable with a diferent error, so we ended up sending an error status report with the wrong protocol code. * Address review comments --- src/protocols/secure_channel/CASESession.cpp | 1 + .../secure_channel/tests/TestCASESession.cpp | 84 +++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 3c4d2572fb926b..9dfca878346929 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -628,6 +628,7 @@ CHIP_ERROR CASESession::HandleSigma1(System::PacketBufferHandle && msg) ChipLogError(SecureChannel, "CASE failed to match destination ID with local fabrics"); ChipLogByteSpan(SecureChannel, destinationIdentifier); } + SuccessOrExit(err); // ParseSigma1 ensures that: // mRemotePubKey.Length() == initiatorPubKey.size() == kP256_PublicKey_Length. diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index 9c62a48e046908..8af555796e5bec 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -310,6 +310,7 @@ class TestCASESession #if CONFIG_BUILD_FOR_HOST_UNIT_TEST static void SimulateUpdateNOCInvalidatePendingEstablishment(nlTestSuite * inSuite, void * inContext); #endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST + static void Sigma1BadDestinationIdTest(nlTestSuite * inSuite, void * inContext); }; void TestCASESession::SecurePairingWaitTest(nlTestSuite * inSuite, void * inContext) @@ -1005,6 +1006,88 @@ void TestCASESession::SimulateUpdateNOCInvalidatePendingEstablishment(nlTestSuit } #endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST +namespace { +class ExpectErrorExchangeDelegate : public ExchangeDelegate +{ +public: + ExpectErrorExchangeDelegate(nlTestSuite * suite, uint16_t expectedProtocolCode) : + mSuite(suite), mExpectedProtocolCode(expectedProtocolCode) + {} + +private: + CHIP_ERROR OnMessageReceived(ExchangeContext * ec, const PayloadHeader & payloadHeader, + System::PacketBufferHandle && buf) override + { + using namespace SecureChannel; + + NL_TEST_ASSERT(mSuite, payloadHeader.HasMessageType(MsgType::StatusReport)); + + SecureChannel::StatusReport statusReport; + CHIP_ERROR err = statusReport.Parse(std::move(buf)); + NL_TEST_ASSERT(mSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(mSuite, statusReport.GetProtocolId() == SecureChannel::Id); + NL_TEST_ASSERT(mSuite, statusReport.GetGeneralCode() == GeneralStatusCode::kFailure); + NL_TEST_ASSERT(mSuite, statusReport.GetProtocolCode() == mExpectedProtocolCode); + return CHIP_NO_ERROR; + } + + void OnResponseTimeout(ExchangeContext * ec) override {} + + Messaging::ExchangeMessageDispatch & GetMessageDispatch() override { return SessionEstablishmentExchangeDispatch::Instance(); } + + nlTestSuite * mSuite; + uint16_t mExpectedProtocolCode; +}; +} // anonymous namespace + +void TestCASESession::Sigma1BadDestinationIdTest(nlTestSuite * inSuite, void * inContext) +{ + using SecureChannel::MsgType; + + TestContext & ctx = *reinterpret_cast(inContext); + + SessionManager & sessionManager = ctx.GetSecureSessionManager(); + + constexpr size_t bufferSize = 600; + System::PacketBufferHandle data = chip::System::PacketBufferHandle::New(bufferSize); + NL_TEST_ASSERT(inSuite, !data.IsNull()); + + MutableByteSpan buf(data->Start(), data->AvailableDataLength()); + // This uses a bogus destination id that is not going to match anything in practice. + CHIP_ERROR err = EncodeSigma1(buf); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + data->SetDataLength(static_cast(buf.size())); + + Optional session = sessionManager.CreateUnauthenticatedSession(ctx.GetAliceAddress(), GetDefaultMRPConfig()); + NL_TEST_ASSERT(inSuite, session.HasValue()); + + TestCASESecurePairingDelegate caseDelegate; + CASESession caseSession; + caseSession.SetGroupDataProvider(&gDeviceGroupDataProvider); + err = caseSession.PrepareForSessionEstablishment(sessionManager, &gDeviceFabrics, nullptr, nullptr, &caseDelegate, + ScopedNodeId(), NullOptional); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = ctx.GetExchangeManager().RegisterUnsolicitedMessageHandlerForType(MsgType::CASE_Sigma1, &caseSession); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + ExpectErrorExchangeDelegate delegate(inSuite, SecureChannel::kProtocolCodeNoSharedRoot); + ExchangeContext * exchange = ctx.GetExchangeManager().NewContext(session.Value(), &delegate); + NL_TEST_ASSERT(inSuite, exchange != nullptr); + + err = exchange->SendMessage(MsgType::CASE_Sigma1, std::move(data), SendMessageFlags::kExpectResponse); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + ctx.DrainAndServiceIO(); + + NL_TEST_ASSERT(inSuite, caseDelegate.mNumPairingErrors == 1); + NL_TEST_ASSERT(inSuite, caseDelegate.mNumPairingComplete == 0); + + ctx.GetExchangeManager().UnregisterUnsolicitedMessageHandlerForType(MsgType::CASE_Sigma1); + caseSession.Clear(); +} + } // namespace chip // Test Suite @@ -1027,6 +1110,7 @@ static const nlTest sTests[] = // CASESession that are in the process of establishing. NL_TEST_DEF("InvalidatePendingSessionEstablishment", chip::TestCASESession::SimulateUpdateNOCInvalidatePendingEstablishment), #endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST + NL_TEST_DEF("Sigma1BadDestinationId", chip::TestCASESession::Sigma1BadDestinationIdTest), NL_TEST_SENTINEL() }; From 21245f42393e63dbb16fb4d99d8bf96aef7ae0fc Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Fri, 2 Dec 2022 04:22:14 +0530 Subject: [PATCH 16/30] Test Added Nov 30 (#23831) * Added test TC-ACL-2.3 TC-ALOGIN-12.1 TC-BRBINFO-1.1 TC-BRBINFO-2.1 TC-CNET-1.3 TC-DRLK-2.6 TC-WAKEONLAN-4.1 * Auto generated files * Restyled by whitespace * Restyled by prettier-yaml * Modified DGTHREAD PICS * Auto generated files * Modifed WakeOnLan script * Auto generated files * Removed BRBINFO -2.1 test from Darwin Json file * Auto generated files Co-authored-by: Restyled.io --- .../templates/tests/ciTests.json | 1 + src/app/tests/suites/certification/PICS.yaml | 14 +- .../suites/certification/Test_TC_ACL_2_3.yaml | 741 +-- .../certification/Test_TC_ALOGIN_12_1.yaml | 109 +- .../certification/Test_TC_BRBINFO_1_1.yaml | 268 +- .../certification/Test_TC_BRBINFO_2_1.yaml | 786 ++- .../certification/Test_TC_CNET_1_3.yaml | 363 +- .../certification/Test_TC_DGTHREAD_1_1.yaml | 6 +- .../certification/Test_TC_DGTHREAD_2_1.yaml | 4 +- .../certification/Test_TC_DRLK_2_6.yaml | 292 +- .../certification/Test_TC_WAKEONLAN_4_1.yaml | 78 +- .../tests/suites/certification/ci-pics-values | 45 +- src/app/tests/suites/ciTests.json | 11 +- src/app/tests/suites/manualTests.json | 6 - .../chip-tool/zap-generated/test/Commands.h | 3536 +++++++++++--- .../zap-generated/test/Commands.h | 4270 +++++++++++++++-- 16 files changed, 7814 insertions(+), 2716 deletions(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index 50f8ce2e3add50..fa2baf9081e469 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -6,6 +6,7 @@ "TestEvents", "TestDiscovery", "TestGroupMessaging", + "Test_TC_BRBINFO_2_1", "Test_TC_DGTHREAD_2_1", "Test_TC_DGTHREAD_2_2", "Test_TC_DGTHREAD_2_3", diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index ddcda6eb8271ed..cffcba6784369e 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3714,10 +3714,10 @@ PICS: id: DGTHREAD.S.A0039 - label: "Does the DUT-server support the Delay attribute?" - id: DGTHREAD.S.A003A + id: DGTHREAD.S.A003a - label: "Does the DUT-server support the SecurityPolicy attribute?" - id: DGTHREAD.S.A003B + id: DGTHREAD.S.A003b - label: "Does the DUT-server support the ChannelPage0Mask attribute?" id: DGTHREAD.S.A003c @@ -4589,6 +4589,16 @@ PICS: - label: "Does the DUT(server) support the ReachableChanged event?" id: BINFO.S.E03 + #Features + - label: "Does the device implement the Wi-Fi related features ?" + id: CNET.S.F00 + + - label: "Does the device implement the Thread related features" + id: CNET.S.F01 + + - label: "Does the device implement the Ethernet related features ?" + id: CNET.S.F02 + #Client Attributes - label: "Does the DUT(Client) support the DataModelRevision attribute?" id: BINFO.C.A0000 diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml index ee68e0c2b5de21..7ef1ba418e17c4 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml @@ -20,158 +20,82 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Access Control" endpoint: 0 + D_OK_EMPTY: + type: octet_string + defaultValue: "hex:1718" + D_OK_SINGLE: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" + D_OK_FULL: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" + D_BAD_LENGTH: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" + D_BAD_STRUCT: + type: octet_string + defaultValue: "hex:1518" + D_BAD_LIST: + type: octet_string + defaultValue: "hex:3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" + D_BAD_ELEM: + type: octet_string + defaultValue: "hex:17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" + D_BAD_OVERFLOW: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF" + D_BAD_UNDERFLOW: + type: octet_string + defaultValue: "hex:17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700" + D_BAD_NONE: + type: octet_string + defaultValue: "" tests: - - label: "Pre-Conditions" - verification: | - Notes - - 1.N1 is the node ID of TH1 - - 2.D_OK_EMPTY:"1718" which is an octstr of length 2 containing valid TLV: - - - top-level anonymous list (empty) - - 3.D_OK_SINGLE:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" which is an octstr of length 50-100 containing valid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - - 4.D_OK_FULL:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" which is an octstr of length 128 containing valid TLV: - - - top-level anonymous list, containing - two elements with profile-specific tag in fully-qualified form - - 5.D_BAD_LENGTH:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" which is an octstr of length 129 containing valid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - - 6 .D_BAD_STRUCT: "1518" which is an octstr of length 2 containing valid TLV: - - - top-level anonymous struct, empty - - 7.D_BAD_LIST:"3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" which is an octstr of length 50-100 containing valid TLV: - - - top-level list with context-specific tag, containing - one element with profile-specific tag in fully-qualified form - - 8.D_BAD_ELEM:"17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" which is an octstr of length 50-100 containing valid TLV: - - - top-level anonymous list, containing - one element with anonymous tag - - 9 .D_BAD_OVERFLOW: "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF" which is an octstr of length 50-100 containing valid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - but having extra bytes after the top level list end-of-container - - 10.D_BAD_UNDERFLOW:"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700" which is an octstr of length 50-100 containing invalid TLV: - - - top-level anonymous list, containing - one element with profile-specific tag in fully-qualified form - but lacking the top-level list end-of-container - - 11.D_BAD_NONE: "" which is an octstr of length 0 - disabled: true - - - label: "TH1 commissions DUT using admin node ID N1" - verification: | - DUT - sudo ./chip-all-clusters-app --wifi - - TH1 - ./chip-tool pairing ble-wifi 1 zigbee-thread matter123 20202021 3841 - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute" - verification: | - ./chip-tool operationalcredentials read current-fabric-index 1 0 - - On TH1(Chiptool), verify the CurrentFabricIndex attribute of operationalCredential cluster as 1 - - [1658323393.451141][2316:2321] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0005 DataVersion: 3882577299 - [1658323393.465921][2316:2321] CHIP:TOO: CurrentFabricIndex: 1 - disabled: true + cluster: "Operational Credentials" + command: "readAttribute" + attribute: "CurrentFabricIndex" + response: + saveAs: CurrentFabricIndex - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify the extension attribute contains an empty list - - [1657116435.352869][2667:2672] CHIP:DMG: SuppressResponse = true, - [1657116435.352904][2667:2672] CHIP:DMG: InteractionModelRevision = 1 - [1657116435.352935][2667:2672] CHIP:DMG: } - [1657116435.353245][2667:2672] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 368386360 - [1657116435.353328][2667:2672] CHIP:TOO: Extension: 0 entries - [1657116435.353439][2667:2672] CHIP:EM: Sending Standalone Ack for MessageCounter:265691167 on exchange 19854i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"1718"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is Success when writing the AccessControl cluster Extension attribute - - [1656416335.284463][3747:3752] CHIP:DMG: WriteResponseMessage = - [1656416335.284498][3747:3752] CHIP:DMG: { - [1656416335.284539][3747:3752] CHIP:DMG: AttributeStatusIBs = - [1656416335.284581][3747:3752] CHIP:DMG: [ - [1656416335.284626][3747:3752] CHIP:DMG: AttributeStatusIB = - [1656416335.284663][3747:3752] CHIP:DMG: { - [1656416335.284709][3747:3752] CHIP:DMG: AttributePathIB = - [1656416335.284763][3747:3752] CHIP:DMG: { - [1656416335.284807][3747:3752] CHIP:DMG: Endpoint = 0x0, - [1656416335.284861][3747:3752] CHIP:DMG: Cluster = 0x1f, - [1656416335.284907][3747:3752] CHIP:DMG: Attribute = 0x0000_0001, - [1656416335.284961][3747:3752] CHIP:DMG: } - [1656416335.285018][3747:3752] CHIP:DMG: - [1656416335.285058][3747:3752] CHIP:DMG: StatusIB = - [1656416335.285109][3747:3752] CHIP:DMG: { - [1656416335.285150][3747:3752] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416335.285203][3747:3752] CHIP:DMG: }, - [1656416335.285255][3747:3752] CHIP:DMG: - [1656416335.285290][3747:3752] CHIP:DMG: }, - [1656416335.285349][3747:3752] CHIP:DMG: - [1656416335.285382][3747:3752] CHIP:DMG: AttributeStatusIB = - [1656416335.285432][3747:3752] CHIP:DMG: { - [1656416335.285466][3747:3752] CHIP:DMG: AttributePathIB = - [1656416335.285516][3747:3752] CHIP:DMG: { - [1656416335.285557][3747:3752] CHIP:DMG: Endpoint = 0x0, - [1656416335.285617][3747:3752] CHIP:DMG: Cluster = 0x1f, - [1656416335.285662][3747:3752] CHIP:DMG: Attribute = 0x0000_0001, - [1656416335.285705][3747:3752] CHIP:DMG: ListIndex = Null, - [1656416335.285746][3747:3752] CHIP:DMG: } - [1656416335.285790][3747:3752] CHIP:DMG: - [1656416335.285829][3747:3752] CHIP:DMG: StatusIB = - [1656416335.285867][3747:3752] CHIP:DMG: { - [1656416335.285907][3747:3752] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416335.285948][3747:3752] CHIP:DMG: }, - [1656416335.285988][3747:3752] CHIP:DMG: - [1656416335.286021][3747:3752] CHIP:DMG: }, - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify value is list of AccessControlExtensionStruct containing 1 element . Data field: D_OK_EMPTY : "1718" and - FabricIndex field: F1 - - - [1657278638.723927][9030:9035] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362695 - [1657278638.724004][9030:9035] CHIP:TOO: Extension: 1 entries - [1657278638.724072][9030:9035] CHIP:TOO: [1]: { - [1657278638.724106][9030:9035] CHIP:TOO: Data: 1718 - [1657278638.724151][9030:9035] CHIP:TOO: FabricIndex: 1 - [1657278638.724180][9030:9035] CHIP:TOO: } - [1657278638.724307][9030:9035] CHIP:EM: Sending Standalone Ack for MessageCounter:131793781 on exchange 9203i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -179,246 +103,37 @@ tests: 1.struct Data field: D_OK_SINGLE :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is success when writing the AccessControl cluster Extension attribute. - - - [1656416899.781899][3814:3819] CHIP:DMG: WriteResponseMessage = - - [1656416899.781952][3814:3819] CHIP:DMG: { - [1656416899.781998][3814:3819] CHIP:DMG: AttributeStatusIBs = - [1656416899.782062][3814:3819] CHIP:DMG: [ - [1656416899.782114][3814:3819] CHIP:DMG: AttributeStatusIB = - [1656416899.782181][3814:3819] CHIP:DMG: { - [1656416899.782236][3814:3819] CHIP:DMG: AttributePathIB = - [1656416899.782301][3814:3819] CHIP:DMG: { - [1656416899.782369][3814:3819] CHIP:DMG: Endpoint = 0x0, - [1656416899.782442][3814:3819] CHIP:DMG: Cluster = 0x1f, - [1656416899.782512][3814:3819] CHIP:DMG: Attribute = 0x0000_0001, - [1656416899.782583][3814:3819] CHIP:DMG: } - [1656416899.782656][3814:3819] CHIP:DMG: - [1656416899.782718][3814:3819] CHIP:DMG: StatusIB = - [1656416899.782782][3814:3819] CHIP:DMG: { - [1656416899.782850][3814:3819] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416899.782916][3814:3819] CHIP:DMG: }, - [1656416899.782981][3814:3819] CHIP:DMG: - [1656416899.783035][3814:3819] CHIP:DMG: }, - [1656416899.783107][3814:3819] CHIP:DMG: - [1656416899.783159][3814:3819] CHIP:DMG: AttributeStatusIB = - [1656416899.783215][3814:3819] CHIP:DMG: { - [1656416899.783269][3814:3819] CHIP:DMG: AttributePathIB = - [1656416899.783331][3814:3819] CHIP:DMG: { - [1656416899.783396][3814:3819] CHIP:DMG: Endpoint = 0x0, - [1656416899.783466][3814:3819] CHIP:DMG: Cluster = 0x1f, - [1656416899.783536][3814:3819] CHIP:DMG: Attribute = 0x0000_0001, - [1656416899.783603][3814:3819] CHIP:DMG: ListIndex = Null, - [1656416899.783669][3814:3819] CHIP:DMG: } - [1656416899.783740][3814:3819] CHIP:DMG: - [1656416899.783802][3814:3819] CHIP:DMG: StatusIB = - [1656416899.783864][3814:3819] CHIP:DMG: { - [1656416899.783928][3814:3819] CHIP:DMG: status = 0x00 (SUCCESS), - [1656416899.784031][3814:3819] CHIP:DMG: }, - [1656416899.784099][3814:3819] CHIP:DMG: - [1656416899.784152][3814:3819] CHIP:DMG: }, - [1656416899.784215][3814:3819] CHIP:DMG: - [1656416899.784265][3814:3819] CHIP:DMG: ], - [1656416899.784333][3814:3819] CHIP:DMG: - [1656416899.784384][3814:3819] CHIP:DMG: InteractionModelRevision = 1 - [1656416899.784434][3814:3819] CHIP:DMG: } - [1656416899.784620][3814:3819] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1656416899.784719][3814:3819] CHIP:EM: Sending Standalone Ack for MessageCounter:116771897 on exchange 19604i - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify the AccessControlExtensionStruct containing 1 element - Data field: D_OK_SINGLE :"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" and FabricIndex field : F1 - - [1657278788.400832][9048:9053] CHIP:DMG: ReportDataMessage = - [1657278788.400863][9048:9053] CHIP:DMG: { - [1657278788.400887][9048:9053] CHIP:DMG: AttributeReportIBs = - [1657278788.400920][9048:9053] CHIP:DMG: [ - [1657278788.400947][9048:9053] CHIP:DMG: AttributeReportIB = - [1657278788.400985][9048:9053] CHIP:DMG: { - [1657278788.401039][9048:9053] CHIP:DMG: AttributeDataIB = - [1657278788.401090][9048:9053] CHIP:DMG: { - [1657278788.401136][9048:9053] CHIP:DMG: DataVersion = 0x1f506609, - [1657278788.401181][9048:9053] CHIP:DMG: AttributePathIB = - [1657278788.401242][9048:9053] CHIP:DMG: { - [1657278788.401299][9048:9053] CHIP:DMG: Endpoint = 0x0, - [1657278788.401348][9048:9053] CHIP:DMG: Cluster = 0x1f, - [1657278788.401406][9048:9053] CHIP:DMG: Attribute = 0x0000_0001, - [1657278788.401462][9048:9053] CHIP:DMG: } - [1657278788.401527][9048:9053] CHIP:DMG: - [1657278788.401587][9048:9053] CHIP:DMG: Data = [ - [1657278788.401646][9048:9053] CHIP:DMG: - [1657278788.401707][9048:9053] CHIP:DMG: ], - [1657278788.401765][9048:9053] CHIP:DMG: }, - [1657278788.401821][9048:9053] CHIP:DMG: - [1657278788.401867][9048:9053] CHIP:DMG: }, - [1657278788.401911][9048:9053] CHIP:DMG: - [1657278788.401945][9048:9053] CHIP:DMG: AttributeReportIB = - [1657278788.402001][9048:9053] CHIP:DMG: { - [1657278788.402031][9048:9053] CHIP:DMG: AttributeDataIB = - [1657278788.402082][9048:9053] CHIP:DMG: { - [1657278788.402119][9048:9053] CHIP:DMG: DataVersion = 0x1f506609, - [1657278788.402163][9048:9053] CHIP:DMG: AttributePathIB = - [1657278788.402200][9048:9053] CHIP:DMG: { - [1657278788.402247][9048:9053] CHIP:DMG: Endpoint = 0x0, - [1657278788.402295][9048:9053] CHIP:DMG: Cluster = 0x1f, - [1657278788.402334][9048:9053] CHIP:DMG: Attribute = 0x0000_0001, - [1657278788.402371][9048:9053] CHIP:DMG: ListIndex = Null, - [1657278788.402407][9048:9053] CHIP:DMG: } - [1657278788.402446][9048:9053] CHIP:DMG: - [1657278788.402481][9048:9053] CHIP:DMG: Data = - [1657278788.402514][9048:9053] CHIP:DMG: { - [1657278788.402574][9048:9053] CHIP:DMG: 0x1 = [ - [1657278788.402634][9048:9053] CHIP:DMG: 0x17, 0xd0, 0x0, 0x0, 0xf1, 0xff, 0x1, 0x0, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x72, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0, 0x18, - [1657278788.402678][9048:9053] CHIP:DMG: ] - [1657278788.402716][9048:9053] CHIP:DMG: 0xfe = 1, - [1657278788.402755][9048:9053] CHIP:DMG: }, - [1657278788.402785][9048:9053] CHIP:DMG: }, - [1657278788.402824][9048:9053] CHIP:DMG: - [1657278788.402851][9048:9053] CHIP:DMG: }, - [1657278788.402886][9048:9053] CHIP:DMG: - [1657278788.402910][9048:9053] CHIP:DMG: ], - [1657278788.402946][9048:9053] CHIP:DMG: - [1657278788.402972][9048:9053] CHIP:DMG: SuppressResponse = true, - [1657278788.402996][9048:9053] CHIP:DMG: InteractionModelRevision = 1 - [1657278788.403019][9048:9053] CHIP:DMG: } - [1657278788.403304][9048:9053] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362697 - [1657278788.403374][9048:9053] CHIP:TOO: Extension: 1 entries - [1657278788.403426][9048:9053] CHIP:TOO: [1]: { - [1657278788.403457][9048:9053] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018 - [1657278788.403509][9048:9053] CHIP:TOO: FabricIndex: 1 - [1657278788.403543][9048:9053] CHIP:TOO: } - [1657278788.403642][9048:9053] CHIP:EM: Sending Standalone Ack for MessageCounter:90870339 on exchange 24533i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL - :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018 - which is an octstr of length 128 containing valid TLV:" + :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is success when writing the AccessControl cluster Extension attribute - [1656417544.279572][3888:3893] CHIP:DMG: WriteResponseMessage = - [1656417544.279598][3888:3893] CHIP:DMG: { - [1656417544.279620][3888:3893] CHIP:DMG: AttributeStatusIBs = - [1656417544.279651][3888:3893] CHIP:DMG: [ - [1656417544.279676][3888:3893] CHIP:DMG: AttributeStatusIB = - [1656417544.279710][3888:3893] CHIP:DMG: { - [1656417544.279739][3888:3893] CHIP:DMG: AttributePathIB = - [1656417544.279773][3888:3893] CHIP:DMG: { - [1656417544.279808][3888:3893] CHIP:DMG: Endpoint = 0x0, - [1656417544.279842][3888:3893] CHIP:DMG: Cluster = 0x1f, - [1656417544.279877][3888:3893] CHIP:DMG: Attribute = 0x0000_0001, - [1656417544.279908][3888:3893] CHIP:DMG: } - [1656417544.279944][3888:3893] CHIP:DMG: - [1656417544.279985][3888:3893] CHIP:DMG: StatusIB = - [1656417544.280012][3888:3893] CHIP:DMG: { - [1656417544.280041][3888:3893] CHIP:DMG: status = 0x00 (SUCCESS), - [1656417544.280072][3888:3893] CHIP:DMG: }, - [1656417544.280104][3888:3893] CHIP:DMG: - [1656417544.280130][3888:3893] CHIP:DMG: }, - [1656417544.280165][3888:3893] CHIP:DMG: - [1656417544.280189][3888:3893] CHIP:DMG: AttributeStatusIB = - [1656417544.280216][3888:3893] CHIP:DMG: { - [1656417544.280242][3888:3893] CHIP:DMG: AttributePathIB = - [1656417544.280272][3888:3893] CHIP:DMG: { - [1656417544.280304][3888:3893] CHIP:DMG: Endpoint = 0x0, - [1656417544.280337][3888:3893] CHIP:DMG: Cluster = 0x1f, - [1656417544.280371][3888:3893] CHIP:DMG: Attribute = 0x0000_0001, - [1656417544.280404][3888:3893] CHIP:DMG: ListIndex = Null, - [1656417544.280435][3888:3893] CHIP:DMG: } - [1656417544.280470][3888:3893] CHIP:DMG: - [1656417544.280500][3888:3893] CHIP:DMG: StatusIB = - [1656417544.280530][3888:3893] CHIP:DMG: { - [1656417544.280562][3888:3893] CHIP:DMG: status = 0x00 (SUCCESS), - [1656417544.280593][3888:3893] CHIP:DMG: }, - [1656417544.280624][3888:3893] CHIP:DMG: - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndex }] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - On TH1(Chiptool) , Verify AccessControlExtensionStructcontaining 1 element - Data field: - D_OK_FULL :"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018" and FabricIndex field : F1 - - - 1657278905.391846][9065:9070] CHIP:DMG: ReportDataMessage = - [1657278905.391878][9065:9070] CHIP:DMG: { - [1657278905.391906][9065:9070] CHIP:DMG: AttributeReportIBs = - [1657278905.391951][9065:9070] CHIP:DMG: [ - [1657278905.391986][9065:9070] CHIP:DMG: AttributeReportIB = - [1657278905.392036][9065:9070] CHIP:DMG: { - [1657278905.392068][9065:9070] CHIP:DMG: AttributeDataIB = - [1657278905.392108][9065:9070] CHIP:DMG: { - [1657278905.392153][9065:9070] CHIP:DMG: DataVersion = 0x1f50660b, - [1657278905.392198][9065:9070] CHIP:DMG: AttributePathIB = - [1657278905.392279][9065:9070] CHIP:DMG: { - [1657278905.392328][9065:9070] CHIP:DMG: Endpoint = 0x0, - [1657278905.392381][9065:9070] CHIP:DMG: Cluster = 0x1f, - [1657278905.392430][9065:9070] CHIP:DMG: Attribute = 0x0000_0001, - [1657278905.392470][9065:9070] CHIP:DMG: } - [1657278905.392517][9065:9070] CHIP:DMG: - [1657278905.392561][9065:9070] CHIP:DMG: Data = [ - [1657278905.392604][9065:9070] CHIP:DMG: - [1657278905.392650][9065:9070] CHIP:DMG: ], - [1657278905.392693][9065:9070] CHIP:DMG: }, - [1657278905.392739][9065:9070] CHIP:DMG: - [1657278905.392773][9065:9070] CHIP:DMG: }, - [1657278905.392823][9065:9070] CHIP:DMG: - [1657278905.392857][9065:9070] CHIP:DMG: AttributeReportIB = - [1657278905.392901][9065:9070] CHIP:DMG: { - [1657278905.392936][9065:9070] CHIP:DMG: AttributeDataIB = - [1657278905.392976][9065:9070] CHIP:DMG: { - [1657278905.393016][9065:9070] CHIP:DMG: DataVersion = 0x1f50660b, - [1657278905.393060][9065:9070] CHIP:DMG: AttributePathIB = - [1657278905.393100][9065:9070] CHIP:DMG: { - [1657278905.393135][9065:9070] CHIP:DMG: Endpoint = 0x0, - [1657278905.393170][9065:9070] CHIP:DMG: Cluster = 0x1f, - [1657278905.393207][9065:9070] CHIP:DMG: Attribute = 0x0000_0001, - [1657278905.393252][9065:9070] CHIP:DMG: ListIndex = Null, - [1657278905.393296][9065:9070] CHIP:DMG: } - [1657278905.393343][9065:9070] CHIP:DMG: - [1657278905.393385][9065:9070] CHIP:DMG: Data = - [1657278905.393429][9065:9070] CHIP:DMG: { - [1657278905.393505][9065:9070] CHIP:DMG: 0x1 = [ - [1657278905.393605][9065:9070] CHIP:DMG: 0x17, 0xd0, 0x0, 0x0, 0xf1, 0xff, 0x1, 0x0, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x69, 0x76, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x68, 0x61, 0x72, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x0, 0xd0, 0x0, 0x0, 0xf1, 0xff, 0x2, 0x0, 0x31, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x2e, 0x2e, 0x2e, 0x2e, 0x2e, 0x0, 0x18, - [1657278905.393670][9065:9070] CHIP:DMG: ] - [1657278905.393718][9065:9070] CHIP:DMG: 0xfe = 1, - [1657278905.393765][9065:9070] CHIP:DMG: }, - [1657278905.393810][9065:9070] CHIP:DMG: }, - [1657278905.393862][9065:9070] CHIP:DMG: - [1657278905.393899][9065:9070] CHIP:DMG: }, - [1657278905.393942][9065:9070] CHIP:DMG: - [1657278905.393974][9065:9070] CHIP:DMG: ], - [1657278905.394023][9065:9070] CHIP:DMG: - [1657278905.394058][9065:9070] CHIP:DMG: SuppressResponse = true, - [1657278905.394091][9065:9070] CHIP:DMG: InteractionModelRevision = 1 - [1657278905.394122][9065:9070] CHIP:DMG: } - [1657278905.394435][9065:9070] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362699 - [1657278905.394508][9065:9070] CHIP:TOO: Extension: 1 entries - [1657278905.394573][9065:9070] CHIP:TOO: [1]: { - [1657278905.394618][9065:9070] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E0018 - [1657278905.394671][9065:9070] CHIP:TOO: FabricIndex: 1 - [1657278905.394703][9065:9070] CHIP:TOO: } - [1657278905.394800][9065:9070] CHIP:EM: Sending Standalone Ack for MessageCounter:35167907 on exchange 47841i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -426,53 +141,24 @@ tests: .struct Data field: D_BAD_LENGTH :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018"}]' 1 0 - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657279033.591694][9081:9086] CHIP:DMG: StatusIB = - [1657279033.591739][9081:9086] CHIP:DMG: { - [1657279033.591784][9081:9086] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657279033.591830][9081:9086] CHIP:DMG: }, - [1657279033.591876][9081:9086] CHIP:DMG: - [1657279033.591915][9081:9086] CHIP:DMG: }, - [1657279033.591961][9081:9086] CHIP:DMG: - [1657279033.591998][9081:9086] CHIP:DMG: ], - [1657279033.592046][9081:9086] CHIP:DMG: - [1657279033.592081][9081:9086] CHIP:DMG: InteractionModelRevision = 1 - [1657279033.592115][9081:9086] CHIP:DMG: } - [1657279033.592290][9081:9086] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657279033.592341][9081:9086] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1657279033.592418][9081:9086] CHIP:EM: Sending Standalone Ack for MessageCounter:30643689 on exchange 27853i - [1657279033.592517][9081:9086] CHIP:IN: Prepared secure message 0xffff8efdd9d8 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 27853i with MessageCounter:149398748. - [1657279033.592572][9081:9086] CHIP:IN: Sending encrypted msg 0xffff8efdd9d8 with MessageCounter:149398748 to 0x0000000000000001 (1) at monotonic time: 000000000083ABDC msec - [1657279033.592744][9081:9086] CHIP:EM: Flushed pending ack for MessageCounter:30643689 on exchange 27853i - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_LENGTH, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"1518"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609094.515713][8195:8200] CHIP:DMG: StatusIB = - [1657609094.515754][8195:8200] CHIP:DMG: { - [1657609094.515797][8195:8200] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609094.515840][8195:8200] CHIP:DMG: }, - [1657609094.515882][8195:8200] CHIP:DMG: - [1657609094.515919][8195:8200] CHIP:DMG: }, - [1657609094.515970][8195:8200] CHIP:DMG: - [1657609094.516004][8195:8200] CHIP:DMG: ], - [1657609094.516051][8195:8200] CHIP:DMG: - [1657609094.516086][8195:8200] CHIP:DMG: InteractionModelRevision = 1 - [1657609094.516121][8195:8200] CHIP:DMG: } - [1657609094.516266][8195:8200] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609094.516312][8195:8200] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_STRUCT, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -480,25 +166,12 @@ tests: struct Data field: D_BAD_LIST :3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609434.915033][8206:8211] CHIP:DMG: StatusIB = - [1657609434.915073][8206:8211] CHIP:DMG: { - [1657609434.915115][8206:8211] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609434.915152][8206:8211] CHIP:DMG: }, - [1657609434.915193][8206:8211] CHIP:DMG: - [1657609434.915226][8206:8211] CHIP:DMG: }, - [1657609434.915264][8206:8211] CHIP:DMG: - [1657609434.915293][8206:8211] CHIP:DMG: ], - [1657609434.915333][8206:8211] CHIP:DMG: - [1657609434.915362][8206:8211] CHIP:DMG: InteractionModelRevision = 1 - [1657609434.915391][8206:8211] CHIP:DMG: } - [1657609434.915511][8206:8211] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609434.915549][8206:8211] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_LIST, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -506,27 +179,12 @@ tests: struct Data field: D_BAD_ELEM :17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - - [1657609579.494576][8215:8220] CHIP:DMG: - [1657609579.494615][8215:8220] CHIP:DMG: StatusIB = - [1657609579.494656][8215:8220] CHIP:DMG: { - [1657609579.494697][8215:8220] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609579.494735][8215:8220] CHIP:DMG: }, - [1657609579.494772][8215:8220] CHIP:DMG: - [1657609579.494803][8215:8220] CHIP:DMG: }, - [1657609579.494838][8215:8220] CHIP:DMG: - [1657609579.494867][8215:8220] CHIP:DMG: ], - [1657609579.494906][8215:8220] CHIP:DMG: - [1657609579.494935][8215:8220] CHIP:DMG: InteractionModelRevision = 1 - [1657609579.494963][8215:8220] CHIP:DMG: } - [1657609579.495080][8215:8220] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609579.495119][8215:8220] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_ELEM, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -534,26 +192,12 @@ tests: .struct Data field: D_BAD_OVERFLOW : 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018FF"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609625.259137][8223:8228] CHIP:DMG: - [1657609625.259168][8223:8228] CHIP:DMG: StatusIB = - [1657609625.259200][8223:8228] CHIP:DMG: { - [1657609625.259233][8223:8228] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609625.259268][8223:8228] CHIP:DMG: }, - [1657609625.259301][8223:8228] CHIP:DMG: - [1657609625.259329][8223:8228] CHIP:DMG: }, - [1657609625.259361][8223:8228] CHIP:DMG: - [1657609625.259386][8223:8228] CHIP:DMG: ], - [1657609625.259420][8223:8228] CHIP:DMG: - [1657609625.259445][8223:8228] CHIP:DMG: InteractionModelRevision = 1 - [1657609625.259471][8223:8228] CHIP:DMG: } - [1657609625.259571][8223:8228] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609625.259605][8223:8228] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_OVERFLOW, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -561,52 +205,24 @@ tests: struct Data field: D_BAD_UNDERFLOW :17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E6700"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - [1657609654.299668][8229:8234] CHIP:DMG: StatusIB = - [1657609654.299712][8229:8234] CHIP:DMG: { - [1657609654.299758][8229:8234] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609654.299808][8229:8234] CHIP:DMG: }, - [1657609654.299852][8229:8234] CHIP:DMG: - [1657609654.299892][8229:8234] CHIP:DMG: }, - [1657609654.299935][8229:8234] CHIP:DMG: - [1657609654.299969][8229:8234] CHIP:DMG: ], - [1657609654.300017][8229:8234] CHIP:DMG: - [1657609654.300053][8229:8234] CHIP:DMG: InteractionModelRevision = 1 - [1657609654.300088][8229:8234] CHIP:DMG: } - [1657609654.300230][8229:8234] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609654.300275][8229:8234] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_UNDERFLOW, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":""}]' 1 0 - - On TH1(Chiptool) , Verify that the status is CONSTRAINT_ERROR (0x87) when writing the AccessControl cluster Extension attribute - - - [1657609694.046042][8236:8241] CHIP:DMG: - [1657609694.046078][8236:8241] CHIP:DMG: StatusIB = - [1657609694.046115][8236:8241] CHIP:DMG: { - [1657609694.046154][8236:8241] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657609694.046192][8236:8241] CHIP:DMG: }, - [1657609694.046229][8236:8241] CHIP:DMG: - [1657609694.046260][8236:8241] CHIP:DMG: }, - [1657609694.046296][8236:8241] CHIP:DMG: - [1657609694.046325][8236:8241] CHIP:DMG: ], - [1657609694.046390][8236:8241] CHIP:DMG: - [1657609694.046423][8236:8241] CHIP:DMG: InteractionModelRevision = 1 - [1657609694.046452][8236:8241] CHIP:DMG: } - [1657609694.046574][8236:8241] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657609694.046614][8236:8241] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [{ Data: D_BAD_NONE, FabricIndex: CurrentFabricIndex }] + response: + error: CONSTRAINT_ERROR - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, @@ -616,123 +232,38 @@ tests: contains Data field: D_OK_SINGLE 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[{"data":"1718"},{"data":"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018"}]' 1 0 - - On TH1(Chiptool) , Verify that the status is success for first element and CONSTRAINT_ERROR (0x87) for second element when writing the AccessControl cluster Extension attribute - - [1657609694.044950][8236:8241] CHIP:DMG: WriteResponseMessage = - [1657609694.044980][8236:8241] CHIP:DMG: { - [1657609694.045008][8236:8241] CHIP:DMG: AttributeStatusIBs = - [1657609694.045049][8236:8241] CHIP:DMG: [ - [1657609694.045080][8236:8241] CHIP:DMG: AttributeStatusIB = - [1657609694.045117][8236:8241] CHIP:DMG: { - [1657609694.045149][8236:8241] CHIP:DMG: AttributePathIB = - [1657609694.045187][8236:8241] CHIP:DMG: { - [1657609694.045232][8236:8241] CHIP:DMG: Endpoint = 0x0, - [1657609694.045277][8236:8241] CHIP:DMG: Cluster = 0x1f, - [1657609694.045318][8236:8241] CHIP:DMG: Attribute = 0x0000_0001, - [1657609694.045355][8236:8241] CHIP:DMG: } - [1657609694.045397][8236:8241] CHIP:DMG: - [1657609694.045434][8236:8241] CHIP:DMG: StatusIB = - [1657609694.045472][8236:8241] CHIP:DMG: { - [1657609694.045513][8236:8241] CHIP:DMG: status = 0x00 (SUCCESS), - [1657609694.045552][8236:8241] CHIP:DMG: }, - [1657609694.045594][8236:8241] CHIP:DMG: - [1657609694.045627][8236:8241] CHIP:DMG: }, - [1657609694.045670][8236:8241] CHIP:DMG: - [1657609694.045701][8236:8241] CHIP:DMG: AttributeStatusIB = - [1657609694.045733][8236:8241] CHIP:DMG: { - [1657609694.045765][8236:8241] CHIP:DMG: AttributePathIB = - [1657609694.045801][8236:8241] CHIP:DMG: { - [1657609694.045840][8236:8241] CHIP:DMG: Endpoint = 0x0, - [1657609694.045880][8236:8241] CHIP:DMG: Cluster = 0x1f, - [1657609694.045922][8236:8241] CHIP:DMG: Attribute = 0x0000_0001, - [1657609694.045962][8236:8241] CHIP:DMG: ListIndex = Null, - [1657609694.046000][8236:8241] CHIP:DMG: } - [1657279798.809590][9208:9213] CHIP:DMG: - [1657279798.809629][9208:9213] CHIP:DMG: StatusIB = - [1657279798.809666][9208:9213] CHIP:DMG: { - [1657279798.809702][9208:9213] CHIP:DMG: status = 0x87 (CONSTRAINT_ERROR), - [1657279798.809740][9208:9213] CHIP:DMG: }, - [1657279798.809778][9208:9213] CHIP:DMG: - [1657279798.809808][9208:9213] CHIP:DMG: }, - [1657279798.809843][9208:9213] CHIP:DMG: - [1657279798.809873][9208:9213] CHIP:DMG: ], - [1657279798.809917][9208:9213] CHIP:DMG: - [1657279798.809946][9208:9213] CHIP:DMG: InteractionModelRevision = 1 - [1657279798.809974][9208:9213] CHIP:DMG: } - [1657279798.810132][9208:9213] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657279798.810171][9208:9213] CHIP:TOO: Response Failure: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1657279798.810454][9208:9213] CHIP:EM: Sending Standalone Ack for MessageCounter:192339176 on exchange 15705i - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: + [ + { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }, + { Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }, + ] + response: + error: CONSTRAINT_ERROR - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify Successfully the list of AccessControlExtensionStruct containing Data field: D_OK_EMPTY :"1718" and - FabricIndex field: F1. - - - [1657279968.698117][9221:9226] CHIP:DMG: - [1657279968.698149][9221:9226] CHIP:DMG: SuppressResponse = true, - [1657279968.698193][9221:9226] CHIP:DMG: InteractionModelRevision = 1 - [1657279968.698224][9221:9226] CHIP:DMG: } - [1657279968.698540][9221:9226] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 525362718 - [1657279968.698608][9221:9226] CHIP:TOO: Extension: 1 entries - [1657279968.698668][9221:9226] CHIP:TOO: [1]: { - [1657279968.698715][9221:9226] CHIP:TOO: Data: 1718 - [1657279968.698761][9221:9226] CHIP:TOO: FabricIndex: 1 - [1657279968.698804][9221:9226] CHIP:TOO: } - [1657279968.698905][9221:9226] CHIP:EM: Sending Standalone Ack for MessageCounter:261322624 on exchange 15524i - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] - label: "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol write extension '[]' 1 0 - - On TH1(Chiptool) , Verify that the status is success when writing the AccessControl cluster Extension attribute - - 7625][1521:1526] CHIP:DMG: AttributeStatusIB = - [1657692723.227673][1521:1526] CHIP:DMG: { - [1657692723.227725][1521:1526] CHIP:DMG: AttributePathIB = - [1657692723.227780][1521:1526] CHIP:DMG: { - [1657692723.227834][1521:1526] CHIP:DMG: Endpoint = 0x0, - [1657692723.227897][1521:1526] CHIP:DMG: Cluster = 0x1f, - [1657692723.227956][1521:1526] CHIP:DMG: Attribute = 0x0000_0001, - [1657692723.228012][1521:1526] CHIP:DMG: } - [1657692723.228073][1521:1526] CHIP:DMG: - [1657692723.228125][1521:1526] CHIP:DMG: StatusIB = - [1657692723.228182][1521:1526] CHIP:DMG: { - [1657692723.228238][1521:1526] CHIP:DMG: status = 0x00 (SUCCESS), - [1657692723.228294][1521:1526] CHIP:DMG: }, - [1657692723.228349][1521:1526] CHIP:DMG: - [1657692723.228397][1521:1526] CHIP:DMG: }, - [1657692723.228449][1521:1526] CHIP:DMG: - [1657692723.228492][1521:1526] CHIP:DMG: ], - [1657692723.228551][1521:1526] CHIP:DMG: - [1657692723.228582][1521:1526] CHIP:DMG: InteractionModelRevision = 1 - [1657692723.228608][1521:1526] CHIP:DMG: } - [1657692723.228738][1521:1526] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1657692723.228802][1521:1526] CHIP:EM: Sending Standalone Ack for MessageCounter:57305662 on exchange 27543i - [1657692723.228869][1521:1526] CHIP:IN: Prepared secure message 0xffff9fffd9d8 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 27543i with MessageCounter:9219504. - [1657692723.228909][1521:1526] - disabled: true + command: "writeAttribute" + attribute: "Extension" + arguments: + value: [] - label: "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute" PICS: ACL.S.A0001 - verification: | - ./chip-tool accesscontrol read extension 1 0 - - On TH1(Chiptool) , Verify AccessControl cluster Extension attribute, value is an empty list - - [1660223145.427219][80697:80702] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 2385810240 - [1660223145.427227][80697:80702] CHIP:TOO: Extension: 0 entries - disabled: true + command: "readAttribute" + attribute: "Extension" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml index a00d3e2b34d7d6..a480adf18fcb4e 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml @@ -20,74 +20,77 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Account Login" + endpoint: 3 + TempAccountIdentifier: + type: char_string + defaultValue: "1111" + catalogVendorId: + type: int16u + defaultValue: 123 + applicationId: + type: char_string + defaultValue: "exampleid" tests: - - label: "Precondition" - verification: | - Test Setup: Commission DUT to TH, if not done so already. In some cases, such as with a Casting Video Player, the DUT commissions the TH (eg. tv-casting-app). - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - - label: - "Make sure there is a Content App endpoint implementing the Account - Login cluster. Product maker may provide pre-setup steps" - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner). - - The following command on the example tv-app will launch a content app on endpoint 4: - ./chip-tool applicationlauncher launch-app "{"catalogVendorId": 123, "applicationId": "exampleid"}" 1 1 - ./chip-tv-casting-app applicationlauncher launch-app "{"catalogVendorId": 123, "applicationId": "exampleid"}" 1 1 - - Verify in TH Log: - [1654004240716] [9799:7814889] CHIP: [DMG] Received Command Response Data, Endpoint=1 Cluster=0x0000_050C Command=0x0000_0003 - [1654004240717] [9799:7814889] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_050C Command 0x0000_0003 - [1654004240717] [9799:7814889] CHIP: [TOO] LauncherResponse: { - [1654004240717] [9799:7814889] CHIP: [TOO] status: 0 - [1654004240717] [9799:7814889] CHIP: [TOO] data: 64617461 - [1654004240717] [9799:7814889] CHIP: [TOO] } - disabled: true + - label: "Launch an app with the provided a application ID" + PICS: APPLAUNCHER.S.C00.Rsp + cluster: "Application Launcher" + command: "LaunchApp" + arguments: + values: + - name: "Data" + value: "Hello World" + - name: "application" + value: + { + catalogVendorId: catalogVendorId, + applicationId: applicationId, + } + response: + values: + - name: "status" + value: 0 - label: "TH sends a GetSetupPIN command to the DUT with test values provided by the product maker." PICS: ALOGIN.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool accountlogin get-setup-pin 1111 1 4 --timedInteractionTimeoutMs 1000 - ./chip-tv-casting-app accountlogin get-setup-pin 1111 1 4 --timedInteractionTimeoutMs 1000 - - On TH Verify that the DUT responds with a valid GetSetupPINResponse. - [1654004273684] [9851:7821178] CHIP: [DMG] Received Command Response Data, Endpoint=4 Cluster=0x0000_050E Command=0x0000_0001 - [1654004273684] [9851:7821178] CHIP: [TOO] Endpoint: 6 Cluster: 0x0000_050E Command 0x0000_0001 - [1654004273684] [9851:7821178] CHIP: [TOO] GetSetupPINResponse: { - [1654004273684] [9851:7821178] CHIP: [TOO] setupPIN: 34567890 - [1654004273684] [9851:7821178] CHIP: [TOO] } - disabled: true + command: "GetSetupPIN" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "TempAccountIdentifier" + value: TempAccountIdentifier + response: + values: + - name: "setupPIN" + saveAs: setupPIN - label: "TH sends a Login command to the DUT with test values provided by the product maker." PICS: ALOGIN.S.C02.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool accountlogin login 11111 34567890 1 4 --timedInteractionTimeoutMs 1000 - ./chip-tv-casting-app accountlogin login 11111 34567890 1 4 --timedInteractionTimeoutMs 1000 - - On TH Verify that the DUT responds with a standard command response. - [1654004350009] [9951:7836487] CHIP: [DMG] Received Command Response Status for Endpoint=4 Cluster=0x0000_050E Command=0x0000_0002 Status=0x0 - disabled: true + command: "Login" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "tempAccountIdentifier" + value: TempAccountIdentifier + - name: "setupPIN" + value: setupPIN - label: "TH sends a Logout command to the DUT with test values provided by the product maker." PICS: ALOGIN.S.C03.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool accountlogin logout 1 4 --timedInteractionTimeoutMs 1000 - ./chip-tv-casting-app accountlogin logout 1 4 --timedInteractionTimeoutMs 1000 - - On TH Verify that the DUT responds with a standard command response. - - [1654004400892] [9988:7841997] CHIP: [DMG] Received Command Response Status for Endpoint=4 Cluster=0x0000_050E Command=0x0000_0003 Status=0x0 - disabled: true + command: "Logout" + timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml index f4eebc4d1089df..44705b9932bdc0 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml @@ -14,96 +14,202 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 3.1.1. [TC-BRBINFO-1.1] Global Attributes for Bridged Device Basic + 130.1.1. [TC-BRBINFO-1.1] Global Attributes for Bridged Device Basic Information Cluster Cluster [DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Bridged Device Basic" + endpoint: 3 tests: - - label: "" - verification: | - Validate these PICS items of attributes which are not allowed in this server cluster implementation - these PICS items should all be FALSE, if any of them is TRUE then FAIL the test - - BRBINFO.S.A0000(DataModelRevision) - - BRBINFO.S.A0004(ProductID) - - BRBINFO.S.A0006(Location) - - BRBINFO.S.A0010(LocalConfigDisabled) - - BRBINFO.S.A0013(CapabilityMinima) - disabled: true - - - label: "Commission DUT to TH (if not already done)" - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool bridgeddevicebasic read cluster-revision 1 3 - - On TH(chip-tool), verify DUT responsds ClusterRevision attribute has value 1 - - [1657695910.794487][15411:15416] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFD DataVersion: 2577979325 - [1657695910.794568][15411:15416] CHIP:TOO: ClusterRevision: 1 - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - label: "TH reads the FeatureMap from DUT" - verification: | - ./chip-tool bridgeddevicebasic read feature-map 1 3 - - On TH(chip-tool), verify at DUT responds Featuremap value as 0 - - [1658749277.166884][10254:10259] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFC DataVersion: 3297319126 - [1658749277.166945][10254:10259] CHIP:TOO: FeatureMap: 0 - [1658749277.167033][10254:10259] CHIP:EM: Sending Standalone Ack for MessageCounter:190389852 on exchange 39565i - disabled: true + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 - label: "TH reads AttributeList from DUT" - verification: | - ./chip-tool bridgeddevicebasic read attribute-list 1 3 - - On TH(chip-tool), verify TH(chip-tool)at DUT responds as list of supported attributes as entries matching TH(chip-tool)e PICS items (see column F) - - [1658833518.065647][9014:9019] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFB DataVersion: 270848876 - [1658833518.065723][9014:9019] CHIP:TOO: AttributeList: 7 entries - [1658833518.065773][9014:9019] CHIP:TOO: [1]: 5 - [1658833518.065804][9014:9019] CHIP:TOO: [2]: 17 - [1658833518.065833][9014:9019] CHIP:TOO: [3]: 65528 - [1658833518.065862][9014:9019] CHIP:TOO: [4]: 65529 - [1658833518.065891][9014:9019] CHIP:TOO: [5]: 65531 - [1658833518.065919][9014:9019] CHIP:TOO: [6]: 65532 - [1658833518.065949][9014:9019] CHIP:TOO: [7]: 65533 - disabled: true - - - label: "TH reads EventList from DUT" - verification: | - NEED SDK Implementation - - Out of scope for V1 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT" - verification: | - ./chip-tool bridgeddevicebasic read accepted-command-list 1 3 - - On TH(chip-tool), verify DUT responds as list of Accepted Commands as 0 entries - - [1657696300.165081][15447:15452] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFF9 DataVersion: 2577979325 - [1657696300.165174][15447:15452] CHIP:TOO: AcceptedCommandList: 0 entries - disabled: true - - - label: "TH reads GeneratedCommandList from DUT" - verification: | - ./chip-tool bridgeddevicebasic read generated-command-list 1 3 - - On TH(chip-tool), verify that DUT responds as list of GeneratedCommands as 0 entries - - [1657696328.889936][15454:15459] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFF8 DataVersion: 2577979325 - [1657696328.890017][15454:15459] CHIP:TOO: GeneratedCommandList: 0 entries - disabled: true + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [17, 65528, 65529, 65531, 65532, 65533] + + - label: "TH reads optional attribute(VendorName) in AttributeList" + PICS: BRBINFO.S.A0001 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [1] + + - label: "TH reads optional attribute(VendorID) in AttributeList" + PICS: BRBINFO.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: "TH reads optional attribute(ProductName) in AttributeList" + PICS: BRBINFO.S.A0003 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: "TH reads optional attribute(NodeLabel) in AttributeList" + PICS: BRBINFO.S.A0005 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [5] + + - label: "TH reads optional attribute(HardwareVersion) in AttributeList" + PICS: BRBINFO.S.A0007 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [7] + + - label: + "TH reads optional attribute(HardwareVersionString) in AttributeList" + PICS: BRBINFO.S.A0008 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [8] + + - label: "TH reads optional attribute(SoftwareVersion) in AttributeList" + PICS: BRBINFO.S.A0009 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [9] + + - label: + "TH reads optional attribute(SoftwareVersionString) in AttributeList" + PICS: BRBINFO.S.A000a + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [10] + + - label: "TH reads optional attribute(ManufacturingDate) in AttributeList" + PICS: BRBINFO.S.A000b + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [11] + + - label: "TH reads optional attribute(PartNumber) in AttributeList" + PICS: BRBINFO.S.A000c + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [12] + + - label: "TH reads optional attribute(ProductURL) in AttributeList" + PICS: BRBINFO.S.A000d + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [13] + + - label: "TH reads optional attribute(ProductLabel) in AttributeList" + PICS: BRBINFO.S.A000e + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [14] + + - label: "TH reads optional attribute(SerialNumber) in AttributeList" + PICS: BRBINFO.S.A000f + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [15] + + - label: "TH reads optional attribute(UniqueID) in AttributeList" + PICS: BRBINFO.S.A0012 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [18] + + - label: "TH1 reads AcceptedCommandList from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "TH1 reads GeneratedCommandList from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- label: + # "Read EventList attribute from the DUT and Verify that the DUT + # response provides a list of supported events." + # verification: | + # Not implemented in chip-tool + # cluster: "LogCommands" + # command: "UserPrompt" + # PICS: PICS_USER_PROMPT + # arguments: + # values: + # - name: "message" + # value: "Please enter 'y' for success" + # - name: "expectedValue" + # value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml index 81ca10425f3bd0..6592da0b8d116b 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml @@ -13,127 +13,128 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.2.1. [TC-BRBINFO-2.1] Attributes [DUT-Server] +name: 130.2.1. [TC-BRBINFO-2.1] Attributes [DUT-Server] config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Bridged Device Basic" + endpoint: 3 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH reads VendorName from the DUT." PICS: BRBINFO.S.A0001 - verification: | - ./chip-tool bridgeddevicebasic read vendor-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495199.434300][2158:2163] CHIP:TOO: VendorName: TEST_VENDOR - disabled: true - - - label: "TH writes VendorName as sample" + command: "readAttribute" + attribute: "VendorName" + response: + saveAs: VendorNameValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes VendorName from the DUT." PICS: BRBINFO.S.A0001 - verification: | - ./chip-tool bridgeddevicebasic write vendor-name sample 1 3 + command: "writeAttribute" + attribute: "VendorName" + arguments: + value: "sample" + response: + error: UNSUPPORTED_WRITE - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads VendorName" + - label: "TH reads VendorName from the DUT." PICS: BRBINFO.S.A0001 - verification: | - ./chip-tool bridgeddevicebasic read vendor-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495199.434300][2158:2163] CHIP:TOO: VendorName: TEST_VENDOR - disabled: true + command: "readAttribute" + attribute: "VendorName" + response: + value: VendorNameValue - label: "TH reads VendorID from the DUT." PICS: BRBINFO.S.A0002 - verification: | - ./chip-tool bridgeddevicebasic read vendor-id 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "VendorID" + response: + saveAs: VendorIDValue + constraints: + type: vendor_id + minValue: 1 + maxValue: 65521 - Example Log: - [1656495322.252171][2177:2182] CHIP:TOO: VendorID: 65521 - disabled: true - - - label: "TH writes VendorID as 0x0011" + - label: + "Verify that VendorID matches the value assigned to this manufacturer" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A0002 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes VendorID from the DUT." PICS: BRBINFO.S.A0002 - verification: | - ./chip-tool bridgeddevicebasic write vendor-name 0x0011 1 3 + command: "writeAttribute" + attribute: "VendorID" + arguments: + value: 0x0011 + response: + error: UNSUPPORTED_WRITE - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads VendorID" + - label: "TH reads VendorID from the DUT." PICS: BRBINFO.S.A0002 - verification: | - ./chip-tool bridgeddevicebasic read vendor-id 1 3 + command: "readAttribute" + attribute: "VendorID" + response: + value: VendorIDValue - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495322.252171][2177:2182] CHIP:TOO: VendorID: 65521 - disabled: true - - - label: "TH reads ProductName from the DUT." + - label: "TH reads ProductName from the DUT" PICS: BRBINFO.S.A0003 - verification: | - ./chip-tool bridgeddevicebasic read product-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495708.412745][2200:2205] CHIP:TOO: ProductName: TEST_PRODUCT - disabled: true - - - label: "TH writes ProductName as newproduct" + command: "readAttribute" + attribute: "ProductName" + response: + saveAs: ProductNameValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes ProductName from the DUT." PICS: BRBINFO.S.A0003 - verification: | - ./chip-tool bridgeddevicebasic write vendor-name ""newproduct"" 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - NOTE the quotes: single-quote/double-quote/string/double-quote/single-quote - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads ProductName" + command: "writeAttribute" + attribute: "ProductName" + arguments: + value: "newproduct" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductName from the DUT" PICS: BRBINFO.S.A0003 - verification: | - ./chip-tool bridgeddevicebasic read product-name 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495708.412745][2200:2205] CHIP:TOO: ProductName: TEST_PRODUCT - disabled: true + command: "readAttribute" + attribute: "ProductName" + response: + value: ProductNameValue - label: "TH reads NodeLabel from the DUT" PICS: BRBINFO.S.A0005 - verification: | - ./chip-tool bridgeddevicebasic read node-label 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "NodeLabel" + response: + saveAs: NodeLabelValue + constraints: + type: char_string + maxLength: 32 - Example Log: - [1657696463.081741][15476:15481] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0005 DataVersion: 2577979325 - [1657696463.081791][15476:15481] CHIP:TOO: NodeLabel: Light 1 - disabled: true - - - label: "TH writes newnode to NodeLabel" - PICS: BRBINFO.S.A0005 + #Issue https://github.com/project-chip/connectedhomeip/issues/23509 + - label: "TH writes NodeLabel from the DUT." + PICS: BRBINFO.S.A0005 && PICS_USER_PROMPT verification: | - ./chip-tool bridgeddevicebasic write node-label ""newnode"" 1 3 + ./chip-tool bridgeddevicebasic write node-label '"newnode"' 1 3 Verify response has unsupported write on TH(chip-tool) Log: @@ -148,10 +149,17 @@ tests: [1660839701.840827][2444:2449] CHIP:DMG: }, [1660839701.840905][2444:2449] CHIP:DMG: [1660839701.840973][2444:2449] CHIP:DMG: }, - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" - - label: "TH reads NodeLabel" - PICS: BRBINFO.S.A0005 + - label: "TH reads NodeLabel from the DUT" + PICS: BRBINFO.S.A0005 && PICS_USER_PROMPT verification: | ./chip-tool bridgeddevicebasic read node-label 1 3 @@ -159,370 +167,342 @@ tests: [1657696463.081741][15476:15481] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0005 DataVersion: 2577979325 [1657696463.081791][15476:15481] CHIP:TOO: NodeLabel: newnode - disabled: true - - - label: "TH reads HardwareVersion from the DUT." + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "TH reads HardwareVersion from the DUT" PICS: BRBINFO.S.A0007 - verification: | - ./chip-tool bridgeddevicebasic read hardware-version 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496175.564718][2302:2307] CHIP:TOO: HardwareVersion: 0 - disabled: true - - - label: "TH writes HardwareVersion as 0x4531" + command: "readAttribute" + attribute: "HardwareVersion" + response: + saveAs: HardwareVersionValue + constraints: + type: int16u + minValue: 0 + maxValue: 65534 + + - label: "TH writes HardwareVersion from the DUT." PICS: BRBINFO.S.A0007 - verification: | - ./chip-tool bridgeddevicebasic write hardware-version-string 0x4531 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads HardwareVersion" + command: "writeAttribute" + attribute: "HardwareVersion" + arguments: + value: 0x4531 + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads HardwareVersion from the DUT" PICS: BRBINFO.S.A0007 - verification: | - ./chip-tool bridgeddevicebasic write hardware-version-string 0x4531 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496175.564718][2302:2307] CHIP:TOO: HardwareVersion: 0 - disabled: true + command: "readAttribute" + attribute: "HardwareVersion" + response: + value: HardwareVersionValue - label: "TH reads HardwareVersionString from the DUT." PICS: BRBINFO.S.A0008 - verification: | - ./chip-tool bridgeddevicebasic read hardware-version-string 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496257.298675][2315:2320] CHIP:TOO: HardwareVersionString: TEST_VERSION - disabled: true - - - label: "TH writes HardwareVersionString as newhardwareversion" + command: "readAttribute" + attribute: "HardwareVersionString" + response: + saveAs: HardwareVersionStringValue + constraints: + type: char_string + minLength: 1 + maxLength: 64 + + - label: "TH writes HardwareVersionString from the DUT." PICS: BRBINFO.S.A0008 - verification: | - ./chip-tool bridgeddevicebasic write hardware-version-string newhardwareversion 1 3 + command: "writeAttribute" + attribute: "HardwareVersionString" + arguments: + value: "newhardwareversion" + response: + error: UNSUPPORTED_WRITE - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads HardwareVersionString" + - label: "TH reads HardwareVersionString from the DUT." PICS: BRBINFO.S.A0008 - verification: | - ./chip-tool bridgeddevicebasic read hardware-version-string 1 3 + command: "readAttribute" + attribute: "HardwareVersionString" + response: + value: HardwareVersionStringValue - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496257.298675][2315:2320] CHIP:TOO: HardwareVersionString: TEST_VERSION - disabled: true - - - label: "TH reads SoftwareVersion from the DUT." + - label: "TH reads SoftwareVersion from the DUT" PICS: BRBINFO.S.A0009 - verification: | - ./chip-tool bridgeddevicebasic read software-version 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496411.609866][2348:2353] CHIP:TOO: SoftwareVersion: 1 - disabled: true - - - label: "TH writes SoftwareVersion as 0x8213" + command: "readAttribute" + attribute: "SoftwareVersion" + response: + saveAs: SoftwareVersionValue + constraints: + minValue: 0 + maxValue: 4294967294 + + - label: "TH writes SoftwareVersion from the DUT." PICS: BRBINFO.S.A0009 - verification: | - ./chip-tool bridgeddevicebasic write software-version 0x8213 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads SoftwareVersion" + command: "writeAttribute" + attribute: "SoftwareVersion" + arguments: + value: 0x8213 + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads SoftwareVersion from the DUT" PICS: BRBINFO.S.A0009 - verification: | - ./chip-tool bridgeddevicebasic read software-version 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496411.609866][2348:2353] CHIP:TOO: SoftwareVersion: 1 - disabled: true + command: "readAttribute" + attribute: "SoftwareVersion" + response: + value: SoftwareVersionValue - - label: "TH reads SoftwareVersionString from the DUT." + - label: "TH reads SoftwareVersionString from the DUT" PICS: BRBINFO.S.A000a - verification: | - ./chip-tool bridgeddevicebasic read software-version-string 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496498.568951][2362:2367] CHIP:TOO: SoftwareVersionString: 1.0 - disabled: true - - - label: "TH writes SoftwareVersionString as 1.0" + command: "readAttribute" + attribute: "SoftwareVersionString" + response: + saveAs: SoftwareVersionStringValue + constraints: + minLength: 1 + maxLength: 64 + + - label: "TH writes SoftwareVersionString from the DUT." PICS: BRBINFO.S.A000a - verification: | - ./chip-tool bridgeddevicebasic write software-version 1.0 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads SoftwareVersionString" + command: "writeAttribute" + attribute: "SoftwareVersionString" + arguments: + value: "1.0" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads SoftwareVersionString from the DUT" PICS: BRBINFO.S.A000a - verification: | - ./chip-tool bridgeddevicebasic read software-version-string 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496498.568951][2362:2367] CHIP:TOO: SoftwareVersionString: 1.0 - disabled: true + command: "readAttribute" + attribute: "SoftwareVersionString" + response: + value: SoftwareVersionStringValue - label: "TH reads ManufacturingDate from the DUT." PICS: BRBINFO.S.A000b - verification: | - ./chip-tool bridgeddevicebasic read manufacturing-date 1 3 + command: "readAttribute" + attribute: "ManufacturingDate" + response: + saveAs: ManufacturingDateValue + constraints: + type: char_string + minLength: 8 + maxLength: 16 - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496661.777852][2388:2393] CHIP:TOO: ManufacturingDate: 20200101 - disabled: true - - - label: "TH writes ManufacturingDate as 20210814789452IN" + - label: + "Verify if the first 8 characters specify date according to ISO 8601, + i.e, YYYYMMDD." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A000b + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ManufacturingDate from the DUT." PICS: BRBINFO.S.A000b - verification: | - ./chip-tool bridgeddevicebasic write manufacturing-date 20210814789452IN 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: + command: "writeAttribute" + attribute: "ManufacturingDate" + arguments: + value: "20210814789452IN" + response: + error: UNSUPPORTED_WRITE - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads ManufacturingDate" + - label: "TH reads ManufacturingDate from the DUT." PICS: BRBINFO.S.A000b - verification: | - ./chip-tool bridgeddevicebasic read manufacturing-date 1 3 + command: "readAttribute" + attribute: "ManufacturingDate" + response: + value: ManufacturingDateValue - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656496661.777852][2388:2393] CHIP:TOO: ManufacturingDate: 20200101 - disabled: true - - - label: "TH reads PartNumber from the DUT." + - label: "TH reads PartNumber from the DUT" PICS: BRBINFO.S.A000c - verification: | - ./chip-tool bridgeddevicebasic read part-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656496800.941788][2405:2410] CHIP:TOO: PartNumber: 1234 - disabled: true - - - label: "TH writes PartNumber as newpart" + command: "readAttribute" + attribute: "PartNumber" + response: + saveAs: PartNumberValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes PartNumber from the DUT." PICS: BRBINFO.S.A000c - verification: | - ./chip-tool bridgeddevicebasic write part-number newpart 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads PartNumber" + command: "writeAttribute" + attribute: "PartNumber" + arguments: + value: "newpart" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads PartNumber from the DUT" PICS: BRBINFO.S.A000c - verification: | - ./chip-tool bridgeddevicebasic read part-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "PartNumber" + response: + value: PartNumberValue - Example Log: - [1656496800.941788][2405:2410] CHIP:TOO: PartNumber: 1234 - disabled: true - - - label: "TH reads ProductURL from the DUT." + - label: "TH reads ProductURL from the DUT" PICS: BRBINFO.S.A000d - verification: | - ./chip-tool bridgeddevicebasic read product-url 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656497181.118653][2436:2441] CHIP:TOO: ProductURL: https://example.com/myproduct - disabled: true + command: "readAttribute" + attribute: "ProductURL" + response: + saveAs: ProductURLValue + constraints: + type: long_char_string + maxLength: 256 - - label: "TH writes ProductURL as https://www.example.com" + - label: + "Verify that it specifies a link to a specific web page, Verify that + it follows the syntax rules specified in RFC 3986." + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A000d + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ProductURL from the DUT." PICS: BRBINFO.S.A000d - verification: | - ./chip-tool bridgeddevicebasic write product-url https://www.example.com 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: - - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads ProductURL" + command: "writeAttribute" + attribute: "ProductURL" + arguments: + value: "https://www.example.com" + response: + error: UNSUPPORTED_WRITE + + - label: "TH reads ProductURL from the DUT" PICS: BRBINFO.S.A000d - verification: | - ./chip-tool bridgeddevicebasic read product-url 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656497181.118653][2436:2441] CHIP:TOO: ProductURL: https://example.com/myproduct - disabled: true + command: "readAttribute" + attribute: "ProductURL" + response: + value: ProductURLValue - label: "TH reads ProductLabel from the DUT." PICS: BRBINFO.S.A000e - verification: | - ./chip-tool bridgeddevicebasic read product-label 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE + command: "readAttribute" + attribute: "ProductLabel" + response: + saveAs: ProductLabelValue + constraints: + type: char_string + maxLength: 64 - Example Log: - - [1656501313.811305][2602:2607] CHIP:TOO: ProductLabel: ABCD - disabled: true - - - label: "TH writes ProductLabel as newproductlabel" + - label: + "Verify that it does not include the name of the vendor as defined + within the VendorName attribute" + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && BRBINFO.S.A000e + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: "TH writes ProductLabel from the DUT." PICS: BRBINFO.S.A000e - verification: | - ./chip-tool bridgeddevicebasic write product-label newproductlabel 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true + command: "writeAttribute" + attribute: "ProductLabel" + arguments: + value: "newproductlabel" + response: + error: UNSUPPORTED_WRITE - - label: "TH reads ProductLabel" + - label: "TH reads ProductLabel from the DUT." PICS: BRBINFO.S.A000e - verification: | - ./chip-tool bridgeddevicebasic read product-label 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656501313.811305][2602:2607] CHIP:TOO: ProductLabel: ABCD - disabled: true + command: "readAttribute" + attribute: "ProductLabel" + response: + value: ProductLabelValue - label: "TH reads SerialNumber from the DUT." PICS: BRBINFO.S.A000f - verification: | - ./chip-tool bridgeddevicebasic read serial-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656501452.183890][2624:2630] CHIP:TOO: SerialNumber: 5678 - disabled: true - - - label: "TH writes SerialNumber_test as newserialnumber" + command: "readAttribute" + attribute: "SerialNumber" + response: + saveAs: SerialNumberValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes SerialNumber from the DUT." PICS: BRBINFO.S.A000f - verification: | - ./chip-tool bridgeddevicebasic write serial-number newserialnumber 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: + command: "writeAttribute" + attribute: "SerialNumber" + arguments: + value: "newserialnumber" + response: + error: UNSUPPORTED_WRITE - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads SerialNumber" + - label: "TH reads SerialNumber from the DUT." PICS: BRBINFO.S.A000f - verification: | - ./chip-tool bridgeddevicebasic read serial-number 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656501452.183890][2624:2630] CHIP:TOO: SerialNumber: 5678 - disabled: true + command: "readAttribute" + attribute: "SerialNumber" + response: + value: SerialNumberValue - label: "TH reads Reachable from the DUT." PICS: BRBINFO.S.A0011 - verification: | - ./chip-tool bridgeddevicebasic read reachable 1 3 - - Verify value of reachable is type of bool and its true in TH Log: - - [1659012746.234251][8169:8174] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0011 DataVersion: 1363291551 - [1659012746.234309][8169:8174] CHIP:TOO: Reachable: TRUE - [1659012746.234420][8169:8174] CHIP:EM: Sending Standalone Ack for MessageCounter:92645971 on exchange 389i - disabled: true + command: "readAttribute" + attribute: "Reachable" + response: + value: true + constraints: + type: boolean - label: "TH sends Write request message to DUT to change value of Reachable to - false." + false" PICS: BRBINFO.S.A0011 - verification: | - ./chip-tool bridgeddevicebasic write-by-id 17 false 1 3 - - - - On TH verify that, TH receives UNSUPPORTED_WRITE response as status - [1656496372.884955][2340:2345] CHIP:DMG: } - [1656496372.885085][2340:2345] CHIP:DMG: WriteClient moving to [AwaitingDe] - [1656496372.885148][2340:2345] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - [1656496372.885242][2340:2345] CHIP:EM: Sending Standalone Ack for MessageCounter:201795946 on exchange 27637ihe attribute is optional so no example log can be provided. - disabled: true + command: "writeAttribute" + attribute: "Reachable" + arguments: + value: false + response: + error: UNSUPPORTED_WRITE - label: "TH reads Reachable from the DUT." PICS: BRBINFO.S.A0011 - verification: | - ./chip-tool bridgeddevicebasic read reachable 1 3 - On TH verify that the value of reachable is type is same as 51 - - [1659012746.234251][8169:8174] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_0011 DataVersion: 1363291551 - [1659012746.234309][8169:8174] CHIP:TOO: Reachable: TRUE - [1659012746.234420][8169:8174] CHIP:EM: Sending Standalone Ack for MessageCounter:92645971 on exchange 389i - disabled: true + command: "readAttribute" + attribute: "Reachable" + response: + value: true + constraints: + type: boolean - label: "TH reads UniqueID from the DUT." PICS: BRBINFO.S.A0012 - verification: | - ./chip-tool bridgeddevicebasic read unique-id 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - - [1656501734.253827][2673:2679] CHIP:TOO: UniqueID: 30789FE4FCF832C9 - disabled: true - - - label: "TH writes UniqueID as newid" + command: "readAttribute" + attribute: "UniqueID" + response: + saveAs: UniqueIDValue + constraints: + type: char_string + maxLength: 32 + + - label: "TH writes UniqueID from the DUT." PICS: BRBINFO.S.A0012 - verification: | - ./chip-tool bridgeddevicebasic write unique-id newid 1 3 - - Verify response has unsupported write on TH(chip-tool) Log: + command: "writeAttribute" + attribute: "UniqueID" + arguments: + value: "newid" + response: + error: UNSUPPORTED_WRITE - [1656495259.991989][2164:2169] CHIP:TOO: Response Failure: IM Error 0x00000588: General error: 0x88 (UNSUPPORTED_WRITE) - disabled: true - - - label: "TH reads UniqueID" + - label: "TH reads UniqueID from the DUT." PICS: BRBINFO.S.A0012 - verification: | - ./chip-tool bridgeddevicebasic read unique-id 1 3 - - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE - - Example Log: - [1656501734.253827][2673:2679] CHIP:TOO: UniqueID: 30789FE4FCF832C9 - disabled: true + command: "readAttribute" + attribute: "UniqueID" + response: + value: UniqueIDValue diff --git a/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml b/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml index 3c5936b993798d..8e167b434b01b1 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_1_3.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 12.1.3. [TC-CNET-1.3] Global Attributes for Networking commissioning cluster @@ -22,209 +21,165 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" + cluster: "Network Commissioning" endpoint: 0 tests: - - label: "Commission TH and DUT over BLE to setup the Wi-Fi" - verification: | - - disabled: true - - - label: "TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool networkcommissioning read cluster-revision 1 0 - - Verify "ClusterRevision: 1" on the TH(Chip-tool) Log: - - [1649244866.275684][30440:30446] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFD DataVersion: 2702518944 - [1649244866.277721][30440:30446] CHIP:TOO: ClusterRevision: 1 - [1649244866.277827][30440:30446] CHIP:EM: Sending Standalone Ack for MessageCounter:10092551 on exchange 64234i - disabled: true - - - label: "TH reads the FeatureMap from DUT" - verification: | - (WiFi) - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify "FeatureMap" on the TH(Chip-tool) Log: - - [1651215443.195852][3285:3290] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 2584224280 - [1651215443.195939][3285:3290] CHIP:TOO: FeatureMap: 1 - - (Ethernet) - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify "FeatureMap" on the TH(Chip-tool) Log: - - [1660315515.081759][32315:32320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 4034679103 - [1660315515.081895][32315:32320] CHIP:TOO: FeatureMap: 4 - - (Thread) - ./chip-tool networkcommissioning read feature-map 1 0 - - Verify "FeatureMap" on the TH(Chip-tool) Log: - - [1660315948.250922][3101:3106] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFC DataVersion: 1122474754 - [1660315948.261520][3101:3106] CHIP:TOO: FeatureMap: 2 - disabled: true - - - label: "TH reads AttributeList from DUT" - verification: | - (WiFi) - ./chip-tool networkcommissioning read attribute-list 1 0 - - Verify "AttributeList" on the TH(Chip-tool) Log: - - [1651215479.539148][3293:3298] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFB DataVersion: 2584224280 - [1651215479.539230][3293:3298] CHIP:TOO: AttributeList: 13 entries - [1651215479.539262][3293:3298] CHIP:TOO: [1]: 0 - [1651215479.539288][3293:3298] CHIP:TOO: [2]: 1 - [1651215479.539323][3293:3298] CHIP:TOO: [3]: 2 - [1651215479.539348][3293:3298] CHIP:TOO: [4]: 3 - [1651215479.539373][3293:3298] CHIP:TOO: [5]: 4 - [1651215479.539397][3293:3298] CHIP:TOO: [6]: 5 - [1651215479.539420][3293:3298] CHIP:TOO: [7]: 6 - [1651215479.539444][3293:3298] CHIP:TOO: [8]: 7 - [1651215479.539468][3293:3298] CHIP:TOO: [9]: 65528 - [1651215479.539493][3293:3298] CHIP:TOO: [10]: 65529 - [1651215479.539517][3293:3298] CHIP:TOO: [11]: 65531 - [1651215479.539541][3293:3298] CHIP:TOO: [12]: 65532 - [1651215479.539564][3293:3298] CHIP:TOO: [13]: 65533 - - - (Ethernet) - - ./chip-tool networkcommissioning read attribute-list 1 0 - - Verify "AttributeList" on the TH(Chip-tool) Log: - - [1660315522.163640][32321:32326] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFFB DataVersion: 4034679103 - [1660315522.163797][32321:32326] CHIP:TOO: AttributeList: 13 entries - [1660315522.163880][32321:32326] CHIP:TOO: [1]: 0 - [1660315522.163945][32321:32326] CHIP:TOO: [2]: 1 - [1660315522.164009][32321:32326] CHIP:TOO: [3]: 2 - [1660315522.164106][32321:32326] CHIP:TOO: [4]: 3 - [1660315522.164174][32321:32326] CHIP:TOO: [5]: 4 - [1660315522.164260][32321:32326] CHIP:TOO: [6]: 5 - [1660315522.164328][32321:32326] CHIP:TOO: [7]: 6 - [1660315522.164393][32321:32326] CHIP:TOO: [8]: 7 - [1660315522.164482][32321:32326] CHIP:TOO: [9]: 65528 - [1660315522.164549][32321:32326] CHIP:TOO: [10]: 65529 - [1660315522.164636][32321:32326] CHIP:TOO: [11]: 65531 - [1660315522.164708][32321:32326] CHIP:TOO: [12]: 65532 - [1660315522.164778][32321:32326] CHIP:TOO: [13]: 65533 - - (Thread) - - ./chip-tool networkcommissioning read attribute-list 1 0 - - Verify "AttributeList" on the TH(Chip-tool) Log: - - [1660316011.016650][3112:3117] CHIP:TOO: AttributeList: 13 entries - [1660316011.016678][3112:3117] CHIP:TOO: [1]: 0 - [1660316011.016700][3112:3117] CHIP:TOO: [2]: 1 - [1660316011.016721][3112:3117] CHIP:TOO: [3]: 2 - [1660316011.016741][3112:3117] CHIP:TOO: [4]: 3 - [1660316011.016762][3112:3117] CHIP:TOO: [5]: 4 - [1660316011.016782][3112:3117] CHIP:TOO: [6]: 5 - [1660316011.016803][3112:3117] CHIP:TOO: [7]: 6 - [1660316011.016823][3112:3117] CHIP:TOO: [8]: 7 - [1660316011.016844][3112:3117] CHIP:TOO: [9]: 65528 - [1660316011.016865][3112:3117] CHIP:TOO: [10]: 65529 - [1660316011.016887][3112:3117] CHIP:TOO: [11]: 65531 - [1660316011.016908][3112:3117] CHIP:TOO: [12]: 65532 - [1660316011.016929][3112:3117] CHIP:TOO: [13]: 65533 - [1660316011.017068][3112:3117] CHIP:EM: Sending Standalone Ack for MessageCounter:239150268 on exchange 45209i - disabled: true - - - label: "TH reads EventList from the DUT" - verification: | - out of scope for V1.0 - disabled: true - - - label: "TH reads AcceptedCommandList from DUT" - verification: | - (WiFi) - ./chip-tool networkcommissioning read accepted-command-list 1 0 - - Verify "AcceptedCommandList" on the TH(Chip-tool) Log: - - [1653909914.972854][3424:3429] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9 DataVersion: 880539056 - [1653909914.973027][3424:3429] CHIP:TOO: AcceptedCommandList: 5 entries - [1653909914.973102][3424:3429] CHIP:TOO: [1]: 0 - [1653909914.973166][3424:3429] CHIP:TOO: [2]: 2 - [1653909914.973228][3424:3429] CHIP:TOO: [3]: 4 - [1653909914.973289][3424:3429] CHIP:TOO: [4]: 6 - [1653909914.973350][3424:3429] CHIP:TOO: [5]: 8 - [1653909914.973574][3424:3429] CHIP:EM: Sending Standalone Ack for MessageCounter:4589161 on exchange 55554i - - - (Ethernet) - ./chip-tool networkcommissioning read accepted-command-list 1 0 - - Verify "AcceptedCommandList" on the TH(Chip-tool) Log: - - [1660315536.068512][32327:32332] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9 DataVersion: 4034679103 - [1660315536.068654][32327:32332] CHIP:TOO: AcceptedCommandList: 0 entries - - (Thread) - ./chip-tool networkcommissioning read accepted-command-list 1 0 - - Verify "AcceptedCommandList" on the TH(Chip-tool) Log: - - [1660316038.564553][3121:3126] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF9 DataVersion: 1122474754 - [1660316038.564671][3121:3126] CHIP:TOO: AcceptedCommandList: 5 entries - [1660316038.564702][3121:3126] CHIP:TOO: [1]: 0 - [1660316038.564725][3121:3126] CHIP:TOO: [2]: 3 - [1660316038.564747][3121:3126] CHIP:TOO: [3]: 4 - [1660316038.564769][3121:3126] CHIP:TOO: [4]: 6 - [1660316038.564853][3121:3126] CHIP:TOO: [5]: 8 - [1660316038.564991][3121:3126] CHIP:EM: Sending Standalone Ack for MessageCounter:232731891 on exchange 30329i - disabled: true - - - label: "TH reads GeneratedCommandList from DUT" - verification: | - ( WiFi) - ./chip-tool networkcommissioning read generated-command-list 1 0 - - - Verify "GeneratedCommandList" on the TH(Chip-tool) Log: - - [1650370123.417759][42418:42423] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF8 DataVersion: 3182776035 - [1650370123.417866][42418:42423] CHIP:TOO: GeneratedCommandList: 3 entries - [1650370123.417938][42418:42423] CHIP:TOO: [1]: 1 - [1650370123.417977][42418:42423] CHIP:TOO: [2]: 5 - [1650370123.418013][42418:42423] CHIP:TOO: [3]: 7 - [1650370123.418143][42418:42423] CHIP:EM: Sending Standalone Ack for MessageCounter:759910 on exchange 25409i - - - - (Ethernet) - ./chip-tool networkcommissioning read generated-command-list 1 0 - - Verify "GeneratedCommandList" on the TH(Chip-tool) Log: - - [1660315548.937195][32333:32338] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF8 DataVersion: 4034679103 - [1660315548.937327][32333:32338] CHIP:TOO: GeneratedCommandList: 0 entries - - - ( Thread ) - ./chip-tool networkcommissioning read generated-command-list 51 0 - - - Verify "GeneratedCommandList" on the TH(Chip-tool) Log: - - [1650370342.693373][7450:7455] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0031 Attribute 0x0000_FFF8 DataVersion: 1032683896 - [1650370342.693536][7450:7455] CHIP:TOO: GeneratedCommandList: 2 entries - 1650370123.417938][42418:42423] CHIP:TOO: [1]: 1 - [1650370123.417977][42418:42423] CHIP:TOO: [2]: 5 - [1650370123.418013][42418:42423] CHIP:TOO: [3]: 7 - [1650370342.693995][7450:7455] CHIP:EM: Sending Standalone Ack for MessageCounter:2345375 on exchange 25146i - disabled: true - - - label: "NOTE" - verification: | - Repeat the test case by Commission DUT to TH on the Thread and - Ethernet setups - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Read the global attribute: ClusterRevision" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u + + - label: "Read the global attribute: FeatureMap" + PICS: " !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 " + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + + - label: "Read the global attribute: FeatureMap when CNET.S.F00 is set" + PICS: CNET.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 1 + + - label: "Read the global attribute: FeatureMap when CNET.S.F01 is set" + PICS: CNET.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 2 + + - label: "Read the global attribute: FeatureMap when CNET.S.F02 is set" + PICS: CNET.S.F02 + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 4 + + - label: "Read the global attribute: AttributeList" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] + + - label: + "Read mandatory attributes in AttributeList if + CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true" + PICS: CNET.S.F00 || CNET.S.F01 || CNET.S.F02 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1, 4, 5, 6, 7] + + - label: "Read the optional attribute(ScanMaxTimeSeconds): AttributeList" + PICS: CNET.S.A0002 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2] + + - label: + "Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList" + PICS: CNET.S.A0003 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [3] + + - label: + "Read AcceptedCommandList If DUT supports Wi-Fi/Thread related + features CNET.S.F00(WI),CNET.S.F01(TH)" + PICS: CNET.S.F00 || CNET.S.F01 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [0, 4, 6, 8] + + - label: + "Read AcceptedCommandList If DUT supports Wi-Fi related features + (CNET.S.F00(WI) is true)" + PICS: CNET.S.F00 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [2] + + - label: + "Read AcceptedCommandList If DUT supports Thread related + features(CNET.S.F01(TH) is true)" + PICS: CNET.S.F01 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [3] + + - label: + "Read AcceptedCommandList If DUT supports Ethernet related + features(CNET.S.F02(TH) is true)" + PICS: CNET.S.F02 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + + - label: + "Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related + features(CNET.S.F00(WI) or CNET.S.F01(TH) is true)" + PICS: CNET.S.F00 || CNET.S.F01 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + constraints: + type: list + contains: [1, 5, 7] + + - label: + "Read the GeneratedCommandList If DUT supports Ethernet related + features(CNET.S.F02(ET) must be true)" + PICS: CNET.S.F02 + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + #Commenting out the step EventList attribute which is out of scope for matter V1.0 + #- label: + # "Read EventList attribute from the DUT and Verify that the DUT + # response provides a list of supported events." + # verification: | + # Not implemented in chip-tool + # cluster: "LogCommands" + # command: "UserPrompt" + # PICS: PICS_USER_PROMPT + # arguments: + # values: + # - name: "message" + # value: "Please enter 'y' for success" + # - name: "expectedValue" + # value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml b/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml index 8f86d07f252121..e6d2e2a0ba58e9 100644 --- a/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGTHREAD_1_1.yaml @@ -536,7 +536,7 @@ tests: contains: [55] - label: "Read the optional attribute (ActiveTimestamp) in AttributeList" - PICS: DGTHREAD.S.A0039 + PICS: DGTHREAD.S.A0038 command: "readAttribute" attribute: "AttributeList" response: @@ -545,7 +545,7 @@ tests: contains: [56] - label: "Read the optional attribute (PendingTimestamp) in AttributeList" - PICS: DGTHREAD.S.A003A + PICS: DGTHREAD.S.A0039 command: "readAttribute" attribute: "AttributeList" response: @@ -554,7 +554,7 @@ tests: contains: [57] - label: "Read the optional attribute (Delay) in AttributeList" - PICS: DGTHREAD.S.A003B + PICS: DGTHREAD.S.A003a command: "readAttribute" attribute: "AttributeList" response: diff --git a/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml index a204f2abfa3943..269677250dae0d 100644 --- a/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml @@ -414,7 +414,7 @@ tests: type: int64u - label: "TH reads Delay attribute value from DUT" - PICS: DGTHREAD.S.A003A + PICS: DGTHREAD.S.A003a command: "readAttribute" attribute: "Delay" response: @@ -441,7 +441,7 @@ tests: [1649825860.867921][3472:3477] CHIP:TOO: } cluster: "LogCommands" command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGTHREAD.S.A003B + PICS: PICS_USER_PROMPT && DGTHREAD.S.A003b arguments: values: - name: "message" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml index bffd1db40b6a6d..1761022dd8014e 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml @@ -11,196 +11,146 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 116.2.6. [TC-DRLK-2.6] Verification for the following Commands - Set Holiday - Schedule, Get Holiday Schedule, Get Holiday Schedule Response , Clear - Holiday Schedule [DUT-Server] + 111.2.7. [TC-DRLK-2.6] Verification for the following Commands - Set Year + Schedule, Get Year Schedule, Get Year Day Schedule Response and Clear Year + Day Schedule[DUT-Server] PICS: - DRLK.S config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Door Lock" + endpoint: 1 tests: - - label: "Pre-Conditions" - verification: | - DUT as server - disabled: true + - label: "Wait for commissionee" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "TH reads NumberOfHoliday SchedulesSupported and saves for future use." PICS: DRLK.S.F0b && DRLK.S.A0016 - verification: | - ./chip-tool doorlock read number-of-holiday-schedules-supported 1 1 - Verify " NumberOfHoliDay SchedulesSuppored" on the TH(Chip-tool) Log: - - [1654691068.446440][4655:4660] CHIP:DMG: - [1654691068.446465][4655:4660] CHIP:DMG: SuppressResponse = true, - [1654691068.446492][4655:4660] CHIP:DMG: InteractionModelRevision = 1 - [1654691068.446515][4655:4660] CHIP:DMG: } - [1654691068.446648][4655:4660] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Attribute 0x0000_0016 DataVersion: 1413324060 - [1654691068.446726][4655:4660] CHIP:TOO: NumberOfHolidaySchedulesSupported: 10 - disabled: true - - - label: - "TH sends Set Holiday Schedule Command to DUT with the following - values: HolidayIndex as 1 LocalStartTime as 20 Seconds LocalEndTime as - 30 Seconds OperatingMode as 0" + command: "readAttribute" + attribute: "NumberOfHolidaySchedulesSupported" + response: + saveAs: NumberOfHolidaySchedulesSupported + constraints: + minValue: 0 + maxValue: 255 + + - label: "Create Holiday schedule with 1 index" PICS: DRLK.S.F0b && DRLK.S.C11.Rsp - verification: | - ./chip-tool doorlock set-holiday-schedule 1 20 30 0 1 1 - Verify " DUT send SUCCESS response." on the TH(Chip-tool) Log: - - [1654691200.905091][4669:4674] CHIP:DMG: StatusIB = - [1654691200.905122][4669:4674] CHIP:DMG: { - [1654691200.905162][4669:4674] CHIP:DMG: status = 0x00 (SUCCESS), - [1654691200.905198][4669:4674] CHIP:DMG: }, - [1654691200.905236][4669:4674] CHIP:DMG: - [1654691200.905266][4669:4674] CHIP:DMG: }, - [1654691200.905301][4669:4674] CHIP:DMG: - [1654691200.905326][4669:4674] CHIP:DMG: }, - [1654691200.905356][4669:4674] CHIP:DMG: - [1654691200.905380][4669:4674] CHIP:DMG: ], - [1654691200.905410][4669:4674] CHIP:DMG: - [1654691200.905434][4669:4674] CHIP:DMG: InteractionModelRevision = 1 - [1654691200.905463][4669:4674] CHIP:DMG: }, - disabled: true - - - label: - "TH sends Get Holiday Schedule Command to DUT with HolidayIndex as 1" + command: "SetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + - name: "localStartTime" + value: 20 + - name: "localEndTime" + value: 30 + - name: "operatingMode" + value: 0 + + - label: "Get Holiday Schedule with HolidayIndex as 1" PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 1 1 1 - Verify " DUT responds with Get Holiday Schedule Response" on the TH(Chip-tool) Log: - - [1654691299.545647][4678:4683] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1654691299.545701][4678:4683] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1654691299.545769][4678:4683] CHIP:TOO: GetHolidayScheduleResponse: { - [1654691299.545807][4678:4683] CHIP:TOO: holidayIndex: 1 - [1654691299.545830][4678:4683] CHIP:TOO: status: 0 - [1654691299.545853][4678:4683] CHIP:TOO: localStartTime: 20 - [1654691299.545876][4678:4683] CHIP:TOO: localEndTime: 30 - [1654691299.545898][4678:4683] CHIP:TOO: operatingMode: 0 - [1654691299.545922][4678:4683] CHIP:TOO: } - disabled: true - - - label: - "TH sends Set Holiday Schedule Command to DUT with the following - values: HolidayIndex as 1 LocalStartTime as 20 LocalEndTime as 30 - OperatingMode as 5(Invalid value)" + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + response: + values: + - name: "holidayIndex" + value: 1 + - name: "status" + value: 0x0 + - name: "localStartTime" + value: 20 + - name: "localEndTime" + value: 30 + constraints: + minValue: 21 + - name: "operatingMode" + value: 0 + + - label: "Create Holiday schedule with invalid operating mode" PICS: DRLK.S.C11.Rsp - verification: | - ./chip-tool doorlock set-holiday-schedule 1 20 30 5 1 1 - Verify " DUT sends INVALID_COMMAND response" on the TH(Chip-tool) Log: - - [1655373066.616542][2571:2576] CHIP:DMG: { - [1655373066.616583][2571:2576] CHIP:DMG: suppressResponse = false, - [1655373066.616624][2571:2576] CHIP:DMG: InvokeResponseIBs = - [1655373066.616692][2571:2576] CHIP:DMG: [ - [1655373066.616732][2571:2576] CHIP:DMG: InvokeResponseIB = - [1655373066.616799][2571:2576] CHIP:DMG: { - [1655373066.616854][2571:2576] CHIP:DMG: CommandStatusIB = - [1655373066.616913][2571:2576] CHIP:DMG: { - [1655373066.616981][2571:2576] CHIP:DMG: CommandPathIB = - [1655373066.617046][2571:2576] CHIP:DMG: { - [1655373066.617118][2571:2576] CHIP:DMG: EndpointId = 0x1, - [1655373066.617200][2571:2576] CHIP:DMG: ClusterId = 0x101, - [1655373066.617264][2571:2576] CHIP:DMG: CommandId = 0x11, - [1655373066.617338][2571:2576] CHIP:DMG: }, - [1655373066.617412][2571:2576] CHIP:DMG: - [1655373066.617463][2571:2576] CHIP:DMG: StatusIB = - [1655373066.617538][2571:2576] CHIP:DMG: { - [1655373066.617612][2571:2576] CHIP:DMG: status = 0x85 (INVALID_COMMAND), - [1655373066.617672][2571:2576] CHIP:DMG: }, - [1655373066.617745][2571:2576] CHIP:DMG: - [1655373066.617806][2571:2576] CHIP:DMG: }, - [1655373066.617863][2571:2576] CHIP:DMG: - [1655373066.617921][2571:2576] CHIP:DMG: }, - [1655373066.617970][2571:2576] CHIP:DMG: - [1655373066.618024][2571:2576] CHIP:DMG: ], - [1655373066.618073][2571:2576] CHIP:DMG: - [1655373066.618127][2571:2576] CHIP:DMG: InteractionModelRevision = 1 - [1655373066.618166][2571:2576] CHIP:DMG: }, - disabled: true - - - label: - "TH sends Get Holiday Schedule Command to DUT with Invalid - HolidayIndex as 15." + command: "SetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + - name: "localStartTime" + value: 20 + - name: "localEndTime" + value: 30 + - name: "operatingMode" + value: 5 + response: + error: INVALID_COMMAND + + - label: "Get Holiday Schedule with Invalid HolidayIndex 15." PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 15 1 1 - Verify " DUT sends INVALID_COMMAND response" on the TH(Chip-tool) Log: - - [1654691634.513667][4728:4733] CHIP:DMG: }, - [1654691634.513979][4728:4733] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1654691634.514168][4728:4733] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1658471936.478043][2537:2542] CHIP:DMG: }, - [1658471936.478124][2537:2542] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1658471936.478183][2537:2542] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1658471936.478270][2537:2542] CHIP:TOO: GetHolidayScheduleResponse: { - [1658471936.478316][2537:2542] CHIP:TOO: holidayIndex: 15 - [1658471936.478363][2537:2542] CHIP:TOO: status: 133 - [1658471936.478395][2537:2542] CHIP:TOO: } - [1654691634.514670][4728:4733] CHIP:TOO: } - disabled: true - - - label: - "TH sends Get Holiday Schedule Command to DUT with the HolidayIndex as - 10 (value is in the the range of step 1 but Holiday Schedule entry not - available)" + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 15 + response: + values: + - name: "holidayIndex" + value: 15 + - name: "status" + value: 133 + + - label: "Get Holiday Schedule with the Non-scheduled HolidayIndex" PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 10 1 1 - Verify " DUT sends a NOT_FOUND status" on the TH(Chip-tool) Log: - - [1654691928.900652][4772:4777] CHIP:DMG: }, - [1654691928.900762][4772:4777] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1654691928.900844][4772:4777] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1654691928.900944][4772:4777] CHIP:TOO: GetHolidayScheduleResponse: { - [1654691928.901003][4772:4777] CHIP:TOO: holidayIndex: 10 - [1654691928.901047][4772:4777] CHIP:TOO: status: 139 - [1654691928.901093][4772:4777] CHIP:TOO: } - disabled: true - - - label: - "TH send Clear Holiday Schedule Command to DUT with HolidayIndex as 1" + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 10 + response: + values: + - name: "holidayIndex" + value: 10 + - name: "status" + value: 139 + + - label: "Clear Holiday schedule with 1 index" PICS: DRLK.S.F0b && DRLK.S.C13.Rsp - verification: | - ./chip-tool doorlock clear-holiday-schedule 1 1 1 - Verify " DUT sends SUCCESS response" on the TH(Chip-tool) Log: - - [1654692125.827938][4791:4796] CHIP:DMG: StatusIB = - [1654692125.828009][4791:4796] CHIP:DMG: { - [1654692125.828080][4791:4796] CHIP:DMG: status = 0x00 (SUCCESS), - [1654692125.828156][4791:4796] CHIP:DMG: }, - [1654692125.828233][4791:4796] CHIP:DMG: - [1654692125.828296][4791:4796] CHIP:DMG: }, - [1654692125.828367][4791:4796] CHIP:DMG: - [1654692125.828424][4791:4796] CHIP:DMG: }, - [1654692125.828488][4791:4796] CHIP:DMG: - [1654692125.828538][4791:4796] CHIP:DMG: ], - [1654692125.828601][4791:4796] CHIP:DMG: - [1654692125.828652][4791:4796] CHIP:DMG: InteractionModelRevision = 1 - [1654692125.828701][4791:4796] CHIP:DMG: }, - disabled: true + command: "ClearHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 - - label: - "TH sends Get Holiday Schedule Command to DUT with HolidayIndex as 1." + - label: "Make sure that holiday schedule was deleted" PICS: DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx - verification: | - ./chip-tool doorlock get-holiday-schedule 1 1 1 - Verify " DUT sends a NOT_FOUND status" on the TH(Chip-tool) Log: - - [1658472025.923305][2560:2565] CHIP:DMG: }, - [1658472025.923366][2560:2565] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1658472025.923417][2560:2565] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0101 Command 0x0000_0012 - [1658472025.923491][2560:2565] CHIP:TOO: GetHolidayScheduleResponse: { - [1658472025.923528][2560:2565] CHIP:TOO: holidayIndex: 1 - [1658472025.923565][2560:2565] CHIP:TOO: status: 139 - [1658472025.923590][2560:2565] CHIP:TOO: } - disabled: true + command: "GetHolidaySchedule" + arguments: + values: + - name: "holidayIndex" + value: 1 + response: + values: + - name: "holidayIndex" + value: 1 + - name: "status" + value: 139 + + - label: "Cleanup the created user" + command: "ClearUser" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "userIndex" + value: 1 diff --git a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml index 3ad64bad5263c0..ade30fa0aa5996 100644 --- a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_4_1.yaml @@ -20,62 +20,32 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic" - endpoint: 0 + cluster: "Wake on LAN" + endpoint: 1 tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "TH reads the MACAddress attribute from the DUT" PICS: WAKEONLAN.S.A0000 - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool wakeonlan read macaddress 1 1 - ./chip-tv-casting-app wakeonlan read macaddress 1 1 - - On TH Verify that the response contains a 48-bit MAC Address. Record the MAC address. - [1654248817.394846][3637:3643] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0503 Attribute 0x0000_0000 DataVersion: 3900236652 - [1654248817.394895][3637:3643] CHIP:TOO: MACAddress: e4:5f:01:69:61:b1 - [1654248817.394982][3637:3643] CHIP:EM: Sending Standalone Ack for MessageCounter:15292555 on exchange 12123i - disabled: true + command: "readAttribute" + attribute: "MACAddress" + response: + constraints: + minLength: 12 - label: "TH sends a Sleep command to DUT" PICS: LOWPOWER.S.C00.Rsp - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool lowpower sleep 1 1 - ./chip-tv-casting-app lowpower sleep 1 1 - - On TH verify the success response received from DUT - [1646101689.826629][3009:3014] CHIP:DMG: InvokeResponseMessage = - [1646101689.826665][3009:3014] CHIP:DMG: { - [1646101689.826697][3009:3014] CHIP:DMG: suppressResponse = false, - [1646101689.826727][3009:3014] CHIP:DMG: InvokeResponseIBs = - [1646101689.826769][3009:3014] CHIP:DMG: [ - [1646101689.826804][3009:3014] CHIP:DMG: InvokeResponseIB = - [1646101689.826848][3009:3014] CHIP:DMG: { - [1646101689.826882][3009:3014] CHIP:DMG: CommandStatusIB = - [1646101689.826922][3009:3014] CHIP:DMG: { - [1646101689.826954][3009:3014] CHIP:DMG: CommandPathIB = - [1646101689.826989][3009:3014] CHIP:DMG: { - [1646101689.827031][3009:3014] CHIP:DMG: EndpointId = 0x1, - [1646101689.827082][3009:3014] CHIP:DMG: ClusterId = 0x508, - [1646101689.827127][3009:3014] CHIP:DMG: CommandId = 0x0, - [1646101689.827172][3009:3014] CHIP:DMG: }, - [1646101689.827223][3009:3014] CHIP:DMG: - [1646101689.827260][3009:3014] CHIP:DMG: StatusIB = - [1646101689.827311][3009:3014] CHIP:DMG: { - [1646101689.827360][3009:3014] CHIP:DMG: status = 0x0, - [1646101689.827411][3009:3014] CHIP:DMG: }, - [1646101689.827457][3009:3014] CHIP:DMG: - [1646101689.827498][3009:3014] CHIP:DMG: }, - [1646101689.827540][3009:3014] CHIP:DMG: - [1646101689.827607][3009:3014] CHIP:DMG: }, - [1646101689.827658][3009:3014] CHIP:DMG: - [1646101689.827689][3009:3014] CHIP:DMG: ], - [1646101689.827730][3009:3014] CHIP:DMG: - [1646101689.827761][3009:3014] CHIP:DMG: InteractionModelRevision = 1 - [1646101689.827792][3009:3014] CHIP:DMG: }, - [1646101689.827875][3009:3014] CHIP:DMG: Received Command Response Status for Endpoint=1 Cluster=0x0000_0508 Command=0x0000_0000 Status=0x0 - disabled: true + cluster: "Low Power" + command: "Sleep" + response: + error: 0 - label: "TH sends a Wake-On LAN magic packet containing the MAC address from @@ -90,4 +60,12 @@ tests: [1654248854.491994][3652:3657] CHIP:TOO: AcceptedCommandList: 1 entries [1654248854.492040][3652:3657] CHIP:TOO: [1]: 0 [1654248854.492157][3652:3657] CHIP:EM: Sending Standalone Ack for MessageCounter:15063522 on exchange 51389i - disabled: true + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index f7ea6ee0e55372..5c616c535dd52d 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1033,8 +1033,8 @@ DGTHREAD.S.A0036=1 DGTHREAD.S.A0037=1 DGTHREAD.S.A0038=1 DGTHREAD.S.A0039=1 -DGTHREAD.S.A003A=1 -DGTHREAD.S.A003B=1 +DGTHREAD.S.A003a=1 +DGTHREAD.S.A003b=1 DGTHREAD.S.A003c=1 DGTHREAD.S.A003d=1 DGTHREAD.S.A003e=1 @@ -1358,6 +1358,11 @@ CNET.S.A0005=1 CNET.S.A0006=1 CNET.S.A0007=1 +#Features +CNET.S.F00=0 +CNET.S.F01=0 +CNET.S.F02=1 + #Server Commands CNET.S.C00.Rsp=1 CNET.S.C01.Tx=1 @@ -1573,26 +1578,26 @@ MCORE.SC.ADV=1 #Bridged Device Basic Information #server -BRBINFO.S.A0000=1 -BRBINFO.S.A0001=1 -BRBINFO.S.A0002=1 -BRBINFO.S.A0003=1 -BRBINFO.S.A0004=1 +BRBINFO.S.A0000=0 +BRBINFO.S.A0001=0 +BRBINFO.S.A0002=0 +BRBINFO.S.A0003=0 +BRBINFO.S.A0004=0 BRBINFO.S.A0005=1 -BRBINFO.S.A0006=1 -BRBINFO.S.A0007=1 -BRBINFO.S.A0008=1 -BRBINFO.S.A0009=1 -BRBINFO.S.A000a=1 -BRBINFO.S.A000b=1 -BRBINFO.S.A000c=1 -BRBINFO.S.A000d=1 -BRBINFO.S.A000e=1 -BRBINFO.S.A000f=1 -BRBINFO.S.A0010=1 +BRBINFO.S.A0006=0 +BRBINFO.S.A0007=0 +BRBINFO.S.A0008=0 +BRBINFO.S.A0009=0 +BRBINFO.S.A000a=0 +BRBINFO.S.A000b=0 +BRBINFO.S.A000c=0 +BRBINFO.S.A000d=0 +BRBINFO.S.A000e=0 +BRBINFO.S.A000f=0 +BRBINFO.S.A0010=0 BRBINFO.S.A0011=1 -BRBINFO.S.A0012=1 -BRBINFO.S.A0013=1 +BRBINFO.S.A0012=0 +BRBINFO.S.A0013=0 #Events BRBINFO.S.E00=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 58a3bd5145cb3c..8e02636bd76894 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -3,10 +3,15 @@ "TestAccessControlCluster", "Test_TC_ACL_1_1", "Test_TC_ACL_2_1", - "Test_TC_ACL_2_2" + "Test_TC_ACL_2_2", + "Test_TC_ACL_2_3" ], "BooleanState": ["Test_TC_BOOL_1_1", "Test_TC_BOOL_2_1"], "Binding": ["Test_TC_BIND_1_1"], + "BridgedDeviceBasicInformation": [ + "Test_TC_BRBINFO_1_1", + "Test_TC_BRBINFO_2_1" + ], "Actions": ["Test_TC_ACT_1_1"], "ColorControl": [ "Test_TC_CC_1_1", @@ -90,6 +95,7 @@ "Test_TC_APBSC_1_10", "Test_TC_CONTENTLAUNCHER_1_11", "Test_TC_ALOGIN_1_12", + "Test_TC_ALOGIN_12_1", "Test_TC_LOWPOWER_2_1", "Test_TC_KEYPADINPUT_3_2", "Test_TC_KEYPADINPUT_3_3", @@ -102,6 +108,7 @@ "Test_TC_MEDIAINPUT_3_11", "Test_TC_MEDIAINPUT_3_12", "Test_TC_MEDIAINPUT_3_13", + "Test_TC_WAKEONLAN_4_1", "Test_TC_CHANNEL_5_1", "Test_TC_CHANNEL_5_2", "Test_TC_CHANNEL_5_3", @@ -240,6 +247,7 @@ "Test_TC_DRLK_2_3", "Test_TC_DRLK_2_4", "Test_TC_DRLK_2_5", + "Test_TC_DRLK_2_6", "Test_TC_DRLK_2_7", "Test_TC_DRLK_2_9" ], @@ -253,6 +261,7 @@ "collection": [ "AccessControl", "BooleanState", + "BridgedDeviceBasicInformation", "Actions", "Binding", "ColorControl", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index fb755f1f72b12e..1835bb8cf21eac 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -137,7 +137,6 @@ "Test_TC_MEDIAINPUT_3_15", "Test_TC_MEDIAINPUT_3_16", "Test_TC_MEDIAINPUT_3_17", - "Test_TC_WAKEONLAN_4_1", "Test_TC_CHANNEL_5_4", "Test_TC_CHANNEL_5_5", "Test_TC_CHANNEL_5_6", @@ -152,7 +151,6 @@ "Test_TC_CONTENTLAUNCHER_10_7", "Test_TC_MC_11_1", "Test_TC_MC_11_2", - "Test_TC_ALOGIN_12_1", "Test_TC_ALOGIN_12_2" ], "MultipleFabrics": [ @@ -277,7 +275,6 @@ ], "DoorLock": [ "Test_TC_DRLK_2_1", - "Test_TC_DRLK_2_6", "Test_TC_DRLK_2_8", "Test_TC_DRLK_2_10", "Test_TC_DRLK_3_1", @@ -327,7 +324,6 @@ ], "PumpConfigurationControl": ["Test_TC_PCC_3_1"], "AccessControl": [ - "Test_TC_ACL_2_3", "Test_TC_ACL_2_4", "Test_TC_ACL_2_5", "Test_TC_ACL_2_6", @@ -338,8 +334,6 @@ ], "UserLabel": ["Test_TC_ULABEL_3_1"], "BridgedDeviceBasicInformation": [ - "Test_TC_BRBINFO_1_1", - "Test_TC_BRBINFO_2_1", "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_2_3" ], diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 796a968a9bbed7..c3d4aa04ac2527 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -39,8 +39,11 @@ class TestList : public Command printf("Test_TC_ACL_1_1\n"); printf("Test_TC_ACL_2_1\n"); printf("Test_TC_ACL_2_2\n"); + printf("Test_TC_ACL_2_3\n"); printf("Test_TC_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRBINFO_1_1\n"); + printf("Test_TC_BRBINFO_2_1\n"); printf("Test_TC_ACT_1_1\n"); printf("Test_TC_BIND_1_1\n"); printf("Test_TC_CC_1_1\n"); @@ -108,6 +111,7 @@ class TestList : public Command printf("Test_TC_APBSC_1_10\n"); printf("Test_TC_CONTENTLAUNCHER_1_11\n"); printf("Test_TC_ALOGIN_1_12\n"); + printf("Test_TC_ALOGIN_12_1\n"); printf("Test_TC_LOWPOWER_2_1\n"); printf("Test_TC_KEYPADINPUT_3_2\n"); printf("Test_TC_KEYPADINPUT_3_3\n"); @@ -120,6 +124,7 @@ class TestList : public Command printf("Test_TC_MEDIAINPUT_3_11\n"); printf("Test_TC_MEDIAINPUT_3_12\n"); printf("Test_TC_MEDIAINPUT_3_13\n"); + printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_CHANNEL_5_1\n"); printf("Test_TC_CHANNEL_5_2\n"); printf("Test_TC_CHANNEL_5_3\n"); @@ -244,6 +249,7 @@ class TestList : public Command printf("Test_TC_DRLK_2_3\n"); printf("Test_TC_DRLK_2_4\n"); printf("Test_TC_DRLK_2_5\n"); + printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_7\n"); printf("Test_TC_DRLK_2_9\n"); printf("TestGroupMessaging\n"); @@ -390,7 +396,6 @@ class ManualTestList : public Command printf("Test_TC_MEDIAINPUT_3_15\n"); printf("Test_TC_MEDIAINPUT_3_16\n"); printf("Test_TC_MEDIAINPUT_3_17\n"); - printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_CHANNEL_5_4\n"); printf("Test_TC_CHANNEL_5_5\n"); printf("Test_TC_CHANNEL_5_6\n"); @@ -405,7 +410,6 @@ class ManualTestList : public Command printf("Test_TC_CONTENTLAUNCHER_10_7\n"); printf("Test_TC_MC_11_1\n"); printf("Test_TC_MC_11_2\n"); - printf("Test_TC_ALOGIN_12_1\n"); printf("Test_TC_ALOGIN_12_2\n"); printf("Test_TC_CADMIN_1_1\n"); printf("Test_TC_CADMIN_1_2\n"); @@ -517,7 +521,6 @@ class ManualTestList : public Command printf("Test_TC_CC_9_2\n"); printf("Test_TC_CC_9_3\n"); printf("Test_TC_DRLK_2_1\n"); - printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_8\n"); printf("Test_TC_DRLK_2_10\n"); printf("Test_TC_DRLK_3_1\n"); @@ -567,7 +570,6 @@ class ManualTestList : public Command printf("Test_TC_S_2_3\n"); printf("Test_TC_S_3_1\n"); printf("Test_TC_PCC_3_1\n"); - printf("Test_TC_ACL_2_3\n"); printf("Test_TC_ACL_2_4\n"); printf("Test_TC_ACL_2_5\n"); printf("Test_TC_ACL_2_6\n"); @@ -576,8 +578,6 @@ class ManualTestList : public Command printf("Test_TC_ACL_2_9\n"); printf("Test_TC_ACL_2_10\n"); printf("Test_TC_ULABEL_3_1\n"); - printf("Test_TC_BRBINFO_1_1\n"); - printf("Test_TC_BRBINFO_2_1\n"); printf("Test_TC_BRBINFO_2_2\n"); printf("Test_TC_BRBINFO_2_3\n"); printf("Test_TC_ACE_1_1\n"); @@ -2264,18 +2264,28 @@ class Test_TC_ACL_2_2Suite : public TestCommand } }; -class Test_TC_BOOL_1_1Suite : public TestCommand +class Test_TC_ACL_2_3Suite : public TestCommand { public: - Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) + Test_TC_ACL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_3", 20, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("D_OK_FULL", &mDOkFull); + AddArgument("D_BAD_LENGTH", &mDBadLength); + AddArgument("D_BAD_STRUCT", &mDBadStruct); + AddArgument("D_BAD_LIST", &mDBadList); + AddArgument("D_BAD_ELEM", &mDBadElem); + AddArgument("D_BAD_OVERFLOW", &mDBadOverflow); + AddArgument("D_BAD_UNDERFLOW", &mDBadUnderflow); + AddArgument("D_BAD_NONE", &mDBadNone); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_1_1Suite() {} + ~Test_TC_ACL_2_3Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -2286,8 +2296,20 @@ class Test_TC_BOOL_1_1Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mDOkFull; + chip::Optional mDBadLength; + chip::Optional mDBadStruct; + chip::Optional mDBadList; + chip::Optional mDBadElem; + chip::Optional mDBadOverflow; + chip::Optional mDBadUnderflow; + chip::Optional mDBadNone; chip::Optional mTimeout; + uint8_t CurrentFabricIndex; + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } // @@ -2307,57 +2329,154 @@ class Test_TC_BOOL_1_1Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint16_t value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); - VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + CurrentFabricIndex = value; } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - uint32_t value; + chip::app::DataModel::DecodableList + value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("featureMap", value, 0UL)); - VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 0)); + } } break; case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList + value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "list", "list")); - VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } } break; - case 4: + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList + value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); { auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64" + "\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65" + "\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63" + "\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 5: + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::app::DataModel::DecodableList + value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); { auto iter_0 = value.begin(); - VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkFull.HasValue() + ? mDOkFull.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74" + "\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67" + "\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74" + "\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 128))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNextListItemDecodes("extension", iter_0, 0)); + VerifyOrReturn(CheckValueAsString( + "extension[0].data", iter_0.GetValue().data, + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2))); + VerifyOrReturn(CheckValue("extension[0].fabricIndex", iter_0.GetValue().fabricIndex, CurrentFabricIndex)); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 1)); + } + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("extension", iter_0, 0)); } - VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; default: @@ -2383,39 +2502,382 @@ class Test_TC_BOOL_1_1Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id, - true, chip::NullOptional); + LogStep(1, "TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), OperationalCredentials::Id, + OperationalCredentials::Attributes::CurrentFabricIndex::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Read the global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::FeatureMap::Id, true, + LogStep(2, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, chip::NullOptional); } case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id, - true, chip::NullOptional); + LogStep(3, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, - BooleanState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + LogStep(4, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); } case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, - BooleanState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + LogStep(5, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 6: { + LogStep(6, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 7: { + LogStep(7, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656" + "C656D656E7420616761696E2E2E2E2E2E0018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDOkFull.HasValue() + ? mDOkFull.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 128); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 8: { + LogStep(8, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 9: { + LogStep(9, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656" + "C656D656E7420616761696E2E2E2E2E2E2E0018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadLength.HasValue() + ? mDBadLength.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20" + "\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65" + "\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72" + "\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x32\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C" + "\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C" + "\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18"), + 129); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDBadStruct.HasValue() ? mDBadStruct.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x15\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 11: { + LogStep(11, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + ":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672" + "0617320612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadList.HasValue() + ? mDBadList.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x37\x01\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69" + "\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 72); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 12: { + LogStep(12, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + ":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206173206120636" + "86172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadElem.HasValue() + ? mDBadElem.Value() + : chip::ByteSpan(chip::Uint8::from_const_char( + "\x17\x10\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69" + "\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 65); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 13: { + LogStep(13, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_OVERFLOW : " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061" + "7320612063686172737472696E670018FF"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadOverflow.HasValue() + ? mDBadOverflow.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18\xFF"), + 72); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 14: { + LogStep(14, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_UNDERFLOW " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E67206" + "17320612063686172737472696E6700"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = mDBadUnderflow.HasValue() + ? mDBadUnderflow.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00"), + 70); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 15: { + LogStep(15, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(1); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDBadNone.HasValue() ? mDBadNone.Value() : chip::ByteSpan(chip::Uint8::from_const_char(""), 0); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 1); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 16: { + LogStep( + 16, + "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 2 elements . value is list of AccessControlExtensionStruct containing 2 " + "elements . first element contains Data field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + { + auto * listHolder_0 = new ListHolder(2); + listFreer.add(listHolder_0); + + listHolder_0->mList[0].data = + mDOkEmpty.HasValue() ? mDOkEmpty.Value() : chip::ByteSpan(chip::Uint8::from_const_char("\x17\x18"), 2); + listHolder_0->mList[0].fabricIndex = CurrentFabricIndex; + + listHolder_0->mList[1].data = mDOkSingle.HasValue() + ? mDOkSingle.Value() + : chip::ByteSpan( + chip::Uint8::from_const_char( + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69" + "\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76" + "\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18"), + 71); + listHolder_0->mList[1].fabricIndex = CurrentFabricIndex; + + value = chip::app::DataModel::List( + listHolder_0->mList, 2); + } + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 17: { + LogStep(17, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); + } + case 18: { + LogStep(18, "TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty list"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::DataModel::List value; + + value = chip::app::DataModel::List(); + return WriteAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, + value, chip::NullOptional, chip::NullOptional); + } + case 19: { + LogStep(19, "TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute"); + VerifyOrDo(!ShouldSkip("ACL.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), AccessControl::Id, AccessControl::Attributes::Extension::Id, true, + chip::NullOptional); } } return CHIP_NO_ERROR; } }; -class Test_TC_BOOL_2_1Suite : public TestCommand +class Test_TC_BOOL_1_1Suite : public TestCommand { public: - Test_TC_BOOL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_1", 2, credsIssuerConfig) + Test_TC_BOOL_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_1_1", 6, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -2423,7 +2885,155 @@ class Test_TC_BOOL_2_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_BOOL_2_1Suite() {} + ~Test_TC_BOOL_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, BooleanState::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, + BooleanState::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), BooleanState::Id, + BooleanState::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BOOL_2_1Suite : public TestCommand +{ +public: + Test_TC_BOOL_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_BOOL_2_1", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BOOL_2_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -2493,6 +3103,1281 @@ class Test_TC_BOOL_2_1Suite : public TestCommand } }; +class Test_TC_BRBINFO_1_1Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_1_1", 20, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_1_1Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 17UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 9UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 10UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 11UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 12UL)); + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 13UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 14UL)); + } + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 15UL)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 18UL)); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads the ClusterRevision from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH reads the FeatureMap from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads AttributeList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads optional attribute(VendorName) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "TH reads optional attribute(VendorID) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "TH reads optional attribute(ProductName) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads optional attribute(NodeLabel) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads optional attribute(HardwareVersion) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH reads optional attribute(HardwareVersionString) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads optional attribute(SoftwareVersion) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads optional attribute(SoftwareVersionString) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH reads optional attribute(ManufacturingDate) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "TH reads optional attribute(PartNumber) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, "TH reads optional attribute(ProductURL) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH reads optional attribute(ProductLabel) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads optional attribute(SerialNumber) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads optional attribute(UniqueID) in AttributeList"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "TH1 reads AcceptedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 19: { + LogStep(19, "TH1 reads GeneratedCommandList from DUT"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_2_1Suite : public TestCommand +{ +public: + Test_TC_BRBINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_BRBINFO_2_1", 50, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_BRBINFO_2_1Suite() + { + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + VendorNameValueBuffer = nullptr; + } + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + ProductNameValueBuffer = nullptr; + } + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + NodeLabelValueBuffer = nullptr; + } + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + HardwareVersionStringValueBuffer = nullptr; + } + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + SoftwareVersionStringValueBuffer = nullptr; + } + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + ManufacturingDateValueBuffer = nullptr; + } + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + PartNumberValueBuffer = nullptr; + } + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + ProductURLValueBuffer = nullptr; + } + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + ProductLabelValueBuffer = nullptr; + } + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + SerialNumberValueBuffer = nullptr; + } + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + UniqueIDValueBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + char * VendorNameValueBuffer = nullptr; + chip::CharSpan VendorNameValue; + chip::VendorId VendorIDValue; + char * ProductNameValueBuffer = nullptr; + chip::CharSpan ProductNameValue; + char * NodeLabelValueBuffer = nullptr; + chip::CharSpan NodeLabelValue; + uint16_t HardwareVersionValue; + char * HardwareVersionStringValueBuffer = nullptr; + chip::CharSpan HardwareVersionStringValue; + uint32_t SoftwareVersionValue; + char * SoftwareVersionStringValueBuffer = nullptr; + chip::CharSpan SoftwareVersionStringValue; + char * ManufacturingDateValueBuffer = nullptr; + chip::CharSpan ManufacturingDateValue; + char * PartNumberValueBuffer = nullptr; + chip::CharSpan PartNumberValue; + char * ProductURLValueBuffer = nullptr; + chip::CharSpan ProductURLValue; + char * ProductLabelValueBuffer = nullptr; + chip::CharSpan ProductLabelValue; + char * SerialNumberValueBuffer = nullptr; + chip::CharSpan SerialNumberValue; + char * UniqueIDValueBuffer = nullptr; + chip::CharSpan UniqueIDValue; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (VendorNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(VendorNameValueBuffer); + } + VendorNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(VendorNameValueBuffer, value.data(), value.size()); + VendorNameValue = chip::CharSpan(VendorNameValueBuffer, value.size()); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("vendorName", value, VendorNameValue)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "vendor_id", "vendor_id")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 1U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65521U)); + VendorIDValue = value; + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::VendorId value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("vendorID", value, VendorIDValue)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (ProductNameValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductNameValueBuffer); + } + ProductNameValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductNameValueBuffer, value.data(), value.size()); + ProductNameValue = chip::CharSpan(ProductNameValueBuffer, value.size()); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productName", value, ProductNameValue)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (NodeLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(NodeLabelValueBuffer); + } + NodeLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(NodeLabelValueBuffer, value.data(), value.size()); + NodeLabelValue = chip::CharSpan(NodeLabelValueBuffer, value.size()); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 65534U)); + HardwareVersionValue = value; + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("hardwareVersion", value, HardwareVersionValue)); + } + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (HardwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(HardwareVersionStringValueBuffer); + } + HardwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(HardwareVersionStringValueBuffer, value.data(), value.size()); + HardwareVersionStringValue = chip::CharSpan(HardwareVersionStringValueBuffer, value.size()); + } + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("hardwareVersionString", value, HardwareVersionStringValue)); + } + break; + case 20: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0UL)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 4294967294UL)); + SoftwareVersionValue = value; + } + break; + case 21: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 22: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("softwareVersion", value, SoftwareVersionValue)); + } + break; + case 23: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 1)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (SoftwareVersionStringValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SoftwareVersionStringValueBuffer); + } + SoftwareVersionStringValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SoftwareVersionStringValueBuffer, value.data(), value.size()); + SoftwareVersionStringValue = chip::CharSpan(SoftwareVersionStringValueBuffer, value.size()); + } + break; + case 24: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 25: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("softwareVersionString", value, SoftwareVersionStringValue)); + } + break; + case 26: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMinLength("value", value, 8)); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 16)); + if (ManufacturingDateValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ManufacturingDateValueBuffer); + } + ManufacturingDateValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ManufacturingDateValueBuffer, value.data(), value.size()); + ManufacturingDateValue = chip::CharSpan(ManufacturingDateValueBuffer, value.size()); + } + break; + case 27: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 28: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 29: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("manufacturingDate", value, ManufacturingDateValue)); + } + break; + case 30: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (PartNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(PartNumberValueBuffer); + } + PartNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(PartNumberValueBuffer, value.data(), value.size()); + PartNumberValue = chip::CharSpan(PartNumberValueBuffer, value.size()); + } + break; + case 31: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 32: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("partNumber", value, PartNumberValue)); + } + break; + case 33: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "long_char_string", "long_char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 256)); + if (ProductURLValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductURLValueBuffer); + } + ProductURLValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductURLValueBuffer, value.data(), value.size()); + ProductURLValue = chip::CharSpan(ProductURLValueBuffer, value.size()); + } + break; + case 34: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 35: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 36: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productURL", value, ProductURLValue)); + } + break; + case 37: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 64)); + if (ProductLabelValueBuffer != nullptr) + { + chip::Platform::MemoryFree(ProductLabelValueBuffer); + } + ProductLabelValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(ProductLabelValueBuffer, value.data(), value.size()); + ProductLabelValue = chip::CharSpan(ProductLabelValueBuffer, value.size()); + } + break; + case 38: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 39: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 40: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("productLabel", value, ProductLabelValue)); + } + break; + case 41: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (SerialNumberValueBuffer != nullptr) + { + chip::Platform::MemoryFree(SerialNumberValueBuffer); + } + SerialNumberValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(SerialNumberValueBuffer, value.data(), value.size()); + SerialNumberValue = chip::CharSpan(SerialNumberValueBuffer, value.size()); + } + break; + case 42: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 43: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("serialNumber", value, SerialNumberValue)); + } + break; + case 44: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 45: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 46: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("reachable", value, true)); + VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); + } + break; + case 47: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "char_string", "char_string")); + VerifyOrReturn(CheckConstraintMaxLength("value", value, 32)); + if (UniqueIDValueBuffer != nullptr) + { + chip::Platform::MemoryFree(UniqueIDValueBuffer); + } + UniqueIDValueBuffer = static_cast(chip::Platform::MemoryAlloc(value.size())); + memcpy(UniqueIDValueBuffer, value.data(), value.size()); + UniqueIDValue = chip::CharSpan(UniqueIDValueBuffer, value.size()); + } + break; + case 48: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_UNSUPPORTED_WRITE)); + break; + case 49: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::CharSpan value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValueAsString("uniqueID", value, UniqueIDValue)); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorName::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "TH writes VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("samplegarbage: not in length on purpose", 6); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorName::Id, value, chip::NullOptional, chip::NullOptional); + } + case 3: { + LogStep(3, "TH reads VendorName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0001"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorName::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorID::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Verify that VendorID matches the value assigned to this manufacturer"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 6: { + LogStep(6, "TH writes VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::VendorId value; + value = static_cast(17); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorID::Id, value, chip::NullOptional, chip::NullOptional); + } + case 7: { + LogStep(7, "TH reads VendorID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::VendorID::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductName::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "TH writes ProductName from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductgarbage: not in length on purpose", 10); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductName::Id, value, chip::NullOptional, chip::NullOptional); + } + case 10: { + LogStep(10, "TH reads ProductName from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductName::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::NodeLabel::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "TH writes NodeLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 13: { + LogStep(13, "TH reads NodeLabel from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0005 && PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersion::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "TH writes HardwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint16_t value; + value = 17713U; + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersion::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 16: { + LogStep(16, "TH reads HardwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0007"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersion::Id, true, chip::NullOptional); + } + case 17: { + LogStep(17, "TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersionString::Id, true, chip::NullOptional); + } + case 18: { + LogStep(18, "TH writes HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newhardwareversiongarbage: not in length on purpose", 18); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersionString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 19: { + LogStep(19, "TH reads HardwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0008"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::HardwareVersionString::Id, true, chip::NullOptional); + } + case 20: { + LogStep(20, "TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 21: { + LogStep(21, "TH writes SoftwareVersion from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + uint32_t value; + value = 33299UL; + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersion::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 22: { + LogStep(22, "TH reads SoftwareVersion from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0009"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersion::Id, true, chip::NullOptional); + } + case 23: { + LogStep(23, "TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, true, chip::NullOptional); + } + case 24: { + LogStep(24, "TH writes SoftwareVersionString from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("1.0garbage: not in length on purpose", 3); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 25: { + LogStep(25, "TH reads SoftwareVersionString from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SoftwareVersionString::Id, true, chip::NullOptional); + } + case 26: { + LogStep(26, "TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ManufacturingDate::Id, true, chip::NullOptional); + } + case 27: { + LogStep(27, "Verify if the first 8 characters specify date according to ISO 8601, i.e, YYYYMMDD."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 28: { + LogStep(28, "TH writes ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("20210814789452INgarbage: not in length on purpose", 16); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ManufacturingDate::Id, value, chip::NullOptional, + chip::NullOptional); + } + case 29: { + LogStep(29, "TH reads ManufacturingDate from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ManufacturingDate::Id, true, chip::NullOptional); + } + case 30: { + LogStep(30, "TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::PartNumber::Id, true, chip::NullOptional); + } + case 31: { + LogStep(31, "TH writes PartNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newpartgarbage: not in length on purpose", 7); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::PartNumber::Id, value, chip::NullOptional, chip::NullOptional); + } + case 32: { + LogStep(32, "TH reads PartNumber from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000c"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::PartNumber::Id, true, chip::NullOptional); + } + case 33: { + LogStep(33, "TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductURL::Id, true, chip::NullOptional); + } + case 34: { + LogStep(34, + "Verify that it specifies a link to a specific web page, Verify that it follows the syntax rules specified in " + "RFC 3986."); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 35: { + LogStep(35, "TH writes ProductURL from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("https://www.example.comgarbage: not in length on purpose", 23); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductURL::Id, value, chip::NullOptional, chip::NullOptional); + } + case 36: { + LogStep(36, "TH reads ProductURL from the DUT"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000d"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductURL::Id, true, chip::NullOptional); + } + case 37: { + LogStep(37, "TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductLabel::Id, true, chip::NullOptional); + } + case 38: { + LogStep(38, "Verify that it does not include the name of the vendor as defined within the VendorName attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + case 39: { + LogStep(39, "TH writes ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newproductlabelgarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductLabel::Id, value, chip::NullOptional, chip::NullOptional); + } + case 40: { + LogStep(40, "TH reads ProductLabel from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000e"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::ProductLabel::Id, true, chip::NullOptional); + } + case 41: { + LogStep(41, "TH reads SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SerialNumber::Id, true, chip::NullOptional); + } + case 42: { + LogStep(42, "TH writes SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newserialnumbergarbage: not in length on purpose", 15); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SerialNumber::Id, value, chip::NullOptional, chip::NullOptional); + } + case 43: { + LogStep(43, "TH reads SerialNumber from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A000f"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::SerialNumber::Id, true, chip::NullOptional); + } + case 44: { + LogStep(44, "TH reads Reachable from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::Reachable::Id, true, chip::NullOptional); + } + case 45: { + LogStep(45, "TH sends Write request message to DUT to change value of Reachable to false"); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + bool value; + value = false; + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::Reachable::Id, value, chip::NullOptional, chip::NullOptional); + } + case 46: { + LogStep(46, "TH reads Reachable from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0011"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::Reachable::Id, true, chip::NullOptional); + } + case 47: { + LogStep(47, "TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::UniqueID::Id, true, chip::NullOptional); + } + case 48: { + LogStep(48, "TH writes UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::CharSpan value; + value = chip::Span("newidgarbage: not in length on purpose", 5); + return WriteAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::UniqueID::Id, value, chip::NullOptional, chip::NullOptional); + } + case 49: { + LogStep(49, "TH reads UniqueID from the DUT."); + VerifyOrDo(!ShouldSkip("BRBINFO.S.A0012"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), BridgedDeviceBasic::Id, + BridgedDeviceBasic::Attributes::UniqueID::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_ACT_1_1Suite : public TestCommand { public: @@ -13446,7 +15331,7 @@ class Test_TC_BINFO_2_1Suite : public TestCommand class Test_TC_CNET_1_3Suite : public TestCommand { public: - Test_TC_CNET_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_1_3", 0, credsIssuerConfig) + Test_TC_CNET_1_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_CNET_1_3", 16, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -13479,6 +15364,159 @@ class Test_TC_CNET_1_3Suite : public TestCommand switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint16_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("clusterRevision", value, 1U)); + VerifyOrReturn(CheckConstraintType("value", "int16u", "int16u")); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 0UL)); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 1UL)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 2UL)); + } + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("featureMap", value, 4UL)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 8UL)); + } + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); + } + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); + } + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("acceptedCommandList", iter_0, 0)); + } + } + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 7UL)); + } + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + { + auto iter_0 = value.begin(); + VerifyOrReturn(CheckNoMoreListItems("generatedCommandList", iter_0, 0)); + } + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -13494,6 +15532,103 @@ class Test_TC_CNET_1_3Suite : public TestCommand using namespace chip::app::Clusters; switch (testIndex) { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::ClusterRevision::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + VerifyOrDo(!ShouldSkip(" !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 "), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: FeatureMap when CNET.S.F00 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: FeatureMap when CNET.S.F01 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: FeatureMap when CNET.S.F02 is set"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::FeatureMap::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 7: { + LogStep(7, "Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01 || CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 8: { + LogStep(8, "Read the optional attribute(ScanMaxTimeSeconds): AttributeList"); + VerifyOrDo(!ShouldSkip("CNET.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 9: { + LogStep(9, "Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList"); + VerifyOrDo(!ShouldSkip("CNET.S.A0003"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AttributeList::Id, true, chip::NullOptional); + } + case 10: { + LogStep(10, "Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features CNET.S.F00(WI),CNET.S.F01(TH)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 11: { + LogStep(11, "Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 13: { + LogStep(13, "Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 14: { + LogStep(14, + "Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) or CNET.S.F01(TH) " + "is true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F00 || CNET.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + case 15: { + LogStep(15, "Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must be true)"); + VerifyOrDo(!ShouldSkip("CNET.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(0), NetworkCommissioning::Id, + NetworkCommissioning::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -23484,29 +25619,193 @@ class Test_TC_ALOGIN_1_12Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Read the global attribute: ClusterRevision"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id, - true, chip::NullOptional); + LogStep(1, "Read the global attribute: ClusterRevision"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::ClusterRevision::Id, + true, chip::NullOptional); + } + case 2: { + LogStep(2, "Read the global attribute: FeatureMap"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::FeatureMap::Id, true, + chip::NullOptional); + } + case 3: { + LogStep(3, "Read the global attribute: AttributeList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id, + true, chip::NullOptional); + } + case 4: { + LogStep(4, "Read the global attribute: AcceptedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, + AccountLogin::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 5: { + LogStep(5, "Read the global attribute: GeneratedCommandList"); + return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, + AccountLogin::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_ALOGIN_12_1Suite : public TestCommand +{ +public: + Test_TC_ALOGIN_12_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_ALOGIN_12_1", 5, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_ALOGIN_12_1Suite() + { + if (setupPINBuffer != nullptr) + { + chip::Platform::MemoryFree(setupPINBuffer); + setupPINBuffer = nullptr; + } + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTempAccountIdentifier; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + chip::Optional mTimeout; + + char * setupPINBuffer = nullptr; + chip::CharSpan setupPIN; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + if (setupPINBuffer != nullptr) + { + chip::Platform::MemoryFree(setupPINBuffer); + } + setupPINBuffer = static_cast(chip::Platform::MemoryAlloc(value.setupPIN.size())); + memcpy(setupPINBuffer, value.setupPIN.data(), value.setupPIN.size()); + setupPIN = chip::CharSpan(setupPINBuffer, value.setupPIN.size()); + } + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "Launch an app with the provided a application ID"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::LaunchApp::Type value; + + value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.applicationId = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + value.data.Emplace(); + value.data.Value() = chip::ByteSpan(chip::Uint8::from_const_char("Hello Worldgarbage: not in length on purpose"), 11); + return SendCommand(kIdentityAlpha, GetEndpoint(3), ApplicationLauncher::Id, + ApplicationLauncher::Commands::LaunchApp::Id, value, chip::NullOptional + + ); } case 2: { - LogStep(2, "Read the global attribute: FeatureMap"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::FeatureMap::Id, true, - chip::NullOptional); + LogStep(2, "TH sends a GetSetupPIN command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::GetSetupPIN::Type value; + value.tempAccountIdentifier = + mTempAccountIdentifier.HasValue() ? mTempAccountIdentifier.Value() : chip::Span("1111", 4); + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::GetSetupPIN::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 3: { - LogStep(3, "Read the global attribute: AttributeList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Attributes::AttributeList::Id, - true, chip::NullOptional); + LogStep(3, "TH sends a Login command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Login::Type value; + value.tempAccountIdentifier = + mTempAccountIdentifier.HasValue() ? mTempAccountIdentifier.Value() : chip::Span("1111", 4); + value.setupPIN = setupPIN; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Login::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } case 4: { - LogStep(4, "Read the global attribute: AcceptedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, - AccountLogin::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); - } - case 5: { - LogStep(5, "Read the global attribute: GeneratedCommandList"); - return ReadAttribute(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, - AccountLogin::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); + LogStep(4, "TH sends a Logout command to the DUT with test values provided by the product maker."); + VerifyOrDo(!ShouldSkip("ALOGIN.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::AccountLogin::Commands::Logout::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(3), AccountLogin::Id, AccountLogin::Commands::Logout::Id, value, + chip::Optional(10000), chip::NullOptional + + ); } } return CHIP_NO_ERROR; @@ -24308,50 +26607,240 @@ class Test_TC_APPLAUNCHER_3_8Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "Stop an app with the provided application ID"); - VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; - - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = - mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); - - return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, - value, chip::NullOptional - - ); - } - case 2: { - LogStep(2, "Reads the Status attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); + LogStep(1, "Stop an app with the provided application ID"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::StopApp::Type value; + + value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.applicationId = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::StopApp::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Reads the Status attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand +{ +public: + Test_TC_APPLAUNCHER_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_APPLAUNCHER_3_9", 3, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_APPLAUNCHER_3_9Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH sends HideApp command to DUT"); + VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; + + value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; + value.application.applicationId = + mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); + + return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, + value, chip::NullOptional + + ); + } + case 2: { + LogStep(2, "Reads the Status attribute"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); + } + } + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand +{ +public: + Test_TC_MEDIAINPUT_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_10", 2, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_MEDIAINPUT_3_10Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::DecodableList value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for the commissioned device to be retrieved"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, + "TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + "inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + "InputType (InputType Enums), Name (type: Strings), and Description(Type:String)"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + chip::NullOptional); } } return CHIP_NO_ERROR; } }; -class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand +class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand { public: - Test_TC_APPLAUNCHER_3_9Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_APPLAUNCHER_3_9", 3, credsIssuerConfig) + Test_TC_MEDIAINPUT_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_11", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); - AddArgument("applicationId", &mApplicationId); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_APPLAUNCHER_3_9Suite() {} + ~Test_TC_MEDIAINPUT_3_11Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24362,8 +26851,6 @@ class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mCatalogVendorId; - chip::Optional mApplicationId; chip::Optional mTimeout; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -24385,112 +26872,19 @@ class Test_TC_APPLAUNCHER_3_9Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType value; + chip::app::DataModel::DecodableList value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); } break; case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; break; - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - case 0: { - LogStep(0, "Wait for the commissioned device to be retrieved"); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee(kIdentityAlpha, value); - } - case 1: { - LogStep(1, "TH sends HideApp command to DUT"); - VerifyOrDo(!ShouldSkip("APPLAUNCHER.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::ApplicationLauncher::Commands::HideApp::Type value; - - value.application.catalogVendorId = mCatalogVendorId.HasValue() ? mCatalogVendorId.Value() : 123U; - value.application.applicationId = - mApplicationId.HasValue() ? mApplicationId.Value() : chip::Span("exampleid", 9); - - return SendCommand(kIdentityAlpha, GetEndpoint(1), ApplicationLauncher::Id, ApplicationLauncher::Commands::HideApp::Id, - value, chip::NullOptional - - ); - } - case 2: { - LogStep(2, "Reads the Status attribute"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Enter 'y' after successgarbage: not in length on purpose", 23); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt(kIdentityAlpha, value); - } - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand -{ -public: - Test_TC_MEDIAINPUT_3_10Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_10", 2, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_MEDIAINPUT_3_10Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; - break; - case 1: + case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + uint8_t value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("currentInput", value, 1U)); } break; default: @@ -24524,16 +26918,33 @@ class Test_TC_MEDIAINPUT_3_10Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, chip::NullOptional); } + case 2: { + LogStep(2, "Select Input Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::SelectInput::Type value; + value.index = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::SelectInput::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Read current input list"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::CurrentInput::Id, true, + chip::NullOptional); + } } return CHIP_NO_ERROR; } }; -class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand +class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand { public: - Test_TC_MEDIAINPUT_3_11Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_11", 4, credsIssuerConfig) + Test_TC_MEDIAINPUT_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_12", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24541,7 +26952,7 @@ class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MEDIAINPUT_3_11Suite() {} + ~Test_TC_MEDIAINPUT_3_12Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24582,11 +26993,6 @@ class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - { - uint8_t value; - VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("currentInput", value, 1U)); - } break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -24620,32 +27026,35 @@ class Test_TC_MEDIAINPUT_3_11Suite : public TestCommand chip::NullOptional); } case 2: { - LogStep(2, "Select Input Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "Show Input Status Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::SelectInput::Type value; - value.index = 1U; - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::SelectInput::Id, value, + chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::ShowInputStatus::Id, value, chip::NullOptional ); } case 3: { - LogStep(3, "Read current input list"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0001 && MEDIAINPUT.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::CurrentInput::Id, true, - chip::NullOptional); + LogStep(3, "Hide Input Status Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::HideInputStatus::Id, value, + chip::NullOptional + + ); } } return CHIP_NO_ERROR; } }; -class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand +class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand { public: - Test_TC_MEDIAINPUT_3_12Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_12", 4, credsIssuerConfig) + Test_TC_MEDIAINPUT_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_MEDIAINPUT_3_13", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24653,7 +27062,7 @@ class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MEDIAINPUT_3_12Suite() {} + ~Test_TC_MEDIAINPUT_3_13Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24694,6 +27103,7 @@ class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand break; case 3: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); @@ -24718,44 +27128,44 @@ class Test_TC_MEDIAINPUT_3_12Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, - "TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - "inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - "InputType (InputType Enums), Name (type: Strings), and Description(Type:String)"); + LogStep(1, "TH reads the InputList attribute from the DUT to show list of Inputs available"); VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Show Input Status Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C01.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "Rename Input Command"); + VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::ShowInputStatus::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::ShowInputStatus::Id, value, + chip::app::Clusters::MediaInput::Commands::RenameInput::Type value; + value.index = 1U; + value.name = chip::Span("A1garbage: not in length on purpose", 2); + return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::RenameInput::Id, value, chip::NullOptional ); } case 3: { - LogStep(3, "Hide Input Status Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C02.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(3, "TH reads the InputList attribute from the DUT to show list of Inputs available"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::HideInputStatus::Type value; - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::HideInputStatus::Id, value, - chip::NullOptional - - ); + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt(kIdentityAlpha, value); } } return CHIP_NO_ERROR; } }; -class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand +class Test_TC_WAKEONLAN_4_1Suite : public TestCommand { public: - Test_TC_MEDIAINPUT_3_13Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_MEDIAINPUT_3_13", 4, credsIssuerConfig) + Test_TC_WAKEONLAN_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_WAKEONLAN_4_1", 4, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -24763,7 +27173,7 @@ class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MEDIAINPUT_3_13Suite() {} + ~Test_TC_WAKEONLAN_4_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -24795,8 +27205,9 @@ class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::DecodableList value; + chip::CharSpan value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value", value, 12)); } break; case 2: @@ -24829,30 +27240,27 @@ class Test_TC_MEDIAINPUT_3_13Suite : public TestCommand return WaitForCommissionee(kIdentityAlpha, value); } case 1: { - LogStep(1, "TH reads the InputList attribute from the DUT to show list of Inputs available"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - return ReadAttribute(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Attributes::InputList::Id, true, + LogStep(1, "TH reads the MACAddress attribute from the DUT"); + VerifyOrDo(!ShouldSkip("WAKEONLAN.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), WakeOnLan::Id, WakeOnLan::Attributes::MACAddress::Id, true, chip::NullOptional); } case 2: { - LogStep(2, "Rename Input Command"); - VerifyOrDo(!ShouldSkip("MEDIAINPUT.S.C03.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(2, "TH sends a Sleep command to DUT"); + VerifyOrDo(!ShouldSkip("LOWPOWER.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::app::Clusters::MediaInput::Commands::RenameInput::Type value; - value.index = 1U; - value.name = chip::Span("A1garbage: not in length on purpose", 2); - return SendCommand(kIdentityAlpha, GetEndpoint(1), MediaInput::Id, MediaInput::Commands::RenameInput::Id, value, + chip::app::Clusters::LowPower::Commands::Sleep::Type value; + return SendCommand(kIdentityAlpha, GetEndpoint(1), LowPower::Id, LowPower::Commands::Sleep::Id, value, chip::NullOptional ); } case 3: { - LogStep(3, "TH reads the InputList attribute from the DUT to show list of Inputs available"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp"), - return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(3, "TH sends a Wake-On LAN magic packet containing the MAC address from step 1"); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt(kIdentityAlpha, value); @@ -38799,19 +41207,19 @@ class Test_TC_DGTHREAD_1_1Suite : public TestCommand } case 51: { LogStep(51, "Read the optional attribute (ActiveTimestamp) in AttributeList"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0038"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); } case 52: { LogStep(52, "Read the optional attribute (PendingTimestamp) in AttributeList"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003A"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A0039"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); } case 53: { LogStep(53, "Read the optional attribute (Delay) in AttributeList"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::AttributeList::Id, true, chip::NullOptional); } @@ -39366,13 +41774,13 @@ class Test_TC_DGTHREAD_2_1Suite : public TestCommand } case 29: { LogStep(29, "TH reads Delay attribute value from DUT"); - VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003A"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("DGTHREAD.S.A003a"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(0), ThreadNetworkDiagnostics::Id, ThreadNetworkDiagnostics::Attributes::Delay::Id, true, chip::NullOptional); } case 30: { LogStep(30, "Read SecurityPolicy struct attribute from DUT and Verify the each field"); - VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A003B"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("PICS_USER_PROMPT && DGTHREAD.S.A003b"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); @@ -73467,6 +75875,246 @@ class Test_TC_DRLK_2_5Suite : public TestCommand } }; +class Test_TC_DRLK_2_6Suite : public TestCommand +{ +public: + Test_TC_DRLK_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_6", 10, credsIssuerConfig) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + + ~Test_TC_DRLK_2_6Suite() {} + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + uint8_t NumberOfHolidaySchedulesSupported; + + chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } + + // + // Tests methods + // + + void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override + { + bool shouldContinue = false; + + switch (mTestIndex - 1) + { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + shouldContinue = true; + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint8_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); + VerifyOrReturn(CheckConstraintMaxValue("value", value, 255U)); + NumberOfHolidaySchedulesSupported = value; + } + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 0U)); + VerifyOrReturn(CheckValuePresent("localStartTime", value.localStartTime)); + VerifyOrReturn(CheckValue("localStartTime.Value()", value.localStartTime.Value(), 20UL)); + VerifyOrReturn(CheckValuePresent("localEndTime", value.localEndTime)); + VerifyOrReturn(CheckValue("localEndTime.Value()", value.localEndTime.Value(), 30UL)); + if (value.localEndTime.HasValue()) + { + VerifyOrReturn(CheckConstraintMinValue("value.localEndTime.Value()", value.localEndTime.Value(), 21UL)); + } + VerifyOrReturn(CheckValuePresent("operatingMode", value.operatingMode)); + VerifyOrReturn(CheckValue("operatingMode.Value()", value.operatingMode.Value(), 0U)); + } + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 15U)); + VerifyOrReturn(CheckValue("status", value.status, 133U)); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 10U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("holidayIndex", value.holidayIndex, 1U)); + VerifyOrReturn(CheckValue("status", value.status, 139U)); + } + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + default: + LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); + } + + if (shouldContinue) + { + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + } + + CHIP_ERROR DoTestStep(uint16_t testIndex) override + { + using namespace chip::app::Clusters; + switch (testIndex) + { + case 0: { + LogStep(0, "Wait for commissionee"); + ListFreer listFreer; + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee(kIdentityAlpha, value); + } + case 1: { + LogStep(1, "TH reads NumberOfHoliday SchedulesSupported and saves for future use."); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.A0016"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, + DoorLock::Attributes::NumberOfHolidaySchedulesSupported::Id, true, chip::NullOptional); + } + case 2: { + LogStep(2, "Create Holiday schedule with 1 index"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C11.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 20UL; + value.localEndTime = 30UL; + value.operatingMode = static_cast(0); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 3: { + LogStep(3, "Get Holiday Schedule with HolidayIndex as 1"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 4: { + LogStep(4, "Create Holiday schedule with invalid operating mode"); + VerifyOrDo(!ShouldSkip("DRLK.S.C11.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::SetHolidaySchedule::Type value; + value.holidayIndex = 1U; + value.localStartTime = 20UL; + value.localEndTime = 30UL; + value.operatingMode = static_cast(5); + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::SetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 5: { + LogStep(5, "Get Holiday Schedule with Invalid HolidayIndex 15."); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 15U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 6: { + LogStep(6, "Get Holiday Schedule with the Non-scheduled HolidayIndex"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 10U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 7: { + LogStep(7, "Clear Holiday schedule with 1 index"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C13.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 8: { + LogStep(8, "Make sure that holiday schedule was deleted"); + VerifyOrDo(!ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::GetHolidaySchedule::Type value; + value.holidayIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::GetHolidaySchedule::Id, value, + chip::NullOptional + + ); + } + case 9: { + LogStep(9, "Cleanup the created user"); + ListFreer listFreer; + chip::app::Clusters::DoorLock::Commands::ClearUser::Type value; + value.userIndex = 1U; + return SendCommand(kIdentityAlpha, GetEndpoint(1), DoorLock::Id, DoorLock::Commands::ClearUser::Id, value, + chip::Optional(10000), chip::NullOptional + + ); + } + } + return CHIP_NO_ERROR; + } +}; + class Test_TC_DRLK_2_7Suite : public TestCommand { public: @@ -84192,63 +86840,6 @@ class Test_TC_MEDIAINPUT_3_17Suite : public TestCommand } }; -class Test_TC_WAKEONLAN_4_1Suite : public TestCommand -{ -public: - Test_TC_WAKEONLAN_4_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_WAKEONLAN_4_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_WAKEONLAN_4_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_CHANNEL_5_4Suite : public TestCommand { public: @@ -84819,68 +87410,11 @@ class Test_TC_CONTENTLAUNCHER_10_4Suite : public TestCommand } }; -class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand -{ -public: - Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_CONTENTLAUNCHER_10_5Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand +class Test_TC_CONTENTLAUNCHER_10_5Suite : public TestCommand { public: - Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 0, credsIssuerConfig) + Test_TC_CONTENTLAUNCHER_10_5Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_5", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -84888,7 +87422,7 @@ class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} + ~Test_TC_CONTENTLAUNCHER_10_5Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -84933,10 +87467,11 @@ class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand } }; -class Test_TC_MC_11_1Suite : public TestCommand +class Test_TC_CONTENTLAUNCHER_10_7Suite : public TestCommand { public: - Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) + Test_TC_CONTENTLAUNCHER_10_7Suite(CredentialIssuerCommands * credsIssuerConfig) : + TestCommand("Test_TC_CONTENTLAUNCHER_10_7", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -84944,7 +87479,7 @@ class Test_TC_MC_11_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_11_1Suite() {} + ~Test_TC_CONTENTLAUNCHER_10_7Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -84989,10 +87524,10 @@ class Test_TC_MC_11_1Suite : public TestCommand } }; -class Test_TC_MC_11_2Suite : public TestCommand +class Test_TC_MC_11_1Suite : public TestCommand { public: - Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) + Test_TC_MC_11_1Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_1", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85000,7 +87535,7 @@ class Test_TC_MC_11_2Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_MC_11_2Suite() {} + ~Test_TC_MC_11_1Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -85045,11 +87580,10 @@ class Test_TC_MC_11_2Suite : public TestCommand } }; -class Test_TC_ALOGIN_12_1Suite : public TestCommand +class Test_TC_MC_11_2Suite : public TestCommand { public: - Test_TC_ALOGIN_12_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ALOGIN_12_1", 0, credsIssuerConfig) + Test_TC_MC_11_2Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_MC_11_2", 0, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -85057,7 +87591,7 @@ class Test_TC_ALOGIN_12_1Suite : public TestCommand AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } - ~Test_TC_ALOGIN_12_1Suite() {} + ~Test_TC_MC_11_2Suite() {} chip::System::Clock::Timeout GetWaitDuration() const override { @@ -98997,62 +101531,6 @@ class Test_TC_DRLK_2_1Suite : public TestCommand } }; -class Test_TC_DRLK_2_6Suite : public TestCommand -{ -public: - Test_TC_DRLK_2_6Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_DRLK_2_6", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_DRLK_2_6Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_DRLK_2_8Suite : public TestCommand { public: @@ -103877,62 +106355,6 @@ class Test_TC_PCC_3_1Suite : public TestCommand } }; -class Test_TC_ACL_2_3Suite : public TestCommand -{ -public: - Test_TC_ACL_2_3Suite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("Test_TC_ACL_2_3", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_ACL_2_3Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_ACL_2_4Suite : public TestCommand { public: @@ -104381,120 +106803,6 @@ class Test_TC_ULABEL_3_1Suite : public TestCommand } }; -class Test_TC_BRBINFO_1_1Suite : public TestCommand -{ -public: - Test_TC_BRBINFO_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BRBINFO_1_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_BRBINFO_1_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - -class Test_TC_BRBINFO_2_1Suite : public TestCommand -{ -public: - Test_TC_BRBINFO_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_BRBINFO_2_1", 0, credsIssuerConfig) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - - ~Test_TC_BRBINFO_2_1Suite() {} - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } - - // - // Tests methods - // - - void OnResponse(const chip::app::StatusIB & status, chip::TLV::TLVReader * data) override - { - bool shouldContinue = false; - - switch (mTestIndex - 1) - { - default: - LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); - } - - if (shouldContinue) - { - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - } - - CHIP_ERROR DoTestStep(uint16_t testIndex) override - { - using namespace chip::app::Clusters; - switch (testIndex) - { - } - return CHIP_NO_ERROR; - } -}; - class Test_TC_BRBINFO_2_2Suite : public TestCommand { public: @@ -104735,8 +107043,11 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -104804,6 +107115,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -104816,6 +107128,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -104940,6 +107253,7 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), + make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105075,7 +107389,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105090,7 +107403,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105202,7 +107514,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105252,7 +107563,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), @@ -105261,8 +107571,6 @@ void registerCommandsTests(Commands & commands, CredentialIssuerCommands * creds make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 8bc08e43b3ea3c..560a723adefbd1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -39,8 +39,10 @@ class TestList : public Command { printf("Test_TC_ACL_1_1\n"); printf("Test_TC_ACL_2_1\n"); printf("Test_TC_ACL_2_2\n"); + printf("Test_TC_ACL_2_3\n"); printf("Test_TC_BOOL_1_1\n"); printf("Test_TC_BOOL_2_1\n"); + printf("Test_TC_BRBINFO_1_1\n"); printf("Test_TC_ACT_1_1\n"); printf("Test_TC_BIND_1_1\n"); printf("Test_TC_CC_1_1\n"); @@ -102,6 +104,7 @@ class TestList : public Command { printf("Test_TC_APBSC_1_10\n"); printf("Test_TC_CONTENTLAUNCHER_1_11\n"); printf("Test_TC_ALOGIN_1_12\n"); + printf("Test_TC_ALOGIN_12_1\n"); printf("Test_TC_LOWPOWER_2_1\n"); printf("Test_TC_KEYPADINPUT_3_2\n"); printf("Test_TC_KEYPADINPUT_3_3\n"); @@ -111,6 +114,7 @@ class TestList : public Command { printf("Test_TC_MEDIAINPUT_3_11\n"); printf("Test_TC_MEDIAINPUT_3_12\n"); printf("Test_TC_MEDIAINPUT_3_13\n"); + printf("Test_TC_WAKEONLAN_4_1\n"); printf("Test_TC_CHANNEL_5_1\n"); printf("Test_TC_CHANNEL_5_2\n"); printf("Test_TC_CHANNEL_5_3\n"); @@ -225,6 +229,7 @@ class TestList : public Command { printf("Test_TC_DRLK_2_3\n"); printf("Test_TC_DRLK_2_4\n"); printf("Test_TC_DRLK_2_5\n"); + printf("Test_TC_DRLK_2_6\n"); printf("Test_TC_DRLK_2_7\n"); printf("Test_TC_DRLK_2_9\n"); printf("TestGroupsCluster\n"); @@ -2752,11 +2757,1464 @@ class Test_TC_ACL_2_2 : public TestCommandBridge { } }; +class Test_TC_ACL_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ACL_2_3() + : TestCommandBridge("Test_TC_ACL_2_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("D_OK_EMPTY", &mDOkEmpty); + AddArgument("D_OK_SINGLE", &mDOkSingle); + AddArgument("D_OK_FULL", &mDOkFull); + AddArgument("D_BAD_LENGTH", &mDBadLength); + AddArgument("D_BAD_STRUCT", &mDBadStruct); + AddArgument("D_BAD_LIST", &mDBadList); + AddArgument("D_BAD_ELEM", &mDBadElem); + AddArgument("D_BAD_OVERFLOW", &mDBadOverflow); + AddArgument("D_BAD_UNDERFLOW", &mDBadUnderflow); + AddArgument("D_BAD_NONE", &mDBadNone); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ACL_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ACL_2_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ACL_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute\n"); + err = TestTh1ReadsDutEndpoint0OperationalCredentialsClusterCurrentFabricIndexAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct: Data field: D_OK_EMPTY : 1718\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDOkEmpty1718_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_4(); + break; + case 5: + ChipLogProgress(chipTool, + " ***** Test Step 5 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E6700D00000F1FF02003148656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656" + "E7420616761696E2E2E2E2E2E0018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkFull17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003148656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e0018_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_8(); + break; + case 9: + ChipLogProgress(chipTool, + " ***** Test Step 9 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E6700D00000F1FF02003248656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656" + "E7420616761696E2E2E2E2E2E2E0018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadLength17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003248656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e2e0018_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_STRUCT : 1518\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadStruct1518_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + ":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617" + "320612063686172737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadList3701d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + ":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732061206368617" + "2737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadElem17103d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_OVERFLOW : " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018FF\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadOverflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018ff_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_UNDERFLOW " + ":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E672061732" + "0612063686172737472696E6700\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadUnderflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadNone_15(); + break; + case 16: + ChipLogProgress(chipTool, + " ***** Test Step 16 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + "AccessControlExtensionStruct containing 2 elements . value is list of AccessControlExtensionStruct containing 2 " + "elements . first element contains Data field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + "17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320" + "612063686172737472696E670018\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining2ElementsValueIsListOfAccessControlExtensionStructContaining2ElementsFirstElementContainsDataFieldDOkEmpty1718SecondElementContainsDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_17(); + break; + case 18: + ChipLogProgress(chipTool, + " ***** Test Step 18 : TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is an empty " + "list\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsAnEmptyList_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute\n"); + if (ShouldSkip("ACL.S.A0001")) { + NextTest(); + return; + } + err = TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_19(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 20; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mDOkEmpty; + chip::Optional mDOkSingle; + chip::Optional mDOkFull; + chip::Optional mDBadLength; + chip::Optional mDBadStruct; + chip::Optional mDBadList; + chip::Optional mDBadElem; + chip::Optional mDBadOverflow; + chip::Optional mDBadUnderflow; + chip::Optional mDBadNone; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nonnull CurrentFabricIndex; + + CHIP_ERROR TestTh1ReadsDutEndpoint0OperationalCredentialsClusterCurrentFabricIndexAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + CurrentFabricIndex = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDOkEmpty1718_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkEmpty.HasValue() + ? [NSData dataWithBytes:mDOkEmpty.Value().data() length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is " + @"list of AccessControlExtensionStruct containing 1 element 1. struct: Data " + @"field: D_OK_EMPTY : 1718 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkEmpty.HasValue() ? [NSData dataWithBytes:mDOkEmpty.Value().data() + length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkSingle.HasValue() + ? [NSData dataWithBytes:mDOkSingle.Value().data() length:mDOkSingle.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:71]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_SINGLE " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D" + @"656E74206C6976696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkSingle.HasValue() + ? [NSData dataWithBytes:mDOkSingle.Value().data() + length:mDOkSingle.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72" + "\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67" + "\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" + "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:71] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDOkFull17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003148656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e0018_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkFull.HasValue() + ? [NSData dataWithBytes:mDOkFull.Value().data() length:mDOkFull.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73" + "\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E" + "\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x31" + "\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E" + "\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18" + length:128]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_OK_FULL " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C65" + @"6D656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003148656C6C6F205" + @"76F726C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E00" + @"18 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkFull.HasValue() + ? [NSData dataWithBytes:mDOkFull.Value().data() length:mDOkFull.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72" + "\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67" + "\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" + "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\xD0\x00" + "\x00\xF1\xFF\x02\x00\x31\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E" + "\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20" + "\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E" + "\x00\x18" + length:128] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadLength17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700d00000f1ff02003248656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e7420616761696e2e2e2e2e2e2e0018_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadLength.HasValue() + ? [NSData dataWithBytes:mDBadLength.Value().data() length:mDBadLength.Value().size()] + : [[NSData alloc] + initWithBytes: + "\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73" + "\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E" + "\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\xD0\x00\x00\xF1\xFF\x02\x00\x32" + "\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E" + "\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18" + length:129]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1 .struct Data field: D_BAD_LENGTH " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D" + @"656E74206C6976696E6720617320612063686172737472696E6700D00000F1FF02003248656C6C6F20576F7" + @"26C642E205468697320697320612073696E676C6520656C656D656E7420616761696E2E2E2E2E2E2E0018 " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadStruct1518_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadStruct.HasValue() + ? [NSData dataWithBytes:mDBadStruct.Value().data() length:mDBadStruct.Value().size()] + : [[NSData alloc] initWithBytes:"\x15\x18" length:2]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1. struct Data field: " + @"D_BAD_STRUCT : 1518 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadList3701d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadList.HasValue() + ? [NSData dataWithBytes:mDBadList.Value().data() length:mDBadList.Value().size()] + : [[NSData alloc] + initWithBytes:"\x37\x01\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54" + "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20" + "\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:72]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_LIST " + @":3701D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C65" + @"6D656E74206C6976696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadElem17103d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadElem.HasValue() + ? [NSData dataWithBytes:mDBadElem.Value().data() length:mDBadElem.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\x10\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20" + "\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" + "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:65]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog( + @"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list of " + @"AccessControlExtensionStruct containing 1 element 1. struct Data field: D_BAD_ELEM " + @":17103D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C69" + @"76696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadOverflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018ff_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadOverflow.HasValue() + ? [NSData dataWithBytes:mDBadOverflow.Value().data() length:mDBadOverflow.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18\xFF" + length:72]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1 .struct Data field: " + @"D_BAD_OVERFLOW : " + @"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656" + @"D656E74206C6976696E6720617320612063686172737472696E670018FF Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1StructDataFieldDBadUnderflow17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e6700_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadUnderflow.HasValue() + ? [NSData dataWithBytes:mDBadUnderflow.Value().data() length:mDBadUnderflow.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00" + length:70]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1. struct Data field: " + @"D_BAD_UNDERFLOW " + @":17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C65" + @"6D656E74206C6976696E6720617320612063686172737472696E6700 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining1Element1structDataFieldDBadNone_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDBadNone.HasValue() + ? [NSData dataWithBytes:mDBadNone.Value().data() length:mDBadNone.Value().size()] + : [[NSData alloc] initWithBytes:"" length:0]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 1 element 1.struct Data field: D_BAD_NONE " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsListOfAccessControlExtensionStructContaining2ElementsValueIsListOfAccessControlExtensionStructContaining2ElementsFirstElementContainsDataFieldDOkEmpty1718SecondElementContainsDataFieldDOkSingle17d00000f1ff01003d48656c6c6f20576f726c642e205468697320697320612073696e676c6520656c656d656e74206c6976696e6720617320612063686172737472696e670018_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + temp_0[0] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).data = mDOkEmpty.HasValue() + ? [NSData dataWithBytes:mDOkEmpty.Value().data() length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + + temp_0[1] = [[MTRAccessControlClusterExtensionEntry alloc] init]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[1]).data = mDOkSingle.HasValue() + ? [NSData dataWithBytes:mDOkSingle.Value().data() length:mDOkSingle.Value().size()] + : [[NSData alloc] + initWithBytes:"\x17\xD0\x00\x00\xF1\xFF\x01\x00\x3D\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68" + "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" + "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" + length:71]; + ((MTRAccessControlClusterExtensionEntry *) temp_0[1]).fabricIndex = [CurrentFabricIndex copy]; + + extensionArgument = temp_0; + } + [cluster + writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is list " + @"of AccessControlExtensionStruct containing 2 elements . value is list of " + @"AccessControlExtensionStruct containing 2 elements . first element contains Data " + @"field: D_OK_EMPTY 1718 . second element contains Data field: D_OK_SINGLE " + @"17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656" + @"D656E74206C6976696E6720617320612063686172737472696E670018 Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValueAsString( + "Data", ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).data, + mDOkEmpty.HasValue() ? [NSData dataWithBytes:mDOkEmpty.Value().data() + length:mDOkEmpty.Value().size()] + : [[NSData alloc] initWithBytes:"\x17\x18" length:2] + + )); + VerifyOrReturn(CheckValue("FabricIndex", + ((MTRAccessControlClusterExtensionEntry *) actualValue[0]).fabricIndex, + CurrentFabricIndex)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1WritesDutEndpoint0AccessControlClusterExtensionAttributeValueIsAnEmptyList_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id extensionArgument; + { + NSMutableArray * temp_0 = [[NSMutableArray alloc] init]; + extensionArgument = temp_0; + } + [cluster writeAttributeExtensionWithValue:extensionArgument + completion:^(NSError * _Nullable err) { + NSLog(@"TH1 writes DUT Endpoint 0 AccessControl cluster Extension attribute, value is " + @"an empty list Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsDutEndpoint0AccessControlClusterExtensionAttribute_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRReadParams alloc] init]; + params.filterByFabric = true; + [cluster + readAttributeExtensionWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads DUT Endpoint 0 AccessControl cluster Extension attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("Extension", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_BOOL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BOOL_1_1() - : TestCommandBridge("Test_TC_BOOL_1_1") + Test_TC_BOOL_1_1() + : TestCommandBridge("Test_TC_BOOL_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_BOOL_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); + err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); + err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 6; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BOOL_2_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_BOOL_2_1() + : TestCommandBridge("Test_TC_BOOL_2_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_BOOL_2_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_2_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_2_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read mandatory non-global attribute: StateValue\n"); + if (ShouldSkip("BOOL.S.A0000")) { + NextTest(); + return; + } + err = TestReadMandatoryNonGlobalAttributeStateValue_1(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 2; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestReadMandatoryNonGlobalAttributeStateValue_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStateValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read mandatory non-global attribute: StateValue Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("stateValue", "boolean", "boolean")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_BRBINFO_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_BRBINFO_1_1() + : TestCommandBridge("Test_TC_BRBINFO_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -2766,7 +4224,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_BOOL_1_1() {} + ~Test_TC_BRBINFO_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -2774,11 +4232,11 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_BRBINFO_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BRBINFO_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -2795,24 +4253,137 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : read the global attribute: ClusterRevision\n"); - err = TestReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the ClusterRevision from DUT\n"); + err = TestThReadsTheClusterRevisionFromDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); - err = TestReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : TH reads the FeatureMap from DUT\n"); + err = TestThReadsTheFeatureMapFromDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: AttributeList\n"); - err = TestReadTheGlobalAttributeAttributeList_3(); + ChipLogProgress(chipTool, " ***** Test Step 3 : TH reads AttributeList from DUT\n"); + err = TestThReadsAttributeListFromDut_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: AcceptedCommandList\n"); - err = TestReadTheGlobalAttributeAcceptedCommandList_4(); + ChipLogProgress(chipTool, " ***** Test Step 4 : TH reads optional attribute(VendorName) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0001")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeVendorNameInAttributeList_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: GeneratedCommandList\n"); - err = TestReadTheGlobalAttributeGeneratedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : TH reads optional attribute(VendorID) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0002")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeVendorIDInAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : TH reads optional attribute(ProductName) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0003")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductNameInAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : TH reads optional attribute(NodeLabel) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0005")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeNodeLabelInAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : TH reads optional attribute(HardwareVersion) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0007")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeHardwareVersionInAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : TH reads optional attribute(HardwareVersionString) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0008")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeHardwareVersionStringInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : TH reads optional attribute(SoftwareVersion) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0009")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSoftwareVersionInAttributeList_10(); + break; + case 11: + ChipLogProgress( + chipTool, " ***** Test Step 11 : TH reads optional attribute(SoftwareVersionString) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000a")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSoftwareVersionStringInAttributeList_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : TH reads optional attribute(ManufacturingDate) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000b")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeManufacturingDateInAttributeList_12(); + break; + case 13: + ChipLogProgress(chipTool, " ***** Test Step 13 : TH reads optional attribute(PartNumber) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000c")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributePartNumberInAttributeList_13(); + break; + case 14: + ChipLogProgress(chipTool, " ***** Test Step 14 : TH reads optional attribute(ProductURL) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000d")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductURLInAttributeList_14(); + break; + case 15: + ChipLogProgress(chipTool, " ***** Test Step 15 : TH reads optional attribute(ProductLabel) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000e")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeProductLabelInAttributeList_15(); + break; + case 16: + ChipLogProgress(chipTool, " ***** Test Step 16 : TH reads optional attribute(SerialNumber) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A000f")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeSerialNumberInAttributeList_16(); + break; + case 17: + ChipLogProgress(chipTool, " ***** Test Step 17 : TH reads optional attribute(UniqueID) in AttributeList\n"); + if (ShouldSkip("BRBINFO.S.A0012")) { + NextTest(); + return; + } + err = TestThReadsOptionalAttributeUniqueIDInAttributeList_17(); + break; + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : TH1 reads AcceptedCommandList from DUT\n"); + err = TestTh1ReadsAcceptedCommandListFromDut_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : TH1 reads GeneratedCommandList from DUT\n"); + err = TestTh1ReadsGeneratedCommandListFromDut_19(); break; } @@ -2843,6 +4414,48 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 16: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 17: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 18: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -2856,7 +4469,7 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 6; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; @@ -2871,15 +4484,17 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"read the global attribute: ClusterRevision Error: %@", err); + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -2895,15 +4510,17 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: FeatureMap Error: %@", err); + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -2919,20 +4536,22 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR TestThReadsAttributeListFromDut_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AttributeList Error: %@", err); + NSLog(@"TH reads AttributeList from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); @@ -2945,163 +4564,374 @@ class Test_TC_BOOL_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeAcceptedCommandList_4() + CHIP_ERROR TestThReadsOptionalAttributeVendorNameInAttributeList_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: AcceptedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(VendorName) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestReadTheGlobalAttributeGeneratedCommandList_5() + CHIP_ERROR TestThReadsOptionalAttributeVendorIDInAttributeList_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read the global attribute: GeneratedCommandList Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(VendorID) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_BOOL_2_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_BOOL_2_1() - : TestCommandBridge("Test_TC_BOOL_2_1") - , mTestIndex(0) + CHIP_ERROR TestThReadsOptionalAttributeProductNameInAttributeList_6() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductName) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_BOOL_2_1() {} + CHIP_ERROR TestThReadsOptionalAttributeNodeLabelInAttributeList_7() + { - /////////// TestCommand Interface ///////// - void NextTest() override + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(NodeLabel) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeHardwareVersionInAttributeList_8() { - CHIP_ERROR err = CHIP_NO_ERROR; - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_BOOL_2_1\n"); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_BOOL_2_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(HardwareVersion) in AttributeList Error: %@", err); - Wait(); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read mandatory non-global attribute: StateValue\n"); - if (ShouldSkip("BOOL.S.A0000")) { - NextTest(); - return; - } - err = TestReadMandatoryNonGlobalAttributeStateValue_1(); - break; - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + NextTest(); + }]; + + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestThReadsOptionalAttributeHardwareVersionStringInAttributeList_9() { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(HardwareVersionString) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - chip::System::Clock::Timeout GetWaitDuration() const override + CHIP_ERROR TestThReadsOptionalAttributeSoftwareVersionInAttributeList_10() { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SoftwareVersion) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + CHIP_ERROR TestThReadsOptionalAttributeSoftwareVersionStringInAttributeList_11() + { - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SoftwareVersionString) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_12() { - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ManufacturingDate) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } - CHIP_ERROR TestReadMandatoryNonGlobalAttributeStateValue_1() + CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_13() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBooleanState alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeStateValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read mandatory non-global attribute: StateValue Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(PartNumber) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("stateValue", "boolean", "boolean")); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_14() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductURL) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductLabel) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_16() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SerialNumber) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_17() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(UniqueID) in AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_18() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_19() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasic alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads GeneratedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -17549,7 +19379,562 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 14; + const uint16_t mTestCount = 14; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsAttributeListFromDut_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads AttributeList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ManufacturingDate) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(PartNumber) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductURL) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(ProductLabel) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(SerialNumber) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeLocalConfigDisabledInAttributeList_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(LocalConfigDisabled) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeReachableInAttributeList_10() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(Reachable) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads optional attribute(UniqueID) in attributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_12() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads AcceptedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_13() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH1 reads GeneratedCommandList from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_CNET_1_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_CNET_1_3() + : TestCommandBridge("Test_TC_CNET_1_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_CNET_1_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_CNET_1_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CNET_1_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Read the global attribute: ClusterRevision\n"); + err = TestReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !CNET.S.F00 && !CNET.S.F01 && !CNET.S.F02 ")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Read the global attribute: FeatureMap when CNET.S.F00 is set\n"); + if (ShouldSkip("CNET.S.F00")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMapWhenCnetsf00IsSet_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Read the global attribute: FeatureMap when CNET.S.F01 is set\n"); + if (ShouldSkip("CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMapWhenCnetsf01IsSet_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Read the global attribute: FeatureMap when CNET.S.F02 is set\n"); + if (ShouldSkip("CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadTheGlobalAttributeFeatureMapWhenCnetsf02IsSet_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Read the global attribute: AttributeList\n"); + err = TestReadTheGlobalAttributeAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) " + "is true\n"); + if (ShouldSkip("CNET.S.F00 || CNET.S.F01 || CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadMandatoryAttributesInAttributeListIfCnetsf00wiCnetsf01thCnetsf02etIsTrue_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Read the optional attribute(ScanMaxTimeSeconds): AttributeList\n"); + if (ShouldSkip("CNET.S.A0002")) { + NextTest(); + return; + } + err = TestReadTheOptionalAttributeScanMaxTimeSecondsAttributeList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList\n"); + if (ShouldSkip("CNET.S.A0003")) { + NextTest(); + return; + } + err = TestReadingOptionalAttributeConnectMaxTimeSecondsInAttributeList_9(); + break; + case 10: + ChipLogProgress(chipTool, + " ***** Test Step 10 : Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features " + "CNET.S.F00(WI),CNET.S.F01(TH)\n"); + if (ShouldSkip("CNET.S.F00 || CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCnetsf00wicnetsf01th_10(); + break; + case 11: + ChipLogProgress(chipTool, + " ***** Test Step 11 : Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true)\n"); + if (ShouldSkip("CNET.S.F00")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsWiFiRelatedFeaturesCnetsf00wiIsTrue_11(); + break; + case 12: + ChipLogProgress(chipTool, + " ***** Test Step 12 : Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true)\n"); + if (ShouldSkip("CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsThreadRelatedFeaturesCNETSF01THIsTrue_12(); + break; + case 13: + ChipLogProgress(chipTool, + " ***** Test Step 13 : Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is " + "true)\n"); + if (ShouldSkip("CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadAcceptedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02THIsTrue_13(); + break; + case 14: + ChipLogProgress(chipTool, + " ***** Test Step 14 : Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) " + "or CNET.S.F01(TH) is true)\n"); + if (ShouldSkip("CNET.S.F00 || CNET.S.F01")) { + NextTest(); + return; + } + err = TestReadTheGeneratedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCNETSF00WIOrCnetsf01thIsTrue_14(); + break; + case 15: + ChipLogProgress(chipTool, + " ***** Test Step 15 : Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must " + "be true)\n"); + if (ShouldSkip("CNET.S.F02")) { + NextTest(); + return; + } + err = TestReadTheGeneratedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02ETMustBeTrue_15(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 14: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 15: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 16; chip::Optional mNodeId; chip::Optional mCluster; @@ -17564,15 +19949,17 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestThReadsTheClusterRevisionFromDut_1() + CHIP_ERROR TestReadTheGlobalAttributeClusterRevision_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the ClusterRevision from DUT Error: %@", err); + NSLog(@"Read the global attribute: ClusterRevision Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -17588,15 +19975,17 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsTheFeatureMapFromDut_2() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMap_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the FeatureMap from DUT Error: %@", err); + NSLog(@"Read the global attribute: FeatureMap Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -17605,43 +19994,30 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsAttributeListFromDut_3() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMapWhenCnetsf00IsSet_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads AttributeList from DUT Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap when CNET.S.F00 is set Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 8UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 9UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 10UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 19UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 1UL)); + } NextTest(); }]; @@ -17649,20 +20025,24 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeManufacturingDateInAttributeList_4() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMapWhenCnetsf01IsSet_4() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(ManufacturingDate) in attributeList Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap when CNET.S.F01 is set Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 11UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 2UL)); + } NextTest(); }]; @@ -17670,20 +20050,24 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributePartNumberInAttributeList_5() + CHIP_ERROR TestReadTheGlobalAttributeFeatureMapWhenCnetsf02IsSet_5() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(PartNumber) in attributeList Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the global attribute: FeatureMap when CNET.S.F02 is set Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 12UL)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 4UL)); + } NextTest(); }]; @@ -17691,20 +20075,26 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeProductURLInAttributeList_6() + CHIP_ERROR TestReadTheGlobalAttributeAttributeList_6() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(ProductURL) in attributeList Error: %@", err); + NSLog(@"Read the global attribute: AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 13UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -17712,20 +20102,28 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeProductLabelInAttributeList_7() + CHIP_ERROR TestReadMandatoryAttributesInAttributeListIfCnetsf00wiCnetsf01thCnetsf02etIsTrue_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(ProductLabel) in attributeList Error: %@", err); + NSLog(@"Read mandatory attributes in AttributeList if CNET.S.F00(WI)/CNET.S.F01(TH)/CNET.S.F02(ET) is true Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 14UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 7UL)); NextTest(); }]; @@ -17733,20 +20131,22 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeSerialNumberInAttributeList_8() + CHIP_ERROR TestReadTheOptionalAttributeScanMaxTimeSecondsAttributeList_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(SerialNumber) in attributeList Error: %@", err); + NSLog(@"Read the optional attribute(ScanMaxTimeSeconds): AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 15UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); NextTest(); }]; @@ -17754,20 +20154,22 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeLocalConfigDisabledInAttributeList_9() + CHIP_ERROR TestReadingOptionalAttributeConnectMaxTimeSecondsInAttributeList_9() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(LocalConfigDisabled) in attributeList Error: %@", err); + NSLog(@"Reading optional attribute(ConnectMaxTimeSeconds) in AttributeList Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 16UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); NextTest(); }]; @@ -17775,20 +20177,26 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeReachableInAttributeList_10() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCnetsf00wicnetsf01th_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(Reachable) in attributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AcceptedCommandList If DUT supports Wi-Fi/Thread related features CNET.S.F00(WI),CNET.S.F01(TH) Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 17UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 4UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 6UL)); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 8UL)); NextTest(); }]; @@ -17796,20 +20204,22 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestThReadsOptionalAttributeUniqueIDInAttributeList_11() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsWiFiRelatedFeaturesCnetsf00wiIsTrue_11() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads optional attribute(UniqueID) in attributeList Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AcceptedCommandList If DUT supports Wi-Fi related features (CNET.S.F00(WI) is true) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 18UL)); + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 2UL)); NextTest(); }]; @@ -17817,123 +20227,106 @@ class Test_TC_BINFO_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsAcceptedCommandListFromDut_12() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsThreadRelatedFeaturesCNETSF01THIsTrue_12() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads AcceptedCommandList from DUT Error: %@", err); + NSLog(@"Read AcceptedCommandList If DUT supports Thread related features(CNET.S.F01(TH) is true) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); - } - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("acceptedCommandList", value, 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestTh1ReadsGeneratedCommandListFromDut_13() + CHIP_ERROR TestReadAcceptedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02THIsTrue_13() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterBasic alloc] initWithDevice:device endpointID:@(0) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH1 reads GeneratedCommandList from DUT Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read AcceptedCommandList If DUT supports Ethernet related features(CNET.S.F02(TH) is true) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; return CHIP_NO_ERROR; } -}; -class Test_TC_CNET_1_3 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_CNET_1_3() - : TestCommandBridge("Test_TC_CNET_1_3") - , mTestIndex(0) + CHIP_ERROR TestReadTheGeneratedCommandListIfDutSupportsWiFiThreadRelatedFeaturesCNETSF00WIOrCnetsf01thIsTrue_14() { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_CNET_1_3() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_CNET_1_3\n"); - } + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the GeneratedCommandList If DUT supports Wi-Fi/Thread related features(CNET.S.F00(WI) or CNET.S.F01(TH) " + @"is true) Error: %@", + err); - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_CNET_1_3\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - Wait(); + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 5UL)); + VerifyOrReturn(CheckConstraintContains("generatedCommandList", value, 7UL)); - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - } + NextTest(); + }]; - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } + return CHIP_NO_ERROR; } - void OnStatusUpdate(const chip::app::StatusIB & status) override + CHIP_ERROR TestReadTheGeneratedCommandListIfDutSupportsEthernetRelatedFeaturesCNETSF02ETMustBeTrue_15() { - switch (mTestIndex - 1) { - } - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterNetworkCommissioning alloc] initWithDevice:device + endpointID:@(0) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read the GeneratedCommandList If DUT supports Ethernet related features(CNET.S.F02(ET) must be true) Error: %@", + err); -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 0; + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class Test_TC_DESC_1_1 : public TestCommandBridge { @@ -36408,6 +38801,261 @@ class Test_TC_ALOGIN_1_12 : public TestCommandBridge { } }; +class Test_TC_ALOGIN_12_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_ALOGIN_12_1() + : TestCommandBridge("Test_TC_ALOGIN_12_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("TempAccountIdentifier", &mTempAccountIdentifier); + AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId); + AddArgument("applicationId", &mApplicationId); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_ALOGIN_12_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_ALOGIN_12_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_ALOGIN_12_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Launch an app with the provided a application ID\n"); + if (ShouldSkip("APPLAUNCHER.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestLaunchAnAppWithTheProvidedAApplicationId_1(); + break; + case 2: + ChipLogProgress(chipTool, + " ***** Test Step 2 : TH sends a GetSetupPIN command to the DUT with test values provided by the product maker.\n"); + if (ShouldSkip("ALOGIN.S.C00.Rsp")) { + NextTest(); + return; + } + err = TestThSendsAGetSetupPINCommandToTheDutWithTestValuesProvidedByTheProductMaker_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : TH sends a Login command to the DUT with test values provided by the product maker.\n"); + if (ShouldSkip("ALOGIN.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALoginCommandToTheDutWithTestValuesProvidedByTheProductMaker_3(); + break; + case 4: + ChipLogProgress(chipTool, + " ***** Test Step 4 : TH sends a Logout command to the DUT with test values provided by the product maker.\n"); + if (ShouldSkip("ALOGIN.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestThSendsALogoutCommandToTheDutWithTestValuesProvidedByTheProductMaker_4(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 5; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTempAccountIdentifier; + chip::Optional mCatalogVendorId; + chip::Optional mApplicationId; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestLaunchAnAppWithTheProvidedAApplicationId_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterApplicationLauncher alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRApplicationLauncherClusterLaunchAppParams alloc] init]; + params.application = [[MTRApplicationLauncherClusterApplication alloc] init]; + ((MTRApplicationLauncherClusterApplication *) params.application).catalogVendorId = mCatalogVendorId.HasValue() + ? [NSNumber numberWithUnsignedShort:mCatalogVendorId.Value()] + : [NSNumber numberWithUnsignedShort:123U]; + ((MTRApplicationLauncherClusterApplication *) params.application).applicationId = mApplicationId.HasValue() + ? [[NSString alloc] initWithBytes:mApplicationId.Value().data() + length:mApplicationId.Value().size() + encoding:NSUTF8StringEncoding] + : @"exampleid"; + + params.data = [[NSData alloc] initWithBytes:"Hello World" length:11]; + [cluster + launchAppWithParams:params + completion:^(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Launch an app with the provided a application ID Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSString * _Nonnull setupPIN; + + CHIP_ERROR TestThSendsAGetSetupPINCommandToTheDutWithTestValuesProvidedByTheProductMaker_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAccountLoginClusterGetSetupPINParams alloc] init]; + params.tempAccountIdentifier = mTempAccountIdentifier.HasValue() + ? [[NSString alloc] initWithBytes:mTempAccountIdentifier.Value().data() + length:mTempAccountIdentifier.Value().size() + encoding:NSUTF8StringEncoding] + : @"1111"; + [cluster + getSetupPINWithParams:params + completion:^(MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"TH sends a GetSetupPIN command to the DUT with test values provided by the product maker. " + @"Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + setupPIN = values.setupPIN; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsALoginCommandToTheDutWithTestValuesProvidedByTheProductMaker_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRAccountLoginClusterLoginParams alloc] init]; + params.tempAccountIdentifier = mTempAccountIdentifier.HasValue() + ? [[NSString alloc] initWithBytes:mTempAccountIdentifier.Value().data() + length:mTempAccountIdentifier.Value().size() + encoding:NSUTF8StringEncoding] + : @"1111"; + params.setupPIN = [setupPIN copy]; + [cluster + loginWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"TH sends a Login command to the DUT with test values provided by the product maker. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestThSendsALogoutCommandToTheDutWithTestValuesProvidedByTheProductMaker_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterAccountLogin alloc] initWithDevice:device endpointID:@(3) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster logoutWithCompletion:^(NSError * _Nullable err) { + NSLog(@"TH sends a Logout command to the DUT with test values provided by the product maker. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_LOWPOWER_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -37585,8 +40233,372 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + CHIP_ERROR + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestSelectInputCommand_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRMediaInputClusterSelectInputParams alloc] init]; + params.index = [NSNumber numberWithUnsignedChar:1U]; + [cluster selectInputWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Select Input Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadCurrentInputList_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeCurrentInputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read current input list Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MEDIAINPUT_3_12() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_12") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MEDIAINPUT_3_12() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_12\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_12\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, + " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " + "list of available inputs supported by the device is provided, where each entry in the list contains an " + "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Show Input Status Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C01.Rsp")) { + NextTest(); + return; + } + err = TestShowInputStatusCommand_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C02.Rsp")) { + NextTest(); + return; + } + err = TestHideInputStatusCommand_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR + TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " + @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " + @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestShowInputStatusCommand_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster showInputStatusWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Show Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestHideInputStatusCommand_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster hideInputStatusWithCompletion:^(NSError * _Nullable err) { + NSLog(@"Hide Input Status Command Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_MEDIAINPUT_3_13() + : TestCommandBridge("Test_TC_MEDIAINPUT_3_13") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_MEDIAINPUT_3_13() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_13\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_13\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available\n"); + if (ShouldSkip("MEDIAINPUT.S.A0000")) { + NextTest(); + return; + } + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Rename Input Command\n"); + if (ShouldSkip("MEDIAINPUT.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestRenameInputCommand_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH reads the InputList attribute from the DUT to show list of Inputs available\n"); + if (ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp")) { + NextTest(); + return; + } + err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_1() { MTRBaseDevice * device = GetDevice("alpha"); @@ -37594,10 +40606,7 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", - err); + NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37607,18 +40616,19 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestSelectInputCommand_2() + CHIP_ERROR TestRenameInputCommand_2() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRMediaInputClusterSelectInputParams alloc] init]; + __auto_type * params = [[MTRMediaInputClusterRenameInputParams alloc] init]; params.index = [NSNumber numberWithUnsignedChar:1U]; - [cluster selectInputWithParams:params + params.name = @"A1"; + [cluster renameInputWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Select Input Command Error: %@", err); + NSLog(@"Rename Input Command Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37628,35 +40638,22 @@ class Test_TC_MEDIAINPUT_3_11 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestReadCurrentInputList_3() + CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3() { - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeCurrentInputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Read current input list Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("CurrentInput", actualValue, 1U)); - } - - NextTest(); - }]; - - return CHIP_NO_ERROR; + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); } }; -class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { +class Test_TC_WAKEONLAN_4_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_12() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_12") + Test_TC_WAKEONLAN_4_1() + : TestCommandBridge("Test_TC_WAKEONLAN_4_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -37666,7 +40663,7 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_MEDIAINPUT_3_12() {} + ~Test_TC_WAKEONLAN_4_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -37674,11 +40671,11 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_12\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WAKEONLAN_4_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_12\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WAKEONLAN_4_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -37695,31 +40692,29 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, - " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available and Verify " - "list of available inputs supported by the device is provided, where each entry in the list contains an " - "index(type:uint 8), InputType (InputType Enums), Name (type: Strings), and Description(Type:String)\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : TH reads the MACAddress attribute from the DUT\n"); + if (ShouldSkip("WAKEONLAN.S.A0000")) { NextTest(); return; } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1(); + err = TestThReadsTheMACAddressAttributeFromTheDut_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Show Input Status Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C01.Rsp")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : TH sends a Sleep command to DUT\n"); + if (ShouldSkip("LOWPOWER.S.C00.Rsp")) { NextTest(); return; } - err = TestShowInputStatusCommand_2(); + err = TestThSendsASleepCommandToDut_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Hide Input Status Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C02.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 3 : TH sends a Wake-On LAN magic packet containing the MAC address from step 1\n"); + if (ShouldSkip("PICS_USER_PROMPT")) { NextTest(); return; } - err = TestHideInputStatusCommand_3(); + err = TestThSendsAWakeOnLanMagicPacketContainingTheMacAddressFromStep1_3(); break; } @@ -37772,193 +40767,34 @@ class Test_TC_MEDIAINPUT_3_12 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR - TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailableAndVerifyListOfAvailableInputsSupportedByTheDeviceIsProvidedWhereEachEntryInTheListContainsAnIndextypeuint8InputTypeInputTypeEnumsNameTypeStringsAndDescriptionTypeString_1() + CHIP_ERROR TestThReadsTheMACAddressAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available and Verify list of available " - @"inputs supported by the device is provided, where each entry in the list contains an index(type:uint 8), " - @"InputType (InputType Enums), Name (type: Strings), and Description(Type:String) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestShowInputStatusCommand_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster showInputStatusWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Show Input Status Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestHideInputStatusCommand_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterWakeOnLAN alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster hideInputStatusWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Hide Input Status Command Error: %@", err); + [cluster readAttributeMACAddressWithCompletion:^(NSString * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the MACAddress attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintMinLength("MACAddress", value, 12)); NextTest(); }]; return CHIP_NO_ERROR; } -}; - -class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_MEDIAINPUT_3_13() - : TestCommandBridge("Test_TC_MEDIAINPUT_3_13") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_MEDIAINPUT_3_13() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_MEDIAINPUT_3_13\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MEDIAINPUT_3_13\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); - break; - case 1: - ChipLogProgress( - chipTool, " ***** Test Step 1 : TH reads the InputList attribute from the DUT to show list of Inputs available\n"); - if (ShouldSkip("MEDIAINPUT.S.A0000")) { - NextTest(); - return; - } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Rename Input Command\n"); - if (ShouldSkip("MEDIAINPUT.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestRenameInputCommand_2(); - break; - case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : TH reads the InputList attribute from the DUT to show list of Inputs available\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAINPUT.S.A0000 && MEDIAINPUT.S.C03.Rsp")) { - NextTest(); - return; - } - err = TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 4; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_1() + CHIP_ERROR TestThSendsASleepCommandToDut_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"TH reads the InputList attribute from the DUT to show list of Inputs available Error: %@", err); + [cluster sleepWithCompletion:^(NSError * _Nullable err) { + NSLog(@"TH sends a Sleep command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -37968,33 +40804,11 @@ class Test_TC_MEDIAINPUT_3_13 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestRenameInputCommand_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterMediaInput alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - __auto_type * params = [[MTRMediaInputClusterRenameInputParams alloc] init]; - params.index = [NSNumber numberWithUnsignedChar:1U]; - params.name = @"A1"; - [cluster renameInputWithParams:params - completion:^(NSError * _Nullable err) { - NSLog(@"Rename Input Command Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestThReadsTheInputListAttributeFromTheDutToShowListOfInputsAvailable_3() + CHIP_ERROR TestThSendsAWakeOnLanMagicPacketContainingTheMacAddressFromStep1_3() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); value.expectedValue.Emplace(); value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); return UserPrompt("alpha", value); @@ -56030,7 +58844,7 @@ class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { break; case 51: ChipLogProgress(chipTool, " ***** Test Step 51 : Read the optional attribute (ActiveTimestamp) in AttributeList\n"); - if (ShouldSkip("DGTHREAD.S.A0039")) { + if (ShouldSkip("DGTHREAD.S.A0038")) { NextTest(); return; } @@ -56038,7 +58852,7 @@ class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { break; case 52: ChipLogProgress(chipTool, " ***** Test Step 52 : Read the optional attribute (PendingTimestamp) in AttributeList\n"); - if (ShouldSkip("DGTHREAD.S.A003A")) { + if (ShouldSkip("DGTHREAD.S.A0039")) { NextTest(); return; } @@ -56046,7 +58860,7 @@ class Test_TC_DGTHREAD_1_1 : public TestCommandBridge { break; case 53: ChipLogProgress(chipTool, " ***** Test Step 53 : Read the optional attribute (Delay) in AttributeList\n"); - if (ShouldSkip("DGTHREAD.S.A003B")) { + if (ShouldSkip("DGTHREAD.S.A003a")) { NextTest(); return; } @@ -121276,6 +124090,455 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { } }; +class Test_TC_DRLK_2_6 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_DRLK_2_6() + : TestCommandBridge("Test_TC_DRLK_2_6") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_DRLK_2_6() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_DRLK_2_6\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_DRLK_2_6\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for commissionee\n"); + err = TestWaitForCommissionee_0(); + break; + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : TH reads NumberOfHoliday SchedulesSupported and saves for future use.\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.A0016")) { + NextTest(); + return; + } + err = TestThReadsNumberOfHolidaySchedulesSupportedAndSavesForFutureUse_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Create Holiday schedule with 1 index\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C11.Rsp")) { + NextTest(); + return; + } + err = TestCreateHolidayScheduleWith1Index_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Get Holiday Schedule with HolidayIndex as 1\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestGetHolidayScheduleWithHolidayIndexAs1_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Create Holiday schedule with invalid operating mode\n"); + if (ShouldSkip("DRLK.S.C11.Rsp")) { + NextTest(); + return; + } + err = TestCreateHolidayScheduleWithInvalidOperatingMode_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Get Holiday Schedule with Invalid HolidayIndex 15.\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestGetHolidayScheduleWithInvalidHolidayIndex15_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Get Holiday Schedule with the Non-scheduled HolidayIndex\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestGetHolidayScheduleWithTheNonScheduledHolidayIndex_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Clear Holiday schedule with 1 index\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C13.Rsp")) { + NextTest(); + return; + } + err = TestClearHolidayScheduleWith1Index_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Make sure that holiday schedule was deleted\n"); + if (ShouldSkip("DRLK.S.F0b && DRLK.S.C12.Rsp && DRLK.S.C12.Tx")) { + NextTest(); + return; + } + err = TestMakeSureThatHolidayScheduleWasDeleted_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_9(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 10; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForCommissionee_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nonnull NumberOfHolidaySchedulesSupported; + + CHIP_ERROR TestThReadsNumberOfHolidaySchedulesSupportedAndSavesForFutureUse_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletion:^( + NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads NumberOfHoliday SchedulesSupported and saves for future use. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("numberOfHolidaySchedulesSupported", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfHolidaySchedulesSupported", [value unsignedCharValue], 255U)); + { + NumberOfHolidaySchedulesSupported = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateHolidayScheduleWith1Index_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:20UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:30UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; + [cluster setHolidayScheduleWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Create Holiday schedule with 1 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetHolidayScheduleWithHolidayIndexAs1_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Get Holiday Schedule with HolidayIndex as 1 Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 0U)); + } + + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("localStartTime", actualValue, 20UL)); + } + + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("localEndTime", actualValue, 30UL)); + } + + if (values.localEndTime != nil) { + + VerifyOrReturn(CheckConstraintMinValue( + "localEndTime", [values.localEndTime unsignedIntValue], 21UL)); + } + + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("operatingMode", actualValue, 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCreateHolidayScheduleWithInvalidOperatingMode_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.localStartTime = [NSNumber numberWithUnsignedInt:20UL]; + params.localEndTime = [NSNumber numberWithUnsignedInt:30UL]; + params.operatingMode = [NSNumber numberWithUnsignedChar:5U]; + [cluster setHolidayScheduleWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Create Holiday schedule with invalid operating mode Error: %@", err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_COMMAND)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetHolidayScheduleWithInvalidHolidayIndex15_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:15U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Get Holiday Schedule with Invalid HolidayIndex 15. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 15U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 133U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestGetHolidayScheduleWithTheNonScheduledHolidayIndex_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:10U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Get Holiday Schedule with the Non-scheduled HolidayIndex Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 10U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestClearHolidayScheduleWith1Index_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster clearHolidayScheduleWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Clear Holiday schedule with 1 index Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestMakeSureThatHolidayScheduleWasDeleted_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:1U]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Make sure that holiday schedule was deleted Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.holidayIndex; + VerifyOrReturn(CheckValue("holidayIndex", actualValue, 1U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("status", actualValue, 139U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestCleanupTheCreatedUser_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; + params.userIndex = [NSNumber numberWithUnsignedShort:1U]; + [cluster clearUserWithParams:params + completion:^(NSError * _Nullable err) { + NSLog(@"Cleanup the created user Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + class Test_TC_DRLK_2_7 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced @@ -125503,8 +128766,10 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -125566,6 +128831,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -125575,6 +128841,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -125689,6 +128956,7 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), From f9d945705338587d427be7edba9baf645cb42dd3 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Fri, 2 Dec 2022 11:26:09 +0200 Subject: [PATCH 17/30] [Telink] Use latest Zephyr (SDK 0.15.2) & migrate to Zephyr BLE implementation & Update every image to 0.6.17 (#23827) * [Telink] Migrate to Telink Zephyr BLE implementation * [Telink] Rework to generic build configuration * [Telink] Fix problems for all apps after rebase Zephyr * [Telink] Telink update to latest Zephyr with BLE impl & Update every image to 0.6.17 * [Telink] Restyle * [Telink] code review fixes * [Telink] Fix build of ota-requstor-app * [Telink] increase build timeout for k32w * Fix BLE device name Function bt_enable() from zephyr resets device name to default value * Restyled by clang-format Co-authored-by: Andrii Bilynskyi Co-authored-by: Restyled.io --- .devcontainer/devcontainer.json | 2 +- .github/workflows/bloat_check.yaml | 2 +- .github/workflows/build.yaml | 6 +- .github/workflows/chef.yaml | 6 +- .github/workflows/cirque.yaml | 4 +- .github/workflows/doxygen.yaml | 2 +- .github/workflows/examples-ameba.yaml | 2 +- .github/workflows/examples-bouffalolab.yaml | 4 +- .../workflows/examples-cc13x2x7_26x2x7.yaml | 2 +- .github/workflows/examples-efr32.yaml | 2 +- .github/workflows/examples-esp32.yaml | 4 +- .github/workflows/examples-infineon.yaml | 2 +- .github/workflows/examples-k32w.yaml | 4 +- .github/workflows/examples-linux-arm.yaml | 2 +- .github/workflows/examples-linux-imx.yaml | 2 +- .../workflows/examples-linux-standalone.yaml | 2 +- .github/workflows/examples-mbed.yaml | 2 +- .github/workflows/examples-mw320.yaml | 2 +- .github/workflows/examples-nrfconnect.yaml | 2 +- .github/workflows/examples-qpg.yaml | 2 +- .github/workflows/examples-telink.yaml | 2 +- .github/workflows/examples-tizen.yaml | 2 +- .github/workflows/full-android.yaml | 2 +- .github/workflows/fuzzing-build.yaml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/qemu.yaml | 2 +- .github/workflows/release_artifacts.yaml | 4 +- .github/workflows/smoketest-android.yaml | 2 +- .github/workflows/tests.yaml | 6 +- .github/workflows/unit_integration_test.yaml | 2 +- .github/workflows/zap_regeneration.yaml | 2 +- .github/workflows/zap_templates.yaml | 2 +- .gitmodules | 4 - build_overrides/telink.gni | 18 - config/telink/app/zephyr.conf | 22 +- config/telink/chip-gn/BUILD.gn | 14 +- config/telink/chip-module/CMakeLists.txt | 14 +- config/telink/chip-module/Kconfig | 6 - .../all-clusters-app/telink/CMakeLists.txt | 2 - .../telink/include/CHIPProjectConfig.h | 9 - examples/all-clusters-app/telink/prj.conf | 1 - .../telink/CMakeLists.txt | 2 - .../telink/include/CHIPProjectConfig.h | 9 - .../all-clusters-minimal-app/telink/prj.conf | 1 - .../light-switch-app/telink/CMakeLists.txt | 2 - .../telink/include/CHIPProjectConfig.h | 7 - examples/light-switch-app/telink/prj.conf | 1 - examples/lighting-app/telink/CMakeLists.txt | 2 - .../telink/include/CHIPProjectConfig.h | 12 +- examples/lighting-app/telink/prj.conf | 1 - .../telink/src/LightingManager.cpp | 2 +- .../ota-requestor-app/telink/CMakeLists.txt | 2 - .../telink/include/CHIPProjectConfig.h | 9 - examples/ota-requestor-app/telink/prj.conf | 1 - examples/thermostat/telink/CMakeLists.txt | 2 - .../telink/include/CHIPProjectConfig.h | 7 - examples/thermostat/telink/prj.conf | 1 - integrations/cloudbuild/build-all.yaml | 6 +- integrations/cloudbuild/build-coverage.yaml | 4 +- integrations/cloudbuild/chef.yaml | 6 +- integrations/cloudbuild/smoke-test.yaml | 14 +- src/controller/AutoCommissioner.cpp | 2 +- src/platform/Zephyr/CHIPDevicePlatformEvent.h | 2 +- src/platform/telink/BLEManagerImpl.cpp | 1239 +++++++---------- src/platform/telink/BLEManagerImpl.h | 123 +- src/platform/telink/BUILD.gn | 8 +- src/platform/telink/BlePlatformConfig.h | 8 +- .../telink/CHIPDevicePlatformConfig.h | 10 +- src/platform/telink/CHIPDevicePlatformEvent.h | 76 +- src/platform/telink/CHIPPlatformConfig.h | 28 +- src/platform/telink/FactoryDataProvider.h | 15 +- src/platform/telink/OTAImageProcessorImpl.cpp | 4 +- third_party/telink_sdk/BUILD.gn | 47 - third_party/telink_sdk/repo | 1 - 74 files changed, 714 insertions(+), 1116 deletions(-) delete mode 100644 build_overrides/telink.gni delete mode 100644 third_party/telink_sdk/BUILD.gn delete mode 160000 third_party/telink_sdk/repo diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b5da6c153e4d7f..e40199d5f54307 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "BUILD_VERSION": "0.6.06" + "BUILD_VERSION": "0.6.17" } }, "remoteUser": "vscode", diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 8646c1c0f0550d..a1fe8de3a4a367 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 steps: - uses: Wandalen/wretry.action@v1.0.36 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4a3ce8550c2e7e..3b2904617233a7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -133,7 +133,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -303,7 +303,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 8f06a341f15dd7..d33d64e5baf429 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -29,7 +29,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 options: --user root steps: @@ -57,7 +57,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.6.06 + image: connectedhomeip/chip-build-esp32:0.6.17 options: --user root steps: @@ -85,7 +85,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.6.06 + image: connectedhomeip/chip-build-nrf-platform:0.6.17 options: --user root steps: diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index 950650638a14b9..459089b5286af5 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -29,7 +29,7 @@ jobs: timeout-minutes: 90 env: - DOCKER_RUN_VERSION: 0.6.06 + DOCKER_RUN_VERSION: 0.6.17 GITHUB_CACHE_PATH: /tmp/cirque-cache/ runs-on: ubuntu-latest @@ -38,7 +38,7 @@ jobs: # need to run with privilege, which isn't supported by job.XXX.contaner # https://github.com/actions/container-action/issues/2 # container: - # image: connectedhomeip/chip-build-cirque:0.6.06 + # image: connectedhomeip/chip-build-cirque:0.6.17 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index 675690ac97337c..5e654add16df04 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -82,7 +82,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build-doxygen:0.6.06 + image: connectedhomeip/chip-build-doxygen:0.6.17 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index e46876ba3aba3b..16f1dac307801f 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ameba:0.6.06 + image: connectedhomeip/chip-build-ameba:0.6.17 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 8e137c4738b281..2fbee87d14b155 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-bouffalolab:0.6.12 + image: connectedhomeip/chip-build-bouffalolab:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -87,7 +87,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-bouffalolab:0.6.12 + image: connectedhomeip/chip-build-bouffalolab:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index d1ebf8a7cca703..192c1ce4e5b965 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-ti:0.6.06 + image: connectedhomeip/chip-build-ti:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index d245cea56323f5..7ec57b528f8ec9 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-efr32:0.6.06 + image: connectedhomeip/chip-build-efr32:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 9299ac3822c684..d58631614fc1d3 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.6.06 + image: connectedhomeip/chip-build-esp32:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -137,7 +137,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32:0.6.06 + image: connectedhomeip/chip-build-esp32:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 1f9fb326fe49d9..a5424b626892d6 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-infineon:0.6.06 + image: connectedhomeip/chip-build-infineon:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 8df18b8485cf1b..890debf6989f57 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-k32w:0.6.06 + image: connectedhomeip/chip-build-k32w:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -67,7 +67,7 @@ jobs: .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - name: Build examples - timeout-minutes: 30 + timeout-minutes: 40 run: | scripts/run_in_build_env.sh "\ ./scripts/build/build_examples.py \ diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index d43cfd557adcb6..deb4c5b83870b8 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-crosscompile:0.6.06 + image: connectedhomeip/chip-build-crosscompile:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index dbae52ae17833f..b10825a43506f0 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-imx:0.6.06 + image: connectedhomeip/chip-build-imx:0.6.17 steps: - uses: Wandalen/wretry.action@v1.0.36 diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 12f35418695f73..0d9a6f65ab124b 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 442d520103e252..40df18d434ef59 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-mbed-os:0.6.06 + image: connectedhomeip/chip-build-mbed-os:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 091a624a88d3b4..c0b8c9c53a987e 100755 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 4b9430d38a4b96..8aaeb88d833534 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-nrf-platform:0.6.06 + image: connectedhomeip/chip-build-nrf-platform:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index c5f97823e34d53..813318c8441aad 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index d4f1a9bd8f0991..eac0d95ba6dae8 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-telink:0.6.06 + image: connectedhomeip/chip-build-telink:0.6.17 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 05fae3cba514fb..5776927bfcaaea 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -32,7 +32,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-tizen:0.6.06 + image: connectedhomeip/chip-build-tizen:0.6.17 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index dc038407f8edb7..457d727ce856bb 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.6.06 + image: connectedhomeip/chip-build-android:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index 1999f806dc6329..c654404df084cc 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -31,7 +31,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7e468d2e0acb87..c9f4fe41ac64e8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,7 +28,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 steps: - uses: Wandalen/wretry.action@v1.0.36 diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 8eb3b87abb441e..08e4c59f7a2ad6 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-esp32-qemu:0.6.06 + image: connectedhomeip/chip-build-esp32-qemu:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 4795f36bdcc6c5..e208c3df6c1cf2 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.6.06 + image: connectedhomeip/chip-build-esp32:0.6.17 steps: - uses: Wandalen/wretry.action@v1.0.36 @@ -75,7 +75,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-efr32:0.6.06 + image: connectedhomeip/chip-build-efr32:0.6.17 steps: - uses: Wandalen/wretry.action@v1.0.36 name: Checkout diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 5874ba9f40c0db..63aaa6790efd68 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: connectedhomeip/chip-build-android:0.6.06 + image: connectedhomeip/chip-build-android:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7382354870e6b3..ea0dc5d1e2806a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -44,7 +44,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -347,7 +347,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" @@ -420,7 +420,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index d1067b10e6bb94..959815a7963816 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.6.06 + image: connectedhomeip/chip-build:0.6.17 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index de120fdf4ce363..525ad2df160bf7 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build:0.6.15 + image: connectedhomeip/chip-build:0.6.17 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 1e7713b13c1b27..a806b6f605471b 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: connectedhomeip/chip-build:0.6.15 + image: connectedhomeip/chip-build:0.6.17 defaults: run: shell: sh diff --git a/.gitmodules b/.gitmodules index 1d0e33d8b1f0f4..f211ca385789ff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -220,10 +220,6 @@ path = third_party/infineon/psoc6/psoc6_sdk/libs/serial-flash url = https://github.com/Infineon/serial-flash platforms = infineon -[submodule "third_party/telink_sdk/repo"] - path = third_party/telink_sdk/repo - url = https://github.com/telink-semi/telink_b91_ble_single_connection_sdk_matter - platforms = telink [submodule "ti_simplelink_sdk"] path = third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx url = https://github.com/TexasInstruments/cc13xx_cc26xx_sdk.git diff --git a/build_overrides/telink.gni b/build_overrides/telink.gni deleted file mode 100644 index 528fdc1c892f0c..00000000000000 --- a/build_overrides/telink.gni +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (c) 2020-2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -declare_args() { - # Root directory for Telink SDK. - telink_sdk_build_root = "//third_party/telink_sdk" -} diff --git a/config/telink/app/zephyr.conf b/config/telink/app/zephyr.conf index bd920eff8b4d49..1303fb6f060257 100644 --- a/config/telink/app/zephyr.conf +++ b/config/telink/app/zephyr.conf @@ -15,7 +15,6 @@ # CONFIG_CHIP=y - CONFIG_STD_CPP14=y # Logging @@ -31,6 +30,7 @@ CONFIG_NETWORKING=y CONFIG_NET_CONFIG_SETTINGS=y CONFIG_NET_SOCKETS=y CONFIG_NET_SOCKETS_POSIX_NAMES=n +CONFIG_NET_CONFIG_INIT_TIMEOUT=0 # Disable TCP and IPv4 (TCP disabled to avoid heavy traffic) CONFIG_NET_TCP=n @@ -58,7 +58,16 @@ CONFIG_NET_BUF_RX_COUNT=32 CONFIG_NET_BUF_TX_COUNT=32 # Bluetooth Low Energy configs -CONFIG_BT=n +CONFIG_BT=y +CONFIG_BT_DEBUG_LOG=n +CONFIG_BT_PERIPHERAL=y +CONFIG_BT_MAX_CONN=1 +CONFIG_BT_DEVICE_NAME_DYNAMIC=y +CONFIG_BT_GATT_DYNAMIC_DB=y +# CONFIG_BT_DEVICE_NAME_MAX=15 +CONFIG_BT_L2CAP_TX_MTU=247 +CONFIG_BT_BUF_ACL_RX_SIZE=251 +CONFIG_BT_BUF_ACL_TX_SIZE=251 # L2 OpenThread enabling CONFIG_NET_L2_OPENTHREAD=y @@ -66,7 +75,6 @@ CONFIG_OPENTHREAD_DEBUG=y CONFIG_OPENTHREAD_L2_DEBUG=y CONFIG_OPENTHREAD_L2_LOG_LEVEL_INF=y -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" CONFIG_NET_CONFIG_MY_IPV6_ADDR="fdde:ad00:beef::1" CONFIG_NET_CONFIG_PEER_IPV6_ADDR="fdde:ad00:beef::2" @@ -96,9 +104,6 @@ CONFIG_MBEDTLS_USER_CONFIG_FILE="telink-mbedtls-config.h" CONFIG_MBEDTLS_HEAP_SIZE=0 CONFIG_OPENTHREAD_EXTERNAL_HEAP=y -# Switch on Telink SDK -CONFIG_TELINK_BLE_LIB=y - # Config dynamic interrupts to have posibility to switch between BLE/Thread radio drivers CONFIG_DYNAMIC_INTERRUPTS=y @@ -108,4 +113,7 @@ CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=8 # Shell settings CONFIG_SHELL=n -CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255 \ No newline at end of file +CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE=255 + +# Legacy +CONFIG_LEGACY_INCLUDE_PATH=y diff --git a/config/telink/chip-gn/BUILD.gn b/config/telink/chip-gn/BUILD.gn index 0d95e8a18e88a8..784c4ceab2563b 100644 --- a/config/telink/chip-gn/BUILD.gn +++ b/config/telink/chip-gn/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2022 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,9 +14,8 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") -import("//build_overrides/telink.gni") -import("${build_root}/chip/tests.gni") +import("${chip_root}/build/chip/tests.gni") assert(current_os == "zephyr") @@ -24,15 +23,8 @@ declare_args() { chip_build_example_providers = false } -declare_args() { - chip_build_pw_rpc_lib = false -} - group("telink") { - deps = [ - "${chip_root}/src/lib", - "${telink_sdk_build_root}", - ] + deps = [ "${chip_root}/src/lib" ] if (chip_build_tests) { deps += [ "${chip_root}/src:tests" ] diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 6a48424b7f4832..b2f3da1eb9d135 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -129,10 +129,6 @@ if (CONFIG_CHIP_LIB_SHELL) list(APPEND CHIP_LIBRARIES -lCHIPShell) endif() -if (CONFIG_TELINK_BLE_LIB) - list(APPEND CHIP_LIBRARIES -lB91_ble_lib) -endif() - # Set up CHIP project configuration file if (CONFIG_CHIP_PROJECT_CONFIG) @@ -197,6 +193,7 @@ chip_gn_arg_string("zephyr_cxx" ${CMAKE_CXX_COMPILER chip_gn_arg_bool ("is_debug" CONFIG_DEBUG) chip_gn_arg_bool ("chip_enable_openthread" CONFIG_NET_L2_OPENTHREAD) chip_gn_arg_bool ("chip_openthread_ftd" CONFIG_OPENTHREAD_FTD) +chip_gn_arg_bool ("chip_config_network_layer_ble" CONFIG_BT) chip_gn_arg_bool ("chip_inet_config_enable_ipv4" CONFIG_NET_IPV4) chip_gn_arg_bool ("chip_enable_ota_requestor" CONFIG_CHIP_OTA_REQUESTOR) chip_gn_arg_bool ("chip_build_tests" CONFIG_CHIP_BUILD_TESTS) @@ -276,7 +273,8 @@ target_include_directories(chip INTERFACE ${CHIP_ROOT}/src/include ${CHIP_ROOT}/src/lib ${CHIP_ROOT}/third_party/nlassert/repo/include - ${CHIP_ROOT}/third_party/telink_sdk + ${CHIP_ROOT}/third_party/nlio/repo/include + ${CHIP_ROOT}/zzz_generated/app-common ${CMAKE_CURRENT_BINARY_DIR}/gen/include ) target_link_directories(chip INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/lib) @@ -288,10 +286,6 @@ if (CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER) target_include_directories(chip INTERFACE ${CHIP_ROOT}/examples/providers) endif() -if (CONFIG_TELINK_BLE_LIB) - target_link_directories(chip INTERFACE ${CHIP_ROOT}/third_party/telink_sdk/repo/eagle_ble_sdk/proj_lib) -endif() - target_link_libraries(chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group) add_dependencies(chip chip-gn) @@ -308,7 +302,7 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_custom_target(west_sign ALL COMMAND - west sign -t imgtool -p ${ZEPHYR_BASE}/../bootloader/mcuboot/scripts/imgtool.py -d ${PROJECT_BINARY_DIR}/.. -- --key ${ZEPHYR_BASE}/../bootloader/mcuboot/root-rsa-2048.pem + west sign -t imgtool -p ${ZEPHYR_BASE}/../bootloader/mcuboot/scripts/imgtool.py -d ${PROJECT_BINARY_DIR}/.. -- --pad-header --key ${ZEPHYR_BASE}/../bootloader/mcuboot/root-rsa-2048.pem ) add_custom_target(merge_mcuboot ALL diff --git a/config/telink/chip-module/Kconfig b/config/telink/chip-module/Kconfig index f216280df7e583..db442126a2c14e 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -16,12 +16,6 @@ rsource "../../zephyr/Kconfig" -config TELINK_BLE_LIB - bool "Include third party Telink BLE SDK" - default n - help - Include third party Telink BLE SDK - # See config/zephyr/Kconfig for full definition config CHIP_OTA_REQUESTOR bool diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index 553dcc8113bb53..6e9dd95f0e84ec 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.13.1) set(BOARD tlsr9518adk80d) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(ALL_CLUSTERS_COMMON_DIR ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) @@ -41,7 +40,6 @@ target_include_directories(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/include ${GEN_DIR}/app-common ${GEN_DIR}/all-clusters-app - ${NLIO_ROOT} ${TELINK_COMMON}/util/include) add_definitions( diff --git a/examples/all-clusters-app/telink/include/CHIPProjectConfig.h b/examples/all-clusters-app/telink/include/CHIPProjectConfig.h index 9cfa65977d1717..2fda70c57da9dc 100644 --- a/examples/all-clusters-app/telink/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/telink/include/CHIPProjectConfig.h @@ -31,18 +31,9 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - /** * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE * * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption */ #define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/all-clusters-app/telink/prj.conf b/examples/all-clusters-app/telink/prj.conf index 01b93d52feba2c..6c7821f2c87ec7 100644 --- a/examples/all-clusters-app/telink/prj.conf +++ b/examples/all-clusters-app/telink/prj.conf @@ -30,7 +30,6 @@ CONFIG_OPENTHREAD_PANID=4660 CONFIG_OPENTHREAD_CHANNEL=15 CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" # Disable Matter OTA DFU CONFIG_CHIP_OTA_REQUESTOR=n diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index ecf0efd6aff84a..9f0c60f81af439 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.13.1) set(BOARD tlsr9518adk80d) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(ALL_CLUSTERS_COMMON_DIR ${CHIP_ROOT}/examples/all-clusters-app/all-clusters-common REALPATH) @@ -41,7 +40,6 @@ target_include_directories(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/include ${GEN_DIR}/app-common ${GEN_DIR}/all-clusters-minimal-app - ${NLIO_ROOT} ${TELINK_COMMON}/util/include) add_definitions( diff --git a/examples/all-clusters-minimal-app/telink/include/CHIPProjectConfig.h b/examples/all-clusters-minimal-app/telink/include/CHIPProjectConfig.h index 9cfa65977d1717..2fda70c57da9dc 100644 --- a/examples/all-clusters-minimal-app/telink/include/CHIPProjectConfig.h +++ b/examples/all-clusters-minimal-app/telink/include/CHIPProjectConfig.h @@ -31,18 +31,9 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - /** * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE * * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption */ #define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/all-clusters-minimal-app/telink/prj.conf b/examples/all-clusters-minimal-app/telink/prj.conf index 791807a463a9e0..0d56373b56dffe 100644 --- a/examples/all-clusters-minimal-app/telink/prj.conf +++ b/examples/all-clusters-minimal-app/telink/prj.conf @@ -30,7 +30,6 @@ CONFIG_OPENTHREAD_PANID=4660 CONFIG_OPENTHREAD_CHANNEL=15 CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" # Disable Matter OTA DFU CONFIG_CHIP_OTA_REQUESTOR=n diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 892190ddf4b59f..40b9490510d47a 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.13.1) set(BOARD tlsr9518adk80d) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) @@ -39,7 +38,6 @@ target_include_directories(app PRIVATE include ${GEN_DIR}/app-common ${GEN_DIR}/light-switch-app - ${NLIO_ROOT} ${TELINK_COMMON}/util/include ${TELINK_COMMON}/app/include) diff --git a/examples/light-switch-app/telink/include/CHIPProjectConfig.h b/examples/light-switch-app/telink/include/CHIPProjectConfig.h index ade0219ab5da91..2fda70c57da9dc 100755 --- a/examples/light-switch-app/telink/include/CHIPProjectConfig.h +++ b/examples/light-switch-app/telink/include/CHIPProjectConfig.h @@ -31,13 +31,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - /** * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE * diff --git a/examples/light-switch-app/telink/prj.conf b/examples/light-switch-app/telink/prj.conf index 1366c5f0e952fb..54b941ef6b2fc5 100755 --- a/examples/light-switch-app/telink/prj.conf +++ b/examples/light-switch-app/telink/prj.conf @@ -33,7 +33,6 @@ CONFIG_OPENTHREAD_PANID=4660 CONFIG_OPENTHREAD_CHANNEL=15 CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" # Disable Matter OTA DFU CONFIG_CHIP_OTA_REQUESTOR=n diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 1cf675a23bab7b..5beea781359c18 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.13.1) set(BOARD tlsr9518adk80d) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) @@ -39,7 +38,6 @@ target_include_directories(app PRIVATE include ${GEN_DIR}/app-common ${GEN_DIR}/lighting-app - ${NLIO_ROOT} ${TELINK_COMMON}/util/include ${TELINK_COMMON}/app/include) diff --git a/examples/lighting-app/telink/include/CHIPProjectConfig.h b/examples/lighting-app/telink/include/CHIPProjectConfig.h index 43adb45f85f50b..76d4372a80703f 100644 --- a/examples/lighting-app/telink/include/CHIPProjectConfig.h +++ b/examples/lighting-app/telink/include/CHIPProjectConfig.h @@ -31,12 +31,10 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 +// Switching from Thread child to router may cause a few second packet stall. +// Until this is improved in OpenThread we need to increase the retransmission +// interval to survive the stall. +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (1000_ms32) /** * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE @@ -44,5 +42,3 @@ * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption */ #define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 3de670dd34bf07..25a0a15bccd265 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -33,7 +33,6 @@ CONFIG_OPENTHREAD_PANID=4660 CONFIG_OPENTHREAD_CHANNEL=15 CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" # Disable Matter OTA DFU CONFIG_CHIP_OTA_REQUESTOR=n diff --git a/examples/lighting-app/telink/src/LightingManager.cpp b/examples/lighting-app/telink/src/LightingManager.cpp index 3aad922a3516af..1c0cea74bb5cce 100644 --- a/examples/lighting-app/telink/src/LightingManager.cpp +++ b/examples/lighting-app/telink/src/LightingManager.cpp @@ -132,5 +132,5 @@ void LightingManager::UpdateLight() const uint8_t maxEffectiveLevel = mMaxLevel - mMinLevel; const uint8_t effectiveLevel = mState == kState_On ? chip::min(mLevel - mMinLevel, maxEffectiveLevel) : 0; - pwm_pin_set_usec(mPwmDevice, mPwmChannel, kPwmWidthUs, kPwmWidthUs * effectiveLevel / maxEffectiveLevel, 0); + pwm_set(mPwmDevice, mPwmChannel, PWM_USEC(kPwmWidthUs), PWM_USEC(kPwmWidthUs * effectiveLevel / maxEffectiveLevel), 0); } diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index c30aa60e529cdb..6b634ce3eb5dbc 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.13.1) set(BOARD tlsr9518adk80d) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) @@ -39,7 +38,6 @@ target_include_directories(app PRIVATE include ${GEN_DIR}/app-common ${GEN_DIR}/ota-requestor-app - ${NLIO_ROOT} ${TELINK_COMMON}/util/include ${TELINK_COMMON}/app/include) diff --git a/examples/ota-requestor-app/telink/include/CHIPProjectConfig.h b/examples/ota-requestor-app/telink/include/CHIPProjectConfig.h index 9cfa65977d1717..2fda70c57da9dc 100644 --- a/examples/ota-requestor-app/telink/include/CHIPProjectConfig.h +++ b/examples/ota-requestor-app/telink/include/CHIPProjectConfig.h @@ -31,18 +31,9 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - /** * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE * * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption */ #define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 - -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 diff --git a/examples/ota-requestor-app/telink/prj.conf b/examples/ota-requestor-app/telink/prj.conf index 7f270da20b8e5f..c801f50ac570a7 100755 --- a/examples/ota-requestor-app/telink/prj.conf +++ b/examples/ota-requestor-app/telink/prj.conf @@ -30,7 +30,6 @@ CONFIG_OPENTHREAD_PANID=4660 CONFIG_OPENTHREAD_CHANNEL=15 CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" # Disable Matter OTA DFU CONFIG_CHIP_OTA_REQUESTOR=y diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 78b4f7c7dcf883..6d00c892a2ed72 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -18,7 +18,6 @@ cmake_minimum_required(VERSION 3.13.1) set(BOARD tlsr9518adk80d) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(NLIO_ROOT ${CHIP_ROOT}/third_party/nlio/repo/include REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) @@ -39,7 +38,6 @@ target_include_directories(app PRIVATE include ${GEN_DIR}/app-common ${GEN_DIR}/thermostat - ${NLIO_ROOT} ${TELINK_COMMON}/util/include ${TELINK_COMMON}/app/include) diff --git a/examples/thermostat/telink/include/CHIPProjectConfig.h b/examples/thermostat/telink/include/CHIPProjectConfig.h index ade0219ab5da91..2fda70c57da9dc 100755 --- a/examples/thermostat/telink/include/CHIPProjectConfig.h +++ b/examples/thermostat/telink/include/CHIPProjectConfig.h @@ -31,13 +31,6 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -/** - * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - * - * Enable support for Chip-over-BLE (CHIPoBLE). - */ -#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 - /** * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE * diff --git a/examples/thermostat/telink/prj.conf b/examples/thermostat/telink/prj.conf index ad1e20d32e9b78..f07c4e4ca70f3d 100755 --- a/examples/thermostat/telink/prj.conf +++ b/examples/thermostat/telink/prj.conf @@ -30,7 +30,6 @@ CONFIG_OPENTHREAD_PANID=4660 CONFIG_OPENTHREAD_CHANNEL=15 CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" -CONFIG_NET_CONFIG_IEEE802154_DEV_NAME="IEEE802154_b91" # Disable Matter OTA DFU CONFIG_CHIP_OTA_REQUESTOR=n diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index e0dbcfaa61467c..c1110599d1fe59 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -6,7 +6,7 @@ steps: - "--init" - "--recursive" id: Submodules - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -21,7 +21,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -76,7 +76,7 @@ steps: --target k32w-shell build --create-archives /workspace/artifacts/ - - name: "connectedhomeip/chip-build-vscode:0.6.03" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/build-coverage.yaml b/integrations/cloudbuild/build-coverage.yaml index cc85632b50e7e5..a5cfc4d22661e2 100644 --- a/integrations/cloudbuild/build-coverage.yaml +++ b/integrations/cloudbuild/build-coverage.yaml @@ -7,7 +7,7 @@ steps: - "--recursive" id: Submodules - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -22,7 +22,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index 7fcdb111ed8e0f..859f2c97ebe1ad 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 2700s - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -26,7 +26,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index a5d491519965b2..658279648c61ca 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" git submodule update --init --recursive id: Submodules - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -22,7 +22,7 @@ steps: path: /pwenv timeout: 900s - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -41,7 +41,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -62,7 +62,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -84,7 +84,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -142,7 +142,7 @@ steps: - name: pwenv path: /pwenv - - name: "connectedhomeip/chip-build-vscode:0.6.06" + - name: "connectedhomeip/chip-build-vscode:0.6.17" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index 579d9c2d31dab1..982f62765bace6 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -109,7 +109,7 @@ CHIP_ERROR AutoCommissioner::SetCommissioningParameters(const CommissioningParam if (params.GetCountryCode().HasValue()) { - auto & code = params.GetCountryCode().Value(); + auto code = params.GetCountryCode().Value(); MutableCharSpan copiedCode(mCountryCode); if (CopyCharSpanToMutableCharSpan(code, copiedCode) == CHIP_NO_ERROR) { diff --git a/src/platform/Zephyr/CHIPDevicePlatformEvent.h b/src/platform/Zephyr/CHIPDevicePlatformEvent.h index 5687945287c2b1..ff329ec7590ea0 100644 --- a/src/platform/Zephyr/CHIPDevicePlatformEvent.h +++ b/src/platform/Zephyr/CHIPDevicePlatformEvent.h @@ -25,7 +25,7 @@ #include -#include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/telink/BLEManagerImpl.cpp b/src/platform/telink/BLEManagerImpl.cpp index d07b2ca3a30459..d22a2a8ddbec08 100644 --- a/src/platform/telink/BLEManagerImpl.cpp +++ b/src/platform/telink/BLEManagerImpl.cpp @@ -18,31 +18,32 @@ /** * @file * Provides an implementation of the BLEManager singleton object - * for the Telink platform. + * for Telink platforms. */ -/* this file behaves like a config.h, comes first */ + #include #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#include -#include -#include +#include +#include #include #include +#include +#include +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING +#include +#endif -/*Includes for ieee802154 switchings */ -#define DT_DRV_COMPAT telink_b91_zb -#include -#include +#include +#include +#include +#include +#include -/* Telink headers */ -#include "drivers.h" -#include "ext_driver/ext_misc.h" -#include "stack/ble/ble.h" -#include "tl_common.h" -#include "types.h" +// Includes for ieee802154 switchings +#include using namespace ::chip; using namespace ::chip::Ble; @@ -54,80 +55,16 @@ namespace Internal { namespace { -typedef enum -{ - ATT_H_START = 0, - - /* GAP service */ - GenericAccess_PS_H, // UUID: 2800, VALUE: uuid 1800 - GenericAccess_DeviceName_CD_H, // UUID: 2803, VALUE: Prop: Read | Notify - GenericAccess_DeviceName_DP_H, // UUID: 2A00, VALUE: device name - GenericAccess_Appearance_CD_H, // UUID: 2803, VALUE: Prop: Read - GenericAccess_Appearance_DP_H, // UUID: 2A01, VALUE: appearance - CONN_PARAM_CD_H, // UUID: 2803, VALUE: Prop: Read - CONN_PARAM_DP_H, // UUID: 2A04, VALUE: connParameter - - /* GATT service */ - GenericAttribute_PS_H, // UUID: 2800, VALUE: uuid 1801 - GenericAttribute_ServiceChanged_CD_H, // UUID: 2803, VALUE: Prop: Indicate - GenericAttribute_ServiceChanged_DP_H, // UUID: 2A05, VALUE: service change - GenericAttribute_ServiceChanged_CCB_H, // UUID: 2902, VALUE: serviceChangeCCC - - /* Matter service */ - Matter_PS_H, - Matter_RX_CD_H, - Matter_RX_DP_H, - Matter_TX_CD_H, - Matter_TX_DP_H, - Matter_TX_CCC_H, - - ATT_END_H, - -} ATT_HANDLE; - -typedef struct -{ - /** Minimum value for the connection event (interval. 0x0006 - 0x0C80 * 1.25 ms) */ - u16 intervalMin; - /** Maximum value for the connection event (interval. 0x0006 - 0x0C80 * 1.25 ms) */ - u16 intervalMax; - /** Number of LL latency connection events (0x0000 - 0x03e8) */ - u16 latency; - /** Connection Timeout (0x000A - 0x0C80 * 10 ms) */ - u16 timeout; -} gap_periConnectParams_t; - -#define CHIP_MAC_LEN 6 -#define CHIP_MTU_SIZE 244 -#define CHIP_MAX_ADV_DATA_LEN 31 -#define CHIP_MAX_RESPONSE_DATA_LEN 31 -#define CHIP_SHORT_UUID_LEN 2 - -#define CHIP_ADE_DATA_LEN_FLAGS 0x02 -#define CHIP_ADV_DATA_TYPE_FLAGS 0x01 -#define CHIP_ADV_DATA_FLAGS 0x06 -#define CHIP_ADV_DATA_TYPE_UUID 0x03 -#define CHIP_ADV_DATA_TYPE_NAME 0x09 -#define CHIP_ADV_DATA_TYPE_SERVICE_DATA 0x16 -#define CHIP_ADV_SERVICE_DATA_LEN (sizeof(ChipBLEDeviceIdentificationInfo) + CHIP_SHORT_UUID_LEN + 1) - -#define CHIP_BLE_TX_FIFO_SIZE 48 -#define CHIP_BLE_TX_FIFO_NUM 33 -#define CHIP_BLE_RX_FIFO_SIZE 48 -#define CHIP_BLE_RX_FIFO_NUM 8 - -#define CHIP_BLE_THREAD_STACK_SIZE 2048 -#define CHIP_BLE_THREAD_PRIORITY 2 - -#define CHIP_BLE_DISCONNECT_REASON 8 - -#define CHIP_RF_PACKET_HEADER_SIZE 3 - -#define STIMER_IRQ_NUM 1 -#define RF_IRQ_NUM 15 - -#define CHIP_RX_CHAR_UUID 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18 -#define CHIP_TX_CHAR_UUID 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18 +const bt_uuid_128 UUID128_CHIPoBLEChar_RX = + BT_UUID_INIT_128(0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18); +const bt_uuid_128 UUID128_CHIPoBLEChar_TX = + BT_UUID_INIT_128(0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18); +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING +const bt_uuid_128 UUID128_CHIPoBLEChar_C3 = + BT_UUID_INIT_128(0x04, 0x8F, 0x21, 0x83, 0x8A, 0x74, 0x7D, 0xB8, 0xF2, 0x45, 0x72, 0x87, 0x38, 0x02, 0x63, 0x64); +#endif + +bt_uuid_16 UUID16_CHIPoBLEService = BT_UUID_INIT_16(0xFFF6); const ChipBleUUID chipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, 0x11 } }; @@ -135,39 +72,80 @@ const ChipBleUUID chipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0 const ChipBleUUID chipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, 0x12 } }; -static const uint8_t matterServiceUUID[CHIP_SHORT_UUID_LEN] = { 0xF6, 0xFF }; // service UUID +_bt_gatt_ccc CHIPoBLEChar_TX_CCC = BT_GATT_CCC_INITIALIZER(nullptr, BLEManagerImpl::HandleTXCCCWrite, nullptr); + +// clang-format off + +struct bt_gatt_attr sChipoBleAttributes[] = { + BT_GATT_PRIMARY_SERVICE(&UUID16_CHIPoBLEService.uuid), + BT_GATT_CHARACTERISTIC(&UUID128_CHIPoBLEChar_RX.uuid, + BT_GATT_CHRC_WRITE | BT_GATT_CHRC_WRITE_WITHOUT_RESP, + BT_GATT_PERM_READ | BT_GATT_PERM_WRITE, + nullptr, BLEManagerImpl::HandleRXWrite, nullptr), + BT_GATT_CHARACTERISTIC(&UUID128_CHIPoBLEChar_TX.uuid, + BT_GATT_CHRC_INDICATE, + BT_GATT_PERM_NONE, + nullptr, nullptr, nullptr), + BT_GATT_CCC_MANAGED(&CHIPoBLEChar_TX_CCC, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE), +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + BT_GATT_CHARACTERISTIC(&UUID128_CHIPoBLEChar_C3.uuid, + BT_GATT_CHRC_READ, + BT_GATT_PERM_READ, + BLEManagerImpl::HandleC3Read, nullptr, nullptr), +#endif +}; -} // unnamed namespace +struct bt_gatt_service sChipoBleService = BT_GATT_SERVICE(sChipoBleAttributes); -BLEManagerImpl BLEManagerImpl::sInstance; +// clang-format on -void rf_irq_handler(const void * paramiter) -{ - irq_blt_sdk_handler(); -} +// Index of the CCC descriptor in the CHIPoBLE_Service array of attributes. +// This value should be adjusted accordingly if the service declaration changes. +constexpr int kCHIPoBLE_CCC_AttributeIndex = 3; -void stimer_irq_handler(const void * paramiter) +CHIP_ERROR InitRandomStaticAddress() { - irq_blt_sdk_handler(); -} + // Generate a random static address for the default identity. + // This must be done before bt_enable() as after that updating the default identity is not possible. + int error = 0; + bt_addr_le_t addr; -void BLEManagerImpl::BleEntry(void *, void *, void *) -{ - while (true) + // generating the address + addr.type = BT_ADDR_LE_RANDOM; + error = sys_csrand_get(addr.a.val, sizeof(addr.a.val)); + BT_ADDR_SET_STATIC(&addr.a); + + if (error) { - blt_sdk_main_loop(); + ChipLogError(DeviceLayer, "Failed to create BLE address: %d", error); + return System::MapErrorZephyr(error); + } - k_msleep(10); + error = bt_id_create(&addr, nullptr); + + if (error < 0) + { + ChipLogError(DeviceLayer, "Failed to create BLE identity: %d", error); + return System::MapErrorZephyr(error); } + + ChipLogProgress(DeviceLayer, "BLE address: %02X:%02X:%02X:%02X:%02X:%02X", addr.a.val[5], addr.a.val[4], addr.a.val[3], + addr.a.val[2], addr.a.val[1], addr.a.val[0]); + return CHIP_NO_ERROR; } -/* Thread for running BLE main loop */ -K_THREAD_DEFINE(chipBleThread, CHIP_BLE_THREAD_STACK_SIZE, BLEManagerImpl::BleEntry, NULL, NULL, NULL, CHIP_BLE_THREAD_PRIORITY, 0, - 0); +} // unnamed namespace + +BLEManagerImpl BLEManagerImpl::sInstance; + +bool ThreadConnectivityReady; +bool BLERadioInitialized; CHIP_ERROR BLEManagerImpl::_Init() { ThreadConnectivityReady = false; + BLERadioInitialized = false; + mconId = NULL; mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); @@ -176,11 +154,20 @@ CHIP_ERROR BLEManagerImpl::_Init() memset(mSubscribedConns, 0, sizeof(mSubscribedConns)); + ReturnErrorOnFailure(InitRandomStaticAddress()); + // int err = bt_enable(NULL); // Can't init BLE stack here due to abscense of non-cuncurrent mode + // VerifyOrReturnError(err == 0, MapErrorZephyr(err)); + + memset(&mConnCallbacks, 0, sizeof(mConnCallbacks)); + mConnCallbacks.connected = HandleConnect; + mConnCallbacks.disconnected = HandleDisconnect; + + bt_conn_cb_register(&mConnCallbacks); + // Initialize the CHIP BleLayer. ReturnErrorOnFailure(BleLayer::Init(this, this, &DeviceLayer::SystemLayer())); - // Suspend BLE Task - k_thread_suspend(chipBleThread); + PlatformMgr().ScheduleWork(DriveBLEState, 0); return CHIP_NO_ERROR; } @@ -225,6 +212,20 @@ void BLEManagerImpl::DriveBLEState() err = StopAdvertising(); SuccessOrExit(err); } + + // If no connections are active unregister also CHIPoBLE GATT service + if (NumConnections() == 0 && mFlags.Has(Flags::kChipoBleGattServiceRegister)) + { + // Unregister CHIPoBLE service to not allow discovering it when pairing is disabled. + if (bt_gatt_service_unregister(&sChipoBleService) != 0) + { + ChipLogError(DeviceLayer, "Failed to unregister CHIPoBLE GATT service"); + } + else + { + mFlags.Clear(Flags::kChipoBleGattServiceRegister); + } + } } exit: @@ -235,432 +236,89 @@ void BLEManagerImpl::DriveBLEState() } } -int BLEManagerImpl::RxWriteCallback(uint16_t connHandle, void * p) -{ - rf_packet_att_t * packet = (rf_packet_att_t *) p; - size_t dataLen = packet->l2capLen - CHIP_RF_PACKET_HEADER_SIZE; - ChipDeviceEvent event; - - PacketBufferHandle packetBuf = PacketBufferHandle::NewWithData(packet->dat, dataLen); - - // If successful... - if (packetBuf.IsNull()) - { - ChipLogError(DeviceLayer, "Failed to allocate buffer"); - - return 0; - } - - // Arrange to post a CHIPoBLERXWriteEvent event to the CHIP queue. - event.Type = DeviceEventType::kPlatformTelinkBleRXWrite; - event.Platform.BleRXWriteEvent.connHandle = connHandle; - event.Platform.BleRXWriteEvent.Data = std::move(packetBuf).UnsafeRelease(); - - PlatformMgr().PostEventOrDie(&event); - - return 0; -} - -void BLEManagerImpl::ConnectCallback(uint8_t bleEvent, uint8_t * data, int len) -{ - ChipDeviceEvent event; - ble_sts_t status = BLE_SUCCESS; - - event.Type = DeviceEventType::kPlatformTelinkBleConnected; - event.Platform.BleConnEvent.connHandle = BLS_CONN_HANDLE; - event.Platform.BleConnEvent.HciResult = BLE_SUCCESS; - - PlatformMgr().PostEventOrDie(&event); -} - -void BLEManagerImpl::DisconnectCallback(uint8_t bleEvent, uint8_t * data, int len) -{ - ChipDeviceEvent event; - - event.Type = DeviceEventType::kPlatformTelinkBleDisconnected; - event.Platform.BleConnEvent.connHandle = BLS_CONN_HANDLE; - event.Platform.BleConnEvent.HciResult = *data; // Reason of disconnection stored in first data byte - - PlatformMgr().PostEventOrDie(&event); -} - -int BLEManagerImpl::TxCccWriteCallback(uint16_t connHandle, void * p) +struct BLEManagerImpl::ServiceData { - ChipDeviceEvent event; - rf_packet_att_t * packet = (rf_packet_att_t *) p; - int dataLen = packet->rf_len - CHIP_RF_PACKET_HEADER_SIZE; - uint16_t value = *((uint16_t *) packet->dat); - - event.Type = DeviceEventType::kPlatformTelinkBleCCCWrite; - event.Platform.BleCCCWriteEvent.connHandle = connHandle; - event.Platform.BleCCCWriteEvent.Value = value; - - PlatformMgr().PostEventOrDie(&event); - - return 0; -} - -int BLEManagerImpl::GapEventHandler(uint32_t gapEvent, uint8_t * data, int size) -{ - ChipDeviceEvent event; - - if ((gapEvent & 0xFF) == GAP_EVT_GATT_HANDLE_VLAUE_CONFIRM) - { - /* Send TX complete event if everything is fine */ - event.Type = DeviceEventType::kPlatformTelinkBleTXComplete; - event.Platform.BleTXCompleteEvent.connHandle = BLS_CONN_HANDLE; - - PlatformMgr().PostEventOrDie(&event); - } - - return 0; -} + uint8_t uuid[2]; + ChipBLEDeviceIdentificationInfo deviceIdInfo; +} __attribute__((packed)); -CHIP_ERROR BLEManagerImpl::_InitStack(void) +CHIP_ERROR BLEManagerImpl::StartAdvertising(void) { - CHIP_ERROR err = CHIP_NO_ERROR; + int err = 0; - uint8_t macPublic[CHIP_MAC_LEN] = { 0 }; - uint8_t macRandomStatic[CHIP_MAC_LEN] = { 0 }; - int ret = 0; + // At first run always select fast advertising, on the next attempt slow down interval. + const uint32_t intervalMin = mFlags.Has(Flags::kFastAdvertisingEnabled) ? CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN + : CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN; + const uint32_t intervalMax = mFlags.Has(Flags::kFastAdvertisingEnabled) ? CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX + : CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX; if (ConnectivityMgr().IsThreadProvisioned()) { - ChipLogProgress(DeviceLayer, "Thread Provisioned. Ignore"); - - return CHIP_ERROR_INCORRECT_STATE; - } - - /* Reset Radio */ - rf_radio_reset(); - - /* Reset DMA */ - rf_reset_dma(); - - /* Init Radio driver */ - ble_radio_init(); - - /* Generate MAC address if it does not exist or read it from flash if it is exist already */ - blc_initMacAddress(CFG_ADR_MAC_1M_FLASH, macPublic, macRandomStatic); - - /* Init interrupts and DMA for BLE module ??? */ - blc_ll_initBasicMCU(); - - /* Setup MAC Address */ - blc_ll_initStandby_module(macPublic); - - /* Init advertisement */ - blc_ll_initAdvertising_module(); - - /* Init slave role */ - blc_ll_initSlaveRole_module(); - - /* Init connection mode */ - blc_ll_initConnection_module(); - - /* Init GAP */ - err = _InitGap(); - SuccessOrExit(err); - - /* Resetup stimer interrupt to handle BLE stack */ - ret = irq_connect_dynamic(STIMER_IRQ_NUM + CONFIG_2ND_LVL_ISR_TBL_OFFSET, 2, stimer_irq_handler, NULL, 0); - ChipLogDetail(DeviceLayer, "Stimer IRQ assigned vector %d", ret); - - /* Resetup rf interrupt to handle BLE stack */ - ret = irq_connect_dynamic(RF_IRQ_NUM + CONFIG_2ND_LVL_ISR_TBL_OFFSET, 2, rf_irq_handler, NULL, 0); - ChipLogDetail(DeviceLayer, "RF IRQ assigned vector %d", ret); - -exit: - - return err; -} - -CHIP_ERROR BLEManagerImpl::_InitGap(void) -{ - ble_sts_t status = BLE_SUCCESS; - /* Fifo buffers */ - static u8 txFifoBuff[CHIP_BLE_TX_FIFO_SIZE * CHIP_BLE_TX_FIFO_NUM] = { 0 }; - static u8 rxFifoBuff[CHIP_BLE_RX_FIFO_SIZE * CHIP_BLE_RX_FIFO_NUM] = { 0 }; - - status = blc_ll_initAclConnTxFifo(txFifoBuff, CHIP_BLE_TX_FIFO_SIZE, CHIP_BLE_TX_FIFO_NUM); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to init BLE TX FIFO. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; - } - - status = blc_ll_initAclConnRxFifo(rxFifoBuff, CHIP_BLE_RX_FIFO_SIZE, CHIP_BLE_RX_FIFO_NUM); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to init BLE RX FIFO. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; - } - - status = blc_controller_check_appBufferInitialization(); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Buffer initialization check failed. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; - } - - /* Init GAP */ - blc_gap_peripheral_init(); - - /* Set up GATT Services */ - _InitGatt(); - - /* L2CAP Initialization */ - blc_l2cap_register_handler((void *) blc_l2cap_packet_receive); - - /* Setup connect/terminate callbacks */ - bls_app_registerEventCallback(BLT_EV_FLAG_CONNECT, BLEManagerImpl::ConnectCallback); - bls_app_registerEventCallback(BLT_EV_FLAG_TERMINATE, BLEManagerImpl::DisconnectCallback); - - /* Add GAP event handler to handle indication send */ - blc_gap_registerHostEventHandler(BLEManagerImpl::GapEventHandler); - blc_gap_setEventMask(GAP_EVT_MASK_GATT_HANDLE_VLAUE_CONFIRM); - - /* Set MTU */ - status = blc_att_setRxMtuSize(CHIP_MTU_SIZE); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to set MTU size. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; - } - - return CHIP_NO_ERROR; -} - -void BLEManagerImpl::_InitGatt(void) -{ - /* UUIDs */ - static const u16 primaryServiceUUID = GATT_UUID_PRIMARY_SERVICE; - static const u16 gapServiceUUID = SERVICE_UUID_GENERIC_ACCESS; - static const u16 characterUUID = GATT_UUID_CHARACTER; - static const u16 devNameUUID = GATT_UUID_DEVICE_NAME; - static const u16 gattServiceUUID = SERVICE_UUID_GENERIC_ATTRIBUTE; - static const u16 serviceChangeUUID = GATT_UUID_SERVICE_CHANGE; - static const u16 clientCharacterCfgUUID = GATT_UUID_CLIENT_CHAR_CFG; - static const u16 devServiceUUID = SERVICE_UUID_DEVICE_INFORMATION; - static const u16 appearanceUUID = GATT_UUID_APPEARANCE; - static const u16 periConnParamUUID = GATT_UUID_PERI_CONN_PARAM; - static const u8 MatterRxCharUUID[] = WRAPPING_BRACES(CHIP_RX_CHAR_UUID); - static const u8 MatterTxCharUUID[] = WRAPPING_BRACES(CHIP_TX_CHAR_UUID); - - /* Characteristics */ - static const u8 devNameCharVal[] = { CHAR_PROP_READ | CHAR_PROP_NOTIFY, U16_LO(GenericAccess_DeviceName_DP_H), - U16_HI(GenericAccess_DeviceName_DP_H), U16_LO(GATT_UUID_DEVICE_NAME), - U16_HI(GATT_UUID_DEVICE_NAME) }; - - static const u8 appearanceCharVal[] = { CHAR_PROP_READ, U16_LO(GenericAccess_Appearance_DP_H), - U16_HI(GenericAccess_Appearance_DP_H), U16_LO(GATT_UUID_APPEARANCE), - U16_HI(GATT_UUID_APPEARANCE) }; - - static const u8 periConnParamCharVal[] = { CHAR_PROP_READ, U16_LO(CONN_PARAM_DP_H), U16_HI(CONN_PARAM_DP_H), - U16_LO(GATT_UUID_PERI_CONN_PARAM), U16_HI(GATT_UUID_PERI_CONN_PARAM) }; - - static const u8 serviceChangeCharVal[] = { CHAR_PROP_INDICATE, U16_LO(GenericAttribute_ServiceChanged_DP_H), - U16_HI(GenericAttribute_ServiceChanged_DP_H), U16_LO(GATT_UUID_SERVICE_CHANGE), - U16_HI(GATT_UUID_SERVICE_CHANGE) }; - - static const u8 MatterRxCharVal[] = { CHAR_PROP_WRITE | CHAR_PROP_WRITE_WITHOUT_RSP, U16_LO(Matter_RX_DP_H), - U16_HI(Matter_RX_DP_H), CHIP_RX_CHAR_UUID }; - - static const u8 MatterTxCharVal[] = { CHAR_PROP_INDICATE, U16_LO(Matter_TX_DP_H), U16_HI(Matter_TX_DP_H), CHIP_TX_CHAR_UUID }; - - /* Values */ - static const u16 appearance = GAP_APPEARE_UNKNOWN; - static const gap_periConnectParams_t periConnParameters = { 8, 11, 0, 1000 }; - static u16 serviceChangeVal[2] = { 0 }; - static u8 serviceChangeCCC[2] = { 0 }; - static u8 matterTxCCC[2] = { 0 }; - - static const attribute_t gattTable[] = { - /* Total number of attributes */ - { ATT_END_H - 1, 0, 0, 0, 0, 0 }, - - /* 0001 - 0007 GAP service */ - { 7, ATT_PERMISSIONS_READ, 2, 2, (u8 *) (&primaryServiceUUID), (u8 *) (&gapServiceUUID), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(devNameCharVal), (u8 *) (&characterUUID), (u8 *) (devNameCharVal), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, (u32) kMaxDeviceNameLength, (u8 *) (&devNameUUID), (u8 *) (mDeviceName), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(appearanceCharVal), (u8 *) (&characterUUID), (u8 *) (appearanceCharVal), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(appearance), (u8 *) (&appearanceUUID), (u8 *) (&appearance), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(periConnParamCharVal), (u8 *) (&characterUUID), (u8 *) (periConnParamCharVal), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(periConnParameters), (u8 *) (&periConnParamUUID), (u8 *) (&periConnParameters), 0 }, - - /* 0008 - 000b GATT */ - { 4, ATT_PERMISSIONS_READ, 2, 2, (u8 *) (&primaryServiceUUID), (u8 *) (&gattServiceUUID), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(serviceChangeCharVal), (u8 *) (&characterUUID), (u8 *) (serviceChangeCharVal), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(serviceChangeVal), (u8 *) (&serviceChangeUUID), (u8 *) (&serviceChangeVal), 0 }, - { 0, ATT_PERMISSIONS_RDWR, 2, sizeof(serviceChangeCCC), (u8 *) (&clientCharacterCfgUUID), (u8 *) (serviceChangeCCC), 0 }, - - /* 000c - 0011 Matter service */ - { 6, ATT_PERMISSIONS_READ, 2, 2, (u8 *) (&primaryServiceUUID), (u8 *) (&matterServiceUUID), 0 }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(MatterRxCharVal), (u8 *) (&characterUUID), (u8 *) (MatterRxCharVal), 0 }, - { 0, ATT_PERMISSIONS_RDWR, 16, sizeof(mRxDataBuff), (u8 *) (&MatterRxCharUUID), mRxDataBuff, RxWriteCallback, NULL }, - { 0, ATT_PERMISSIONS_READ, 2, sizeof(MatterTxCharVal), (u8 *) (&characterUUID), (u8 *) (MatterTxCharVal), 0 }, - { 0, ATT_PERMISSIONS_RDWR, 16, sizeof(mTxDataBuff), (u8 *) (&MatterTxCharUUID), mTxDataBuff, 0 }, - { 0, ATT_PERMISSIONS_RDWR, 2, sizeof(matterTxCCC), (u8 *) (&clientCharacterCfgUUID), (u8 *) (matterTxCCC), - TxCccWriteCallback, NULL } - }; - - bls_att_setAttributeTable((u8 *) gattTable); -} - -CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) -{ - ble_sts_t status = BLE_SUCCESS; - CHIP_ERROR err = CHIP_NO_ERROR; - uint8_t index = 0; - uint8_t devNameLen = 0; - ChipBLEDeviceIdentificationInfo deviceIdInfo; - u8 adv[CHIP_MAX_ADV_DATA_LEN] = { 0 }; - u8 srsp[CHIP_MAX_RESPONSE_DATA_LEN] = { 0 }; - - ChipLogProgress(DeviceLayer, "BLEManagerImpl::ConfigureAdvertisingData"); - - /* Get BLE device identification info */ - err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(deviceIdInfo); - SuccessOrExit(err); - - /* Check device name */ - if (!mFlags.Has(Flags::kDeviceNameSet)) - { - err = _SetDeviceName("TelinkMatter"); - SuccessOrExit(err); - } - - /* Fulfill BLE advertisement data */ - /* Set flags */ - adv[index++] = CHIP_ADE_DATA_LEN_FLAGS; - adv[index++] = CHIP_ADV_DATA_TYPE_FLAGS; - adv[index++] = CHIP_ADV_DATA_FLAGS; - - /* Set Service Data */ - adv[index++] = CHIP_ADV_SERVICE_DATA_LEN; - adv[index++] = CHIP_ADV_DATA_TYPE_SERVICE_DATA; - adv[index++] = matterServiceUUID[0]; - adv[index++] = matterServiceUUID[1]; - memcpy(&adv[index], (void *) &deviceIdInfo, sizeof(deviceIdInfo)); - index += sizeof(deviceIdInfo); - - /* Set device name */ - devNameLen = strlen(mDeviceName); - adv[index++] = devNameLen + 1; - adv[index++] = CHIP_ADV_DATA_TYPE_NAME; - memcpy(&adv[index], mDeviceName, devNameLen); - index += devNameLen; - - /* Set advetisment data */ - status = bls_ll_setAdvData(adv, index); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to set BLE advertisement data. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; - } - - index = 0; - srsp[index++] = CHIP_SHORT_UUID_LEN + 1; - srsp[index++] = CHIP_ADV_DATA_TYPE_UUID; - srsp[index++] = matterServiceUUID[0]; - srsp[index++] = matterServiceUUID[1]; - - /* Set scan response data */ - status = bls_ll_setScanRspData(srsp, sizeof(srsp)); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to set BLE scan response data. Error %d", status); + ChipLogProgress(DeviceLayer, "Thread provisioned. Start advertisement not possible"); return CHIP_ERROR_INCORRECT_STATE; } -exit: - return err; -} - -CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - VerifyOrReturnError(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, - CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); - - if (mFlags.Has(Flags::kAdvertisingEnabled) != val) + if (!BLERadioInitialized) { - ChipLogDetail(DeviceLayer, "CHIPoBLE advertising set to %s", val ? "on" : "off"); + char bt_dev_name[CONFIG_BT_DEVICE_NAME_MAX]; + strncpy(bt_dev_name, bt_get_name(), sizeof(bt_dev_name)); + /* Block IEEE802154 */ + /* @todo: move to RadioSwitch module*/ + const struct device * radio_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_ieee802154)); + __ASSERT(radio_dev != NULL, "Fail to get radio device"); + b91_deinit(radio_dev); - mFlags.Set(Flags::kAdvertisingEnabled, val); - PlatformMgr().ScheduleWork(DriveBLEState, 0); + /* Init BLE stack */ + err = bt_enable(NULL); + VerifyOrReturnError(err == 0, MapErrorZephyr(err)); + (void) bt_set_name(bt_dev_name); + BLERadioInitialized = true; } - return err; -} + bt_le_adv_param advParams = + BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME, intervalMin, intervalMax, nullptr); -CHIP_ERROR BLEManagerImpl::StartAdvertising(void) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - ble_sts_t status = BLE_SUCCESS; - - /* At first run always select fast advertising, on the next attempt slow down interval. */ - u16 intervalMin = mFlags.Has(Flags::kFastAdvertisingEnabled) ? CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MIN - : CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN; - u16 intervalMax = mFlags.Has(Flags::kFastAdvertisingEnabled) ? CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_INTERVAL_MAX - : CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX; - - if (ConnectivityMgr().IsThreadProvisioned()) - { - ChipLogProgress(DeviceLayer, "Thread provisioned. Start advertisement not possible"); - - return CHIP_ERROR_INCORRECT_STATE; - } + // Define advertising and, if BLE device name is set, scan response data + ServiceData serviceData; + const uint8_t advFlags = BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR; + const bt_data advertisingData[] = { BT_DATA(BT_DATA_FLAGS, &advFlags, sizeof(advFlags)), + BT_DATA(BT_DATA_SVC_DATA16, &serviceData, sizeof(serviceData)) }; - /* Block IEEE802154 */ - /* @todo: move to RadioSwitch module*/ - const struct device * radio_dev = device_get_binding(CONFIG_NET_CONFIG_IEEE802154_DEV_NAME); - __ASSERT(radio_dev != NULL, "Fail to get radio device"); - b91_deinit(radio_dev); + const char * deviceName = bt_get_name(); + const uint8_t deviceNameSize = static_cast(strlen(deviceName)); + const bt_data scanResponseData[] = { BT_DATA(BT_DATA_NAME_COMPLETE, deviceName, deviceNameSize) }; + const bt_data * scanResponseDataPtr = deviceNameSize > 0 ? scanResponseData : nullptr; + const size_t scanResponseDataLen = deviceNameSize > 0 ? ARRAY_SIZE(scanResponseData) : 0u; - /* It is time to init BLE stack */ - err = _InitStack(); - if (err != CHIP_NO_ERROR) + // Register dynamically CHIPoBLE GATT service + if (!mFlags.Has(Flags::kChipoBleGattServiceRegister)) { - ChipLogError(DeviceLayer, "Fail to init BLE stack"); + err = bt_gatt_service_register(&sChipoBleService); - return err; - } + if (err != 0) + ChipLogError(DeviceLayer, "Failed to register CHIPoBLE GATT service"); - /* Configure CHIP BLE advertisement data */ - err = ConfigureAdvertisingData(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "Fail to config BLE advertisement data"); + VerifyOrReturnError(err == 0, MapErrorZephyr(err)); - return err; + mFlags.Set(Flags::kChipoBleGattServiceRegister); } - /* Setup advertisement parameters */ - status = bls_ll_setAdvParam(intervalMin, intervalMax, ADV_TYPE_CONNECTABLE_UNDIRECTED, OWN_ADDRESS_PUBLIC, 0, NULL, - BLT_ENABLE_ADV_ALL, ADV_FP_NONE); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to set BLE advertisement parameters. Error %d", status); + // Initialize service data + static_assert(sizeof(serviceData) == 10, "Size of BLE advertisement data changed! Was that intentional?"); + chip::Encoding::LittleEndian::Put16(serviceData.uuid, UUID16_CHIPoBLEService.val); + ReturnErrorOnFailure(ConfigurationMgr().GetBLEDeviceIdentificationInfo(serviceData.deviceIdInfo)); - return CHIP_ERROR_INCORRECT_STATE; - } +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + ReturnErrorOnFailure(PrepareC3CharData()); +#endif - /* Enable advertisement */ - status = bls_ll_setAdvEnable(BLC_ADV_ENABLE); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to start BLE advertisement. Error %d", status); + // Restart advertising + err = bt_le_adv_stop(); + VerifyOrReturnError(err == 0, MapErrorZephyr(err)); - return CHIP_ERROR_INCORRECT_STATE; - } + err = bt_le_adv_start(&advParams, advertisingData, ARRAY_SIZE(advertisingData), scanResponseDataPtr, scanResponseDataLen); + VerifyOrReturnError(err == 0, MapErrorZephyr(err)); // Transition to the Advertising state... if (!mFlags.Has(Flags::kAdvertising)) @@ -686,16 +344,11 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) } } - /* Start BLE Task */ - k_thread_resume(chipBleThread); - - return err; + return CHIP_NO_ERROR; } CHIP_ERROR BLEManagerImpl::StopAdvertising(void) { - ble_sts_t status = BLE_SUCCESS; - if (ConnectivityMgr().IsThreadProvisioned()) { ChipLogProgress(DeviceLayer, "Thread provisioned. Advertisement already stopped at this stage"); @@ -703,14 +356,8 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return CHIP_ERROR_INCORRECT_STATE; } - /* Disable advertisement */ - status = bls_ll_setAdvEnable(BLC_ADV_DISABLE); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to stop BLE advertisement. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; - } + int err = bt_le_adv_stop(); + VerifyOrReturnError(err == 0, MapErrorZephyr(err)); // Transition to the not Advertising state... if (mFlags.Has(Flags::kAdvertising)) @@ -735,6 +382,22 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) return CHIP_NO_ERROR; } +CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) +{ + VerifyOrReturnError(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, + CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + + if (mFlags.Has(Flags::kAdvertisingEnabled) != val) + { + ChipLogDetail(DeviceLayer, "CHIPoBLE advertising set to %s", val ? "on" : "off"); + + mFlags.Set(Flags::kAdvertisingEnabled, val); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + } + + return CHIP_NO_ERROR; +} + CHIP_ERROR BLEManagerImpl::_SetAdvertisingMode(BLEAdvertisingMode mode) { switch (mode) @@ -755,47 +418,190 @@ CHIP_ERROR BLEManagerImpl::_SetAdvertisingMode(BLEAdvertisingMode mode) CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize) { - if (strlen(mDeviceName) >= bufSize) - { - return CHIP_ERROR_BUFFER_TOO_SMALL; - } - strcpy(buf, mDeviceName); + Platform::CopyString(buf, bufSize, bt_get_name()); return CHIP_NO_ERROR; } -CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * devName) +CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName) { - if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported) { - ChipLogError(DeviceLayer, "Unsupported"); - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } - if (devName == NULL || devName[0] == 0) + ChipLogDetail(DeviceLayer, "Device name set to: %s", deviceName); + return MapErrorZephyr(bt_set_name(deviceName)); +} + +CHIP_ERROR BLEManagerImpl::HandleGAPConnect(const ChipDeviceEvent * event) +{ + const BleConnEventType * connEvent = &event->Platform.BleConnEvent; + + if (connEvent->HciResult == BT_HCI_ERR_SUCCESS) + { + ChipLogProgress(DeviceLayer, "BLE connection established (ConnId: 0x%02x)", bt_conn_index(connEvent->BtConn)); + mGAPConns++; + } + else { - ChipLogError(DeviceLayer, "Invalid name"); + ChipLogError(DeviceLayer, "BLE connection failed (reason: 0x%02x)", connEvent->HciResult); + } - return CHIP_ERROR_INVALID_ARGUMENT; + ChipLogProgress(DeviceLayer, "Current number of connections: %u/%u", NumConnections(), CONFIG_BT_MAX_CONN); + + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + + mconId = connEvent->BtConn; + bt_conn_unref(connEvent->BtConn); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BLEManagerImpl::HandleGAPDisconnect(const ChipDeviceEvent * event) +{ + const BleConnEventType * connEvent = &event->Platform.BleConnEvent; + + ChipLogProgress(DeviceLayer, "BLE GAP connection terminated (reason 0x%02x)", connEvent->HciResult); + + mGAPConns--; + + // If indications were enabled for this connection, record that they are now disabled and + // notify the BLE Layer of a disconnect. + if (UnsetSubscribed(connEvent->BtConn)) + { + CHIP_ERROR disconReason; + switch (connEvent->HciResult) + { + case BT_HCI_ERR_REMOTE_USER_TERM_CONN: + // Do not treat proper connection termination as an error and exit. + VerifyOrExit(!ConfigurationMgr().IsFullyProvisioned(), ); + disconReason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED; + break; + case BT_HCI_ERR_LOCALHOST_TERM_CONN: + disconReason = BLE_ERROR_APP_CLOSED_CONNECTION; + break; + default: + disconReason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; + break; + } + HandleConnectionError(connEvent->BtConn, disconReason); } - if (strlen(devName) >= kMaxDeviceNameLength) +exit: + // Unref bt_conn before scheduling DriveBLEState. + bt_conn_unref(connEvent->BtConn); + + ChipLogProgress(DeviceLayer, "Current number of connections: %u/%u", NumConnections(), CONFIG_BT_MAX_CONN); + + ChipDeviceEvent disconnectEvent; + disconnectEvent.Type = DeviceEventType::kCHIPoBLEConnectionClosed; + ReturnErrorOnFailure(PlatformMgr().PostEvent(&disconnectEvent)); + + // Force a reconfiguration of advertising in case we switched to non-connectable mode when + // the BLE connection was established. + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BLEManagerImpl::HandleTXCharCCCDWrite(const ChipDeviceEvent * event) +{ + const BleCCCWriteEventType * writeEvent = &event->Platform.BleCCCWriteEvent; + + ChipLogDetail(DeviceLayer, "ConnId: 0x%02x, New CCCD value: 0x%04x", bt_conn_index(writeEvent->BtConn), writeEvent->Value); + + // If the client has requested to enable indications and if it is not yet subscribed + if (writeEvent->Value == BT_GATT_CCC_INDICATE && SetSubscribed(writeEvent->BtConn)) { - ChipLogError(DeviceLayer, "BLE device name is to long"); + // Alert the BLE layer that CHIPoBLE "subscribe" has been received and increment the bt_conn reference counter. + HandleSubscribeReceived(writeEvent->BtConn, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); - return CHIP_ERROR_INVALID_ARGUMENT; + ChipLogProgress(DeviceLayer, "CHIPoBLE connection established (ConnId: 0x%02x, GATT MTU: %u)", + bt_conn_index(writeEvent->BtConn), GetMTU(writeEvent->BtConn)); + + // Post a CHIPoBLEConnectionEstablished event to the DeviceLayer and the application. + { + ChipDeviceEvent conEstEvent; + conEstEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished; + ReturnErrorOnFailure(PlatformMgr().PostEvent(&conEstEvent)); + } } + else + { + if (UnsetSubscribed(writeEvent->BtConn)) + { + HandleUnsubscribeReceived(writeEvent->BtConn, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + } + } + + bt_conn_unref(writeEvent->BtConn); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR BLEManagerImpl::HandleRXCharWrite(const ChipDeviceEvent * event) +{ + const BleC1WriteEventType * c1WriteEvent = &event->Platform.BleC1WriteEvent; - strcpy(mDeviceName, devName); - mFlags.Set(Flags::kDeviceNameSet); + ChipLogDetail(DeviceLayer, "Write request received for CHIPoBLE RX characteristic (ConnId 0x%02x)", + bt_conn_index(c1WriteEvent->BtConn)); - ChipLogProgress(DeviceLayer, "Setting device name to : \"%s\"", devName); + HandleWriteReceived(c1WriteEvent->BtConn, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_RX, + PacketBufferHandle::Adopt(c1WriteEvent->Data)); + bt_conn_unref(c1WriteEvent->BtConn); return CHIP_NO_ERROR; } +CHIP_ERROR BLEManagerImpl::HandleTXCharComplete(const ChipDeviceEvent * event) +{ + const BleC2IndDoneEventType * c2IndDoneEvent = &event->Platform.BleC2IndDoneEvent; + + ChipLogDetail(DeviceLayer, "Indication for CHIPoBLE TX characteristic done (ConnId 0x%02x, result 0x%02x)", + bt_conn_index(c2IndDoneEvent->BtConn), c2IndDoneEvent->Result); + + // Signal the BLE Layer that the outstanding indication is complete. + HandleIndicationConfirmation(c2IndDoneEvent->BtConn, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + bt_conn_unref(c2IndDoneEvent->BtConn); + + return CHIP_NO_ERROR; +} + +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING +CHIP_ERROR BLEManagerImpl::PrepareC3CharData() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + BitFlags additionalDataFields; + AdditionalDataPayloadGeneratorParams additionalDataPayloadParams; + +#if CHIP_ENABLE_ROTATING_DEVICE_ID && defined(CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID) + uint8_t rotatingDeviceIdUniqueId[ConfigurationManager::kRotatingDeviceIDUniqueIDLength] = {}; + MutableByteSpan rotatingDeviceIdUniqueIdSpan(rotatingDeviceIdUniqueId); + + err = DeviceLayer::GetDeviceInstanceInfoProvider()->GetRotatingDeviceIdUniqueId(rotatingDeviceIdUniqueIdSpan); + SuccessOrExit(err); + err = ConfigurationMgr().GetLifetimeCounter(additionalDataPayloadParams.rotatingDeviceIdLifetimeCounter); + SuccessOrExit(err); + additionalDataPayloadParams.rotatingDeviceIdUniqueId = rotatingDeviceIdUniqueIdSpan; + additionalDataFields.Set(AdditionalDataFields::RotatingDeviceId); +#endif /* CHIP_ENABLE_ROTATING_DEVICE_ID && defined(CHIP_DEVICE_CONFIG_ROTATING_DEVICE_ID_UNIQUE_ID) */ + + err = AdditionalDataPayloadGenerator().generateAdditionalDataPayload(additionalDataPayloadParams, c3CharDataBufferHandle, + additionalDataFields); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Failed to generate TLV encoded Additional Data (%s)", __func__); + } + + return err; +} +#endif + void BLEManagerImpl::HandleBLEAdvertisementIntervalChange(System::Layer * layer, void * param) { BLEMgr().SetAdvertisingMode(BLEAdvertisingMode::kSlowAdvertising); @@ -808,27 +614,23 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) switch (event->Type) { - case DeviceEventType::kPlatformTelinkBleConnected: + case DeviceEventType::kPlatformZephyrBleConnected: err = HandleGAPConnect(event); break; - case DeviceEventType::kPlatformTelinkBleDisconnected: + case DeviceEventType::kPlatformZephyrBleDisconnected: err = HandleGAPDisconnect(event); break; - case DeviceEventType::kPlatformTelinkBleDisconnectRequest: - err = HandleDisconnectRequest(event); + case DeviceEventType::kPlatformZephyrBleCCCWrite: + err = HandleTXCharCCCDWrite(event); break; - case DeviceEventType::kPlatformTelinkBleRXWrite: + case DeviceEventType::kPlatformZephyrBleC1WriteEvent: err = HandleRXCharWrite(event); break; - case DeviceEventType::kPlatformTelinkBleCCCWrite: - err = HandleTXCharCCCDWrite(event); - break; - - case DeviceEventType::kPlatformTelinkBleTXComplete: + case DeviceEventType::kPlatformZephyrBleC2IndDoneEvent: err = HandleTXCharComplete(event); break; @@ -845,216 +647,261 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) break; default: - ChipLogDetail(DeviceLayer, "Event: Unknown (0x%04x)", event->Type); + break; } if (err != CHIP_NO_ERROR) { - ChipLogError(DeviceLayer, "Fail to handle 0x%04x event. Error: %s", event->Type, ErrorStr(err)); + ChipLogError(DeviceLayer, "Disabling CHIPoBLE service due to error: %" CHIP_ERROR_FORMAT, err.Format()); mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Disabled; PlatformMgr().ScheduleWork(DriveBLEState, 0); } } -bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +uint16_t BLEManagerImpl::_NumConnections(void) { - return false; + return mGAPConns; } -bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId) { - return false; + ChipLogProgress(DeviceLayer, "Closing BLE GATT connection (ConnId %02x)", bt_conn_index(conId)); + return bt_conn_disconnect(conId, BT_HCI_ERR_REMOTE_USER_TERM_CONN) == 0; } -bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId) +uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const { - return false; + return bt_gatt_get_mtu(conId); } -uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const +bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) { - return blc_att_getEffectiveMtuSize(conId); + ChipLogError(DeviceLayer, "%s: NOT IMPLEMENTED", __PRETTY_FUNCTION__); + return true; +} + +bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogError(DeviceLayer, "%s: NOT IMPLEMENTED", __PRETTY_FUNCTION__); + return true; } bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, PacketBufferHandle pBuf) { - ble_sts_t status = BLE_SUCCESS; + CHIP_ERROR err = CHIP_NO_ERROR; + int status = 0; + uint8_t index = bt_conn_index(conId); + bt_gatt_indicate_params * params = &mIndicateParams[index]; - do - { - if (status != BLE_SUCCESS) - { - k_msleep(1); - } - status = blc_gatt_pushHandleValueIndicate(conId, Matter_TX_DP_H, pBuf->Start(), pBuf->DataLength()); - } while (status == GATT_ERR_DATA_PENDING_DUE_TO_SERVICE_DISCOVERY_BUSY); - if (status != BLE_SUCCESS) - { - ChipLogError(DeviceLayer, "Fail to send indication. Error %d", status); + VerifyOrExit(IsSubscribed(conId) == true, err = CHIP_ERROR_INVALID_ARGUMENT); + + ChipLogDetail(DeviceLayer, "Sending indication for CHIPoBLE TX characteristic (ConnId %02x, len %u)", index, + pBuf->DataLength()); + + params->uuid = nullptr; + params->attr = &sChipoBleAttributes[kCHIPoBLE_CCC_AttributeIndex]; + params->func = HandleTXIndicated; + params->data = pBuf->Start(); + params->len = pBuf->DataLength(); - return false; + status = bt_gatt_indicate(conId, params); + VerifyOrExit(status == 0, err = MapErrorZephyr(status)); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "BLEManagerImpl::SendIndication() failed: %" CHIP_ERROR_FORMAT, err.Format()); } - return true; + return err == CHIP_NO_ERROR; } bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, PacketBufferHandle pBuf) { - ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendWriteRequest() not supported"); - return false; + ChipLogError(DeviceLayer, "%s: NOT IMPLEMENTED", __PRETTY_FUNCTION__); + return true; } bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, PacketBufferHandle pBuf) { - ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadRequest() not supported"); - return false; + ChipLogError(DeviceLayer, "%s: NOT IMPLEMENTED", __PRETTY_FUNCTION__); + return true; } bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, const ChipBleUUID * svcId, const ChipBleUUID * charId) { - ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadResponse() not supported"); - return false; + ChipLogError(DeviceLayer, "%s: NOT IMPLEMENTED", __PRETTY_FUNCTION__); + return true; } -/* @todo: move to RadioSwitch module */ -void BLEManagerImpl::SwitchToIeee802154(void) +void BLEManagerImpl::NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) { - int result = 0; + CloseConnection(conId); +} - ChipLogProgress(DeviceLayer, "BLEManagerImpl::Switch to IEEE802154"); +bool BLEManagerImpl::IsSubscribed(bt_conn * conn) +{ + return mSubscribedConns[bt_conn_index(conn)]; +} - /* Stop BLE */ - _SetAdvertisingEnabled(false); +bool BLEManagerImpl::SetSubscribed(bt_conn * conn) +{ + uint8_t index = bt_conn_index(conn); + bool isSubscribed = mSubscribedConns[index]; + mSubscribedConns[index] = true; - /* Stop BLE task */ - k_thread_suspend(chipBleThread); + // If we were not subscribed previously, increment the reference counter of the connection. + if (!isSubscribed) + { + bt_conn_ref(conn); + } - /* Reset Radio */ - rf_radio_reset(); + return !isSubscribed; +} - /* Reset DMA */ - rf_reset_dma(); +bool BLEManagerImpl::UnsetSubscribed(bt_conn * conn) +{ + uint8_t index = bt_conn_index(conn); + bool isSubscribed = mSubscribedConns[index]; + mSubscribedConns[index] = false; - const struct device * radio_dev = device_get_binding(CONFIG_NET_CONFIG_IEEE802154_DEV_NAME); - __ASSERT(radio_dev != NULL, "Fail to get radio device"); + // If we were subscribed previously, decrement the reference counter of the connection. + if (isSubscribed) + { + bt_conn_unref(conn); + } - /* Init IEEE802154 */ - result = b91_init(radio_dev); - __ASSERT(result == 0, "Fail to init IEEE802154 radio. Error: %d", result); + return isSubscribed; } -void BLEManagerImpl::NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) {} - -uint16_t BLEManagerImpl::_NumConnections(void) +ssize_t BLEManagerImpl::HandleRXWrite(struct bt_conn * conId, const struct bt_gatt_attr * attr, const void * buf, uint16_t len, + uint16_t offset, uint8_t flags) { - return mGAPConns; -} + ChipDeviceEvent event; + PacketBufferHandle packetBuf = PacketBufferHandle::NewWithData(buf, len); -/// @todo implement multicinnection subscription -CHIP_ERROR BLEManagerImpl::SetSubscribed(uint16_t conId) -{ + if (!packetBuf.IsNull()) + { + // Arrange to post a CHIPoBLERXWriteEvent event to the CHIP queue. + event.Type = DeviceEventType::kPlatformZephyrBleC1WriteEvent; + event.Platform.BleC1WriteEvent.BtConn = bt_conn_ref(conId); + event.Platform.BleC1WriteEvent.Data = std::move(packetBuf).UnsafeRelease(); + } + + // If we failed to allocate a buffer, post a kPlatformZephyrBleOutOfBuffersEvent event. + else + { + event.Type = DeviceEventType::kPlatformZephyrBleOutOfBuffersEvent; + } - mSubscribedConns[0] = true; + PlatformMgr().PostEventOrDie(&event); - return CHIP_NO_ERROR; + return len; } -/// @todo implement multicinnection subscription -bool BLEManagerImpl::UnsetSubscribed(uint16_t conId) +ssize_t BLEManagerImpl::HandleTXCCCWrite(struct bt_conn * conId, const struct bt_gatt_attr * attr, uint16_t value) { + ChipDeviceEvent event; - mSubscribedConns[0] = false; + if (value != BT_GATT_CCC_INDICATE && value != 0) + { + return BT_GATT_ERR(BT_ATT_ERR_VALUE_NOT_ALLOWED); + } - return true; + event.Type = DeviceEventType::kPlatformZephyrBleCCCWrite; + event.Platform.BleCCCWriteEvent.BtConn = bt_conn_ref(conId); + event.Platform.BleCCCWriteEvent.Value = value; + + PlatformMgr().PostEventOrDie(&event); + + return sizeof(value); } -/// @todo implement multicinnection subscription -bool BLEManagerImpl::IsSubscribed(uint16_t conId) +void BLEManagerImpl::HandleTXIndicated(struct bt_conn * conId, struct bt_gatt_indicate_params * attr, uint8_t err) { - return mSubscribedConns[0]; + ChipDeviceEvent event; + + event.Type = DeviceEventType::kPlatformZephyrBleC2IndDoneEvent; + event.Platform.BleC2IndDoneEvent.BtConn = bt_conn_ref(conId); + event.Platform.BleC2IndDoneEvent.Result = err; + + PlatformMgr().PostEventOrDie(&event); } -CHIP_ERROR BLEManagerImpl::HandleGAPConnect(const ChipDeviceEvent * event) +void BLEManagerImpl::HandleConnect(struct bt_conn * conId, uint8_t err) { - const BleConnEventType * connEvent = &event->Platform.BleConnEvent; + ChipDeviceEvent event; - ChipLogProgress(DeviceLayer, "BLE connection established (ConnId: 0x%02x)", connEvent->connHandle); - mGAPConns++; - ChipLogProgress(DeviceLayer, "Current number of connections: %u/%u", NumConnections(), kMaxConnections); + PlatformMgr().LockChipStack(); - mFlags.Set(Flags::kAdvertisingRefreshNeeded); - PlatformMgr().ScheduleWork(DriveBLEState, 0); + // Don't handle BLE connecting events when it is not related to CHIPoBLE + VerifyOrExit(sInstance.mFlags.Has(Flags::kChipoBleGattServiceRegister), ); - return CHIP_NO_ERROR; -} + event.Type = DeviceEventType::kPlatformZephyrBleConnected; + event.Platform.BleConnEvent.BtConn = bt_conn_ref(conId); + event.Platform.BleConnEvent.HciResult = err; -CHIP_ERROR BLEManagerImpl::HandleGAPDisconnect(const ChipDeviceEvent * event) -{ - const BleConnEventType * connEvent = &event->Platform.BleConnEvent; + PlatformMgr().PostEventOrDie(&event); - ChipLogProgress(DeviceLayer, "BLE GAP connection terminated (reason 0x%02x)", connEvent->HciResult); +exit: + PlatformMgr().UnlockChipStack(); +} - mGAPConns--; +void BLEManagerImpl::HandleDisconnect(struct bt_conn * conId, uint8_t reason) +{ + ChipDeviceEvent event; - ChipLogProgress(DeviceLayer, "Current number of connections: %u/%u", NumConnections(), kMaxConnections); + PlatformMgr().LockChipStack(); - // Unsubscribe - if (UnsetSubscribed(connEvent->connHandle)) - { - HandleUnsubscribeReceived(connEvent->connHandle, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); - } + // Don't handle BLE disconnecting events when it is not related to CHIPoBLE + VerifyOrExit(sInstance.mFlags.Has(Flags::kChipoBleGattServiceRegister), ); - ChipDeviceEvent disconnectEvent; - disconnectEvent.Type = DeviceEventType::kCHIPoBLEConnectionClosed; - ReturnErrorOnFailure(PlatformMgr().PostEvent(&disconnectEvent)); + event.Type = DeviceEventType::kPlatformZephyrBleDisconnected; + event.Platform.BleConnEvent.BtConn = bt_conn_ref(conId); + event.Platform.BleConnEvent.HciResult = reason; - // Force a reconfiguration of advertising in case we switched to non-connectable mode when - // the BLE connection was established. - mFlags.Set(Flags::kAdvertisingRefreshNeeded); - PlatformMgr().ScheduleWork(DriveBLEState, 0); + PlatformMgr().PostEventOrDie(&event); - return CHIP_NO_ERROR; +exit: + PlatformMgr().UnlockChipStack(); } -CHIP_ERROR BLEManagerImpl::HandleDisconnectRequest(const ChipDeviceEvent * event) +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING +ssize_t BLEManagerImpl::HandleC3Read(struct bt_conn * conId, const struct bt_gatt_attr * attr, void * buf, uint16_t len, + uint16_t offset) { - ble_sts_t status = BLE_SUCCESS; - uint16_t handle = event->Platform.BleConnEvent.connHandle; - uint8_t reason = event->Platform.BleConnEvent.HciResult; - - ChipLogDetail(DeviceLayer, "HandleDisconnectRequest"); + ChipLogDetail(DeviceLayer, "Read request received for CHIPoBLE C3 (ConnId 0x%02x)", bt_conn_index(conId)); - /* Trigger disconnect. DisconnectCallback call occures on completion */ - status = blc_ll_disconnect(handle, reason); - if (status != BLE_SUCCESS && status != LL_ERR_CONNECTION_NOT_ESTABLISH) + if (sInstance.c3CharDataBufferHandle.IsNull()) { - ChipLogError(DeviceLayer, "Fail to disconnect. Error %d", status); - - return CHIP_ERROR_INCORRECT_STATE; + return 0; } - // Force a reconfiguration of advertising in case we switched to non-connectable mode when - // the BLE connection was established. - mFlags.Set(Flags::kAdvertisingRefreshNeeded); - PlatformMgr().ScheduleWork(DriveBLEState, 0); + return bt_gatt_attr_read(conId, attr, buf, len, offset, sInstance.c3CharDataBufferHandle->Start(), + sInstance.c3CharDataBufferHandle->DataLength()); +} +#endif - return CHIP_NO_ERROR; +void BLEManagerImpl::BLEConnDisconnect(System::Layer * layer, void * param) +{ + int error = bt_conn_disconnect(BLEMgrImpl().mconId, BT_HCI_ERR_LOCALHOST_TERM_CONN); + if (error) + { + ChipLogError(DeviceLayer, "Failed to close BLE connection, error: %d", error); + } } CHIP_ERROR BLEManagerImpl::HandleOperationalNetworkEnabled(const ChipDeviceEvent * event) { - ChipDeviceEvent disconnectEvent; ChipLogDetail(DeviceLayer, "HandleOperationalNetworkEnabled"); - disconnectEvent.Type = DeviceEventType::kPlatformTelinkBleDisconnectRequest; - disconnectEvent.Platform.BleConnEvent.connHandle = BLS_CONN_HANDLE; - disconnectEvent.Platform.BleConnEvent.HciResult = CHIP_BLE_DISCONNECT_REASON; - ReturnErrorOnFailure(PlatformMgr().PostEvent(&disconnectEvent)); + // Start timer to close BLE connection. + DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(20), BLEConnDisconnect, this); return CHIP_NO_ERROR; } @@ -1094,61 +941,27 @@ CHIP_ERROR BLEManagerImpl::HandleBleConnectionClosed(const ChipDeviceEvent * eve return CHIP_NO_ERROR; } -CHIP_ERROR BLEManagerImpl::HandleRXCharWrite(const ChipDeviceEvent * event) -{ - const BleRXWriteEventType * writeEvent = &event->Platform.BleRXWriteEvent; - - ChipLogDetail(DeviceLayer, "Write request received for CHIPoBLE RX (ConnId 0x%02x)", writeEvent->connHandle); - - HandleWriteReceived(writeEvent->connHandle, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_RX, - PacketBufferHandle::Adopt(writeEvent->Data)); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR BLEManagerImpl::HandleTXCharComplete(const ChipDeviceEvent * event) -{ - const BleTXCompleteEventType * completeEvent = &event->Platform.BleTXCompleteEvent; - - ChipLogDetail(DeviceLayer, "Notification for CHIPoBLE TX done (ConnId 0x%02x)", completeEvent->connHandle); - - // Signal the BLE Layer that the outstanding notification is complete. - HandleIndicationConfirmation(completeEvent->connHandle, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR BLEManagerImpl::HandleTXCharCCCDWrite(const ChipDeviceEvent * event) +/* @todo: move to RadioSwitch module */ +void BLEManagerImpl::SwitchToIeee802154(void) { - const BleCCCWriteEventType * writeEvent = &event->Platform.BleCCCWriteEvent; + int result = 0; - ChipLogDetail(DeviceLayer, "ConnId: 0x%02x, New CCCD value: 0x%04x", writeEvent->connHandle, writeEvent->Value); + ChipLogProgress(DeviceLayer, "BLEManagerImpl::Switch to IEEE802154"); - /* If the client has requested to enable notifications and if it is not yet subscribed */ - if (writeEvent->Value != 0 && SetSubscribed(writeEvent->connHandle) == CHIP_NO_ERROR) - { - /* Alert the BLE layer that CHIPoBLE "subscribe" has been received and increment the bt_conn reference counter. */ - HandleSubscribeReceived(writeEvent->connHandle, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + /* Stop BLE */ + StopAdvertising(); - ChipLogProgress(DeviceLayer, "CHIPoBLE connection established (ConnId: 0x%02x, GATT MTU: %d)", writeEvent->connHandle, - GetMTU(writeEvent->connHandle)); + /* Deinit BLE stack */ + bt_disable(); + // irq_disable(IRQ1_SYSTIMER); + BLERadioInitialized = false; - /* Post a CHIPoBLEConnectionEstablished event to the DeviceLayer and the application. */ - { - ChipDeviceEvent conEstEvent; - conEstEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished; - ReturnErrorOnFailure(PlatformMgr().PostEvent(&conEstEvent)); - } - } - else - { - if (UnsetSubscribed(writeEvent->connHandle)) - { - HandleUnsubscribeReceived(writeEvent->connHandle, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); - } - } + const struct device * radio_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_ieee802154)); + __ASSERT(radio_dev != NULL, "Fail to get radio device"); - return CHIP_NO_ERROR; + /* Init IEEE802154 */ + result = b91_init(radio_dev); + __ASSERT(result == 0, "Fail to init IEEE802154 radio. Error: %d", result); } } // namespace Internal diff --git a/src/platform/telink/BLEManagerImpl.h b/src/platform/telink/BLEManagerImpl.h index d1b79718b347b7..f6fcbf87c8e584 100644 --- a/src/platform/telink/BLEManagerImpl.h +++ b/src/platform/telink/BLEManagerImpl.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,13 +18,20 @@ /** * @file * Provides an implementation of the BLEManager object - * for Telink platform. + * for Telink platforms, by including Zephyr platform + * implementation. */ #pragma once #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#include +#include + +#include + namespace chip { namespace DeviceLayer { namespace Internal { @@ -32,7 +39,7 @@ namespace Internal { using namespace chip::Ble; /** - * Concrete implementation of the BLEManager singleton object for the platform. + * Concrete implementation of the BLEManager singleton object for the Zephyr platforms. */ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePlatformDelegate, private BleApplicationDelegate { @@ -41,10 +48,10 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla friend BLEManager; private: - // Members that implement the BLEManager internal interface. + // ===== Members that implement the BLEManager internal interface. CHIP_ERROR _Init(void); - void _Shutdown(); + void _Shutdown() {} bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); bool _IsAdvertising(void); @@ -55,7 +62,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla void _OnPlatformEvent(const ChipDeviceEvent * event); BleLayer * _GetBleLayer(void); - // Members that implement virtual methods on BlePlatformDelegate. + // ===== Members that implement virtual methods on BlePlatformDelegate. bool SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; bool UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; @@ -70,62 +77,42 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla bool SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; - // Members that implement virtual methods on BleApplicationDelegate. + // ===== Members that implement virtual methods on BleApplicationDelegate. void NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) override; - // Members for internal use by the following friends. - - friend BLEManager & BLEMgr(void); - friend BLEManagerImpl & BLEMgrImpl(void); - - static BLEManagerImpl sInstance; - - // Private members reserved for use by this class only. + // ===== Private members reserved for use by this class only. - enum class Flags : uint16_t + enum class Flags : uint8_t { - kAsyncInitCompleted = 0x0001, /**< One-time asynchronous initialization actions have been performed. */ - kAdvertisingEnabled = 0x0002, /**< The application has enabled CHIPoBLE advertising. */ - kFastAdvertisingEnabled = 0x0004, /**< The application has enabled fast advertising. */ - kAdvertising = 0x0008, /**< The system is currently CHIPoBLE advertising. */ - kAdvertisingRefreshNeeded = 0x0010, /**< The advertising state/configuration state in the BLE layer needs to be updated. */ - kDeviceNameSet = 0x0020, /**< The device name has been set. */ - kRestartAdvertising = 0x0040, /**< The advertising will be restarted when stop advertising confirmation is received and this - flag is set*/ + kAsyncInitCompleted = 0x0001, /**< One-time asynchronous initialization actions have been performed. */ + kAdvertisingEnabled = 0x0002, /**< The application has enabled CHIPoBLE advertising. */ + kFastAdvertisingEnabled = 0x0004, /**< The application has enabled fast advertising. */ + kAdvertising = 0x0008, /**< The system is currently CHIPoBLE advertising. */ + kAdvertisingRefreshNeeded = + 0x0010, /**< The advertising state/configuration has changed, but the SoftDevice has yet to be updated. */ + kChipoBleGattServiceRegister = 0x0020, /**< The system has currently CHIPoBLE GATT service registered. */ }; - enum - { - kMaxConnections = BLE_LAYER_NUM_BLE_ENDPOINTS, - kMaxDeviceNameLength = 16, - kMaxAdvertisementDataSetSize = 31, - kMaxRxDataBuffSize = 20, - kMaxTxDataBuffSize = 20 - }; + struct ServiceData; - CHIPoBLEServiceMode mServiceMode; BitFlags mFlags; - char mDeviceName[kMaxDeviceNameLength + 1]; uint16_t mGAPConns; - bool mSubscribedConns[kMaxConnections]; - uint8_t mAdvDataBuf[kMaxAdvertisementDataSetSize]; - uint8_t mScanRespDataBuf[kMaxAdvertisementDataSetSize]; - uint8_t mRxDataBuff[kMaxRxDataBuffSize]; - uint8_t mTxDataBuff[kMaxRxDataBuffSize]; - bool ThreadConnectivityReady; + CHIPoBLEServiceMode mServiceMode; + bool mSubscribedConns[CONFIG_BT_MAX_CONN]; + bt_gatt_indicate_params mIndicateParams[CONFIG_BT_MAX_CONN]; + bt_conn_cb mConnCallbacks; + bt_conn * mconId; +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + PacketBufferHandle c3CharDataBufferHandle; +#endif void DriveBLEState(void); - CHIP_ERROR ConfigureAdvertisingData(void); + CHIP_ERROR ConfigureAdvertising(void); CHIP_ERROR StartAdvertising(void); CHIP_ERROR StopAdvertising(void); - CHIP_ERROR SetSubscribed(uint16_t conId); - bool UnsetSubscribed(uint16_t conId); - bool IsSubscribed(uint16_t conId); - CHIP_ERROR HandleGAPConnect(const ChipDeviceEvent * event); CHIP_ERROR HandleGAPDisconnect(const ChipDeviceEvent * event); - CHIP_ERROR HandleDisconnectRequest(const ChipDeviceEvent * event); CHIP_ERROR HandleRXCharWrite(const ChipDeviceEvent * event); CHIP_ERROR HandleTXCharCCCDWrite(const ChipDeviceEvent * event); CHIP_ERROR HandleTXCharComplete(const ChipDeviceEvent * event); @@ -140,33 +127,43 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla */ CHIP_ERROR HandleThreadStateChange(const ChipDeviceEvent * event); CHIP_ERROR HandleOperationalNetworkEnabled(const ChipDeviceEvent * event); + static void BLEConnDisconnect(chip::System::Layer * aLayer, void * aAppState); + +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + CHIP_ERROR PrepareC3CharData(); +#endif + bool IsSubscribed(bt_conn * conn); + bool SetSubscribed(bt_conn * conn); + bool UnsetSubscribed(bt_conn * conn); + uint32_t GetAdvertisingInterval(); - /* Callbacks from BLE stack*/ static void DriveBLEState(intptr_t arg); + // Below callbacks run from the system workqueue context and have a limited stack capacity. + static void HandleTXIndicated(bt_conn * conn, bt_gatt_indicate_params * attr, uint8_t err); + static void HandleConnect(bt_conn * conn, uint8_t err); + static void HandleDisconnect(bt_conn * conn, uint8_t reason); static void HandleBLEAdvertisementIntervalChange(System::Layer * layer, void * param); - /* Handlers for stack events */ - static void CancelBleAdvTimeoutTimer(void); - static void StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs); + // ===== Members for internal use by the following friends. + + friend BLEManager & BLEMgr(void); + friend BLEManagerImpl & BLEMgrImpl(void); - /* Other init functions */ - CHIP_ERROR _InitStack(void); - void _InitGatt(void); - CHIP_ERROR _InitGap(void); + static BLEManagerImpl sInstance; public: - static int RxWriteCallback(uint16_t connHandle, void * p); - static int TxCccWriteCallback(uint16_t connHandle, void * p); - static void ConnectCallback(uint8_t event, uint8_t * data, int len); - static void DisconnectCallback(uint8_t event, uint8_t * data, int len); - static int GapEventHandler(uint32_t event, uint8_t * data, int size); + // Below callbacks are public in order to be visible from the global scope. + static ssize_t HandleRXWrite(bt_conn * conn, const bt_gatt_attr * attr, const void * buf, uint16_t len, uint16_t offset, + uint8_t flags); + static ssize_t HandleTXCCCWrite(bt_conn * conn, const bt_gatt_attr * attr, uint16_t value); + +#if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING + static ssize_t HandleC3Read(struct bt_conn * conn, const struct bt_gatt_attr * attr, void * buf, uint16_t len, uint16_t offset); +#endif /* Switch to IEEE802154 interface. @todo: remove to other module? */ void SwitchToIeee802154(void); - - /* BLE thread entry */ - static void BleEntry(void *, void *, void *); }; /** @@ -184,7 +181,7 @@ inline BLEManager & BLEMgr(void) * Returns the platform-specific implementation of the BLEManager singleton object. * * Internal components can use this to gain access to features of the BLEManager - * that are specific to the platform. + * that are specific to the Zephyr platforms. */ inline BLEManagerImpl & BLEMgrImpl(void) { diff --git a/src/platform/telink/BUILD.gn b/src/platform/telink/BUILD.gn index 1a4c90395dbe7c..da7e1f39e57d0d 100644 --- a/src/platform/telink/BUILD.gn +++ b/src/platform/telink/BUILD.gn @@ -13,7 +13,6 @@ # limitations under the License. import("//build_overrides/chip.gni") -import("//build_overrides/telink.gni") import("${chip_root}/src/platform/device.gni") import("${chip_root}/src/platform/telink/args.gni") @@ -48,18 +47,13 @@ static_library("telink") { "SystemPlatformConfig.h", ] - deps = [] - public = [ "${chip_root}/src/credentials/CHIPCert.h", "${chip_root}/src/credentials/CertificationDeclaration.h", "${chip_root}/src/credentials/DeviceAttestationCredsProvider.h", ] - public_deps = [ - "${chip_root}/src/platform:platform_base", - "${telink_sdk_build_root}", - ] + public_deps = [ "${chip_root}/src/platform:platform_base" ] if (chip_enable_factory_data) { sources += [ diff --git a/src/platform/telink/BlePlatformConfig.h b/src/platform/telink/BlePlatformConfig.h index 6b451d7b88c1ca..8667470deffb68 100644 --- a/src/platform/telink/BlePlatformConfig.h +++ b/src/platform/telink/BlePlatformConfig.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,10 +24,12 @@ #pragma once +#include + // ==================== Platform Adaptations ==================== -#define BLE_CONNECTION_OBJECT uint16_t -#define BLE_CONNECTION_UNINITIALIZED ((uint16_t) 0xFFFF) +#define BLE_CONNECTION_OBJECT bt_conn * +#define BLE_CONNECTION_UNINITIALIZED nullptr #define BLE_MAX_RECEIVE_WINDOW_SIZE 5 // ========== Platform-specific Configuration Overrides ========= diff --git a/src/platform/telink/CHIPDevicePlatformConfig.h b/src/platform/telink/CHIPDevicePlatformConfig.h index 6af8812f70d5a8..28c93f1d4e6ee9 100644 --- a/src/platform/telink/CHIPDevicePlatformConfig.h +++ b/src/platform/telink/CHIPDevicePlatformConfig.h @@ -92,6 +92,8 @@ #define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_NET_L2_OPENTHREAD +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_BT + // ========== Platform-specific Configuration ========= // These are configuration options that are unique to Zephyr platforms. @@ -175,7 +177,7 @@ // ========== Platform-specific Configuration Overrides ========= #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY -#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY (K_PRIO_COOP(CONFIG_NUM_COOP_PRIORITIES - 1)) +#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY (K_PRIO_PREEMPT(1)) #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE @@ -195,15 +197,17 @@ #endif // CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART #ifdef CONFIG_CHIP_ENABLE_DNSSD_SRP -#define CHIP_DEVICE_CONFIG_ENABLE_MDNS 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DISCOVERY 1 #ifdef CONFIG_CHIP_ENABLE_DNS_CLIENT #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 #endif // CONFIG_CHIP_ENABLE_DNS_CLIENT #endif // CONFIG_CHIP_ENABLE_DNSSD_SRP +#ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 +#endif // CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE + #ifdef CONFIG_CHIP_DEVICE_TYPE #define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_CHIP_DEVICE_TYPE #endif // CONFIG_CHIP_DEVICE_TYPE diff --git a/src/platform/telink/CHIPDevicePlatformEvent.h b/src/platform/telink/CHIPDevicePlatformEvent.h index b04059508c1bf6..a1f53347bc9c5a 100644 --- a/src/platform/telink/CHIPDevicePlatformEvent.h +++ b/src/platform/telink/CHIPDevicePlatformEvent.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,76 +24,4 @@ #pragma once -#include - -#include - -namespace chip { -namespace DeviceLayer { - -namespace DeviceEventType { - -/** - * Enumerates Telink platform-specific event types that are visible to the application. - */ -enum PublicPlatformSpecificEventTypes -{ - /* None currently defined */ -}; - -/** - * Enumerates Telink platform-specific event types that are internal to the chip Device Layer. - */ -enum InternalPlatformSpecificEventTypes -{ - kPlatformTelinkEvent = kRange_InternalPlatformSpecific, - kPlatformTelinkBleConnected, - kPlatformTelinkBleDisconnected, - kPlatformTelinkBleDisconnectRequest, - kPlatformTelinkBleCCCWrite, - kPlatformTelinkBleRXWrite, - kPlatformTelinkBleTXComplete, - kPlatformTelinkBleOutOfBuffersEvent, -}; - -} // namespace DeviceEventType - -struct BleConnEventType -{ - uint16_t connHandle; - uint8_t HciResult; -}; - -struct BleCCCWriteEventType -{ - uint16_t connHandle; - uint16_t Value; -}; - -struct BleRXWriteEventType -{ - uint16_t connHandle; - ::chip::System::PacketBuffer * Data; -}; - -struct BleTXCompleteEventType -{ - uint16_t connHandle; -}; - -/** - * Represents platform-specific event information for Zephyr platforms. - */ -struct ChipDevicePlatformEvent final -{ - union - { - BleConnEventType BleConnEvent; - BleCCCWriteEventType BleCCCWriteEvent; - BleRXWriteEventType BleRXWriteEvent; - BleTXCompleteEventType BleTXCompleteEvent; - }; -}; - -} // namespace DeviceLayer -} // namespace chip +#include diff --git a/src/platform/telink/CHIPPlatformConfig.h b/src/platform/telink/CHIPPlatformConfig.h index 85cc1c85736c75..f78ab8791d1253 100644 --- a/src/platform/telink/CHIPPlatformConfig.h +++ b/src/platform/telink/CHIPPlatformConfig.h @@ -30,24 +30,24 @@ #define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE const char * #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2 -/** - * @def CHIP_CONFIG_MAX_FABRICS - * - * @brief - * Maximum number of fabrics the device can participate in. Each fabric can - * provision the device with its unique operational credentials and manage - * its own access control lists. - */ -#ifndef CHIP_CONFIG_MAX_FABRICS -#define CHIP_CONFIG_MAX_FABRICS 5 // 4 fabrics + 1 for rotation slack -#endif +#define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY "rc" // ==================== Security Adaptations ==================== +#ifdef CONFIG_CHIP_CRYPTO_PSA +#define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(psa_hash_operation_t) +#elif defined(CONFIG_CC3XX_BACKEND) +// Size of the statically allocated context for SHA256 operations in CryptoPAL +// determined empirically. +#define CHIP_CONFIG_SHA256_CONTEXT_SIZE 244 +#else +#define CHIP_CONFIG_SHA256_CONTEXT_SIZE 208 +#endif + // ==================== General Configuration Overrides ==================== #ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS -#define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS 16 +#define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS 8 #endif // CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS #ifndef CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS @@ -61,3 +61,7 @@ #ifndef CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS #define CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS 1 #endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS + +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif diff --git a/src/platform/telink/FactoryDataProvider.h b/src/platform/telink/FactoryDataProvider.h index 040a0d44ca9ba8..829831e554aa33 100644 --- a/src/platform/telink/FactoryDataProvider.h +++ b/src/platform/telink/FactoryDataProvider.h @@ -34,8 +34,8 @@ struct InternalFlashFactoryData { CHIP_ERROR GetFactoryDataPartition(uint8_t *& data, size_t & dataSize) { - data = reinterpret_cast(FLASH_AREA_OFFSET(factory_data)); - dataSize = FLASH_AREA_SIZE(factory_data); + data = reinterpret_cast(FIXED_PARTITION_OFFSET(factory_partition)); + dataSize = FIXED_PARTITION_SIZE(factory_partition); return CHIP_NO_ERROR; } @@ -46,7 +46,8 @@ struct ExternalFlashFactoryData { CHIP_ERROR GetFactoryDataPartition(uint8_t *& data, size_t & dataSize) { - int ret = flash_read(mFlashDevice, FLASH_AREA_OFFSET(factory_data), mFactoryDataBuffer, FLASH_AREA_SIZE(factory_data)); + int ret = flash_read(mFlashDevice, FIXED_PARTITION_OFFSET(factory_partition), mFactoryDataBuffer, + FIXED_PARTITION_SIZE(factory_partition)); if (ret != 0) { @@ -54,7 +55,7 @@ struct ExternalFlashFactoryData } data = mFactoryDataBuffer; - dataSize = FLASH_AREA_SIZE(factory_data); + dataSize = FIXED_PARTITION_SIZE(factory_partition); return CHIP_NO_ERROR; } @@ -62,7 +63,7 @@ struct ExternalFlashFactoryData CHIP_ERROR ProtectFactoryDataPartitionAgainstWrite() { return CHIP_ERROR_NOT_IMPLEMENTED; } const struct device * mFlashDevice = DEVICE_DT_GET(DT_CHOSEN(zephyr_flash_controller)); - uint8_t mFactoryDataBuffer[FLASH_AREA_SIZE(factory_data)]; + uint8_t mFactoryDataBuffer[FIXED_PARTITION_SIZE(factory_partition)]; }; template @@ -107,8 +108,8 @@ class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentia CHIP_ERROR GetEnableKey(MutableByteSpan & enableKey); private: - static constexpr uint16_t kFactoryDataPartitionSize = FLASH_AREA_SIZE(factory_data); - static constexpr uint32_t kFactoryDataPartitionAddress = FLASH_AREA_OFFSET(factory_data); + static constexpr uint16_t kFactoryDataPartitionSize = FIXED_PARTITION_SIZE(factory_partition); + static constexpr uint32_t kFactoryDataPartitionAddress = FIXED_PARTITION_OFFSET(factory_partition); static constexpr uint8_t kDACPrivateKeyLength = 32; static constexpr uint8_t kDACPublicKeyLength = 65; diff --git a/src/platform/telink/OTAImageProcessorImpl.cpp b/src/platform/telink/OTAImageProcessorImpl.cpp index f0c3c4de5cdd35..b5649820dace72 100644 --- a/src/platform/telink/OTAImageProcessorImpl.cpp +++ b/src/platform/telink/OTAImageProcessorImpl.cpp @@ -52,8 +52,8 @@ CHIP_ERROR OTAImageProcessorImpl::PrepareDownloadImpl() return System::MapErrorZephyr(-EFAULT); } - int err = - stream_flash_init(&stream, flash_dev, mBuffer, sizeof(mBuffer), FLASH_AREA_OFFSET(image_1), FLASH_AREA_SIZE(image_1), NULL); + int err = stream_flash_init(&stream, flash_dev, mBuffer, sizeof(mBuffer), FIXED_PARTITION_OFFSET(slot1_partition), + FIXED_PARTITION_SIZE(slot1_partition), NULL); if (err) { diff --git a/third_party/telink_sdk/BUILD.gn b/third_party/telink_sdk/BUILD.gn deleted file mode 100644 index ac8b84a8177e0a..00000000000000 --- a/third_party/telink_sdk/BUILD.gn +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/telink.gni") - -config("telink_sdk_config") { - include_dirs = [ - "${telink_sdk_build_root}/repo/eagle_ble_sdk", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/drivers/B91", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/stack/ble", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/stack/ble/controller", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/vendor/common", - ] - - libs = [ - "${telink_sdk_build_root}/repo/eagle_ble_sdk/proj_lib/libB91_ble_lib.a", - ] - - defines = [ - "USE_ZEPHYR_HAL_HEADERS", - "MCU_CORE_TYPE = MCU_CORE_9518", - ] - - cflags = [] -} - -source_set("telink_sdk") { - sources = [ - "${telink_sdk_build_root}/repo/eagle_ble_sdk/common/utility.c", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/drivers/B91/aes.c", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/drivers/B91/ext_driver/software_pa.c", - "${telink_sdk_build_root}/repo/eagle_ble_sdk/vendor/common/blt_common.c", - ] - - public_configs = [ ":telink_sdk_config" ] -} diff --git a/third_party/telink_sdk/repo b/third_party/telink_sdk/repo deleted file mode 160000 index 6a3cb0a3615cf7..00000000000000 --- a/third_party/telink_sdk/repo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6a3cb0a3615cf7f2f0418440d3ae9d93f6f3e595 From 46b2114ce3bb1710df3d9684cc34475b1a852b1d Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 2 Dec 2022 11:37:15 -0500 Subject: [PATCH 18/30] [IC-Device] Initial Structure for client monitoring cluster (#23838) * Initial Structure for client monitoring cluster * generated files * Review Comments * generated files * fix xml file * generated files * fix conflict * Update cluster xml * regen --- src/app/chip_data_model.gni | 1 + .../client-monitoring-server.cpp | 52 ++++ .../client-monitoring-server.h | 23 ++ src/app/zap-templates/zcl/data-model/all.xml | 1 + .../chip/client-monitoring-cluster.xml | 52 ++++ .../zcl/zcl-with-test-extensions.json | 1 + src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.py | 2 + .../python/chip/clusters/Objects.py | 229 +++++++++++++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 59 +++++ .../zap-generated/MTRCommandPayloadsObjc.h | 44 ++++ .../zap-generated/MTRCommandPayloadsObjc.mm | 57 +++++ .../CHIP/zap-generated/MTRStructsObjc.h | 9 + .../CHIP/zap-generated/MTRStructsObjc.mm | 34 +++ .../app-common/zap-generated/af-structs.h | 8 + .../app-common/zap-generated/attribute-id.h | 10 + .../zap-generated/attributes/Accessors.cpp | 161 ++++++++++++ .../zap-generated/attributes/Accessors.h | 31 +++ .../app-common/zap-generated/callback.h | 118 +++++++++ .../app-common/zap-generated/cluster-enums.h | 3 + .../app-common/zap-generated/cluster-id.h | 239 ++++++++++++++++++ .../zap-generated/cluster-objects.cpp | 193 ++++++++++++++ .../zap-generated/cluster-objects.h | 222 ++++++++++++++++ .../app-common/zap-generated/command-id.h | 4 + .../app-common/zap-generated/ids/Attributes.h | 42 +++ .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 14 + .../app-common/zap-generated/print-cluster.h | 7 + .../zap-generated/cluster/Commands.h | 131 ++++++++++ .../cluster/ComplexArgumentParser.cpp | 32 +++ .../cluster/ComplexArgumentParser.h | 4 + .../cluster/logging/DataModelLogger.cpp | 33 +++ .../cluster/logging/DataModelLogger.h | 2 + .../zap-generated/cluster/Commands.h | 1 + 34 files changed, 1823 insertions(+) create mode 100644 src/app/clusters/client-monitoring-server/client-monitoring-server.cpp create mode 100644 src/app/clusters/client-monitoring-server/client-monitoring-server.h create mode 100644 src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml create mode 100644 zzz_generated/app-common/app-common/zap-generated/cluster-id.h diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index ecab5a9d02a465..6e336f94929eb2 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -101,6 +101,7 @@ template("chip_data_model") { sources += [ "${_app_root}/clusters/barrier-control-server/barrier-control-server.h", "${_app_root}/clusters/basic/basic.h", + "${_app_root}/clusters/client-monitoring-server/client-monitoring-server.h", "${_app_root}/clusters/color-control-server/color-control-server.h", "${_app_root}/clusters/door-lock-server/door-lock-server.h", "${_app_root}/clusters/groups-server/groups-server.h", diff --git a/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp b/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp new file mode 100644 index 00000000000000..02cc4bfcb9ae85 --- /dev/null +++ b/src/app/clusters/client-monitoring-server/client-monitoring-server.cpp @@ -0,0 +1,52 @@ +/** + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "client-monitoring-server.h" + +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ClientMonitoring; + +/** + * @brief Client Monitoring Cluster RegisterClientMonitoring Command callback (from client) + */ +bool emberAfClientMonitoringClusterRegisterClientMonitoringCallback( + app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + const Commands::RegisterClientMonitoring::DecodableType & commandData) +{ + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); + return false; +} +/** + * @brief Client Monitoring Cluster StayAwakeRequest Command callback (from client) + */ +bool emberAfClientMonitoringClusterStayAwakeRequestCallback(app::CommandHandler * commandObj, + const chip::app::ConcreteCommandPath & commandPath, + const Commands::StayAwakeRequest::DecodableType & commandData) +{ + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); + return false; +} + +void MatterClientMonitoringPluginServerInitCallback() {} diff --git a/src/app/clusters/client-monitoring-server/client-monitoring-server.h b/src/app/clusters/client-monitoring-server/client-monitoring-server.h new file mode 100644 index 00000000000000..68a536760f3990 --- /dev/null +++ b/src/app/clusters/client-monitoring-server/client-monitoring-server.h @@ -0,0 +1,23 @@ +/** + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index c050af49dcafa5..9126b0ff26101a 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -13,6 +13,7 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml new file mode 100644 index 00000000000000..9dc128947904c5 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + General + Client Monitoring + 0x1046 + CLIENT_MONITORING_CLUSTER + Client Monitoring allows for ensuring that listed clients meet the required monitoring conditions on the server. + IdleModeInterval + ActiveModeInterval + ActiveModeThreshold + + + ExpectedClients + + + Register a client to the end device + + + + + + + Request the end device to stay in Active Mode for an additional ActiveModeThreshold + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 241753199a7105..51f9acc0a93d58 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -25,6 +25,7 @@ "chip-ota.xml", "chip-types.xml", "channel-cluster.xml", + "client-monitoring-cluster.xml", "clusters-extensions.xml", "content-launch-cluster.xml", "descriptor-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 801b04b57c0c94..52f482acb70847 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -20,6 +20,7 @@ "chip-ota.xml", "chip-types.xml", "channel-cluster.xml", + "client-monitoring-cluster.xml", "clusters-extensions.xml", "content-launch-cluster.xml", "descriptor-cluster.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 11b3c21f05623b..9ef42c9b79b156 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -25,6 +25,7 @@ 'ACTIONS_CLUSTER': [], 'BRIDGED_DEVICE_BASIC_CLUSTER': ['bridged-device-basic-information-server'], 'CHANNEL_CLUSTER': ['channel-server'], + 'CLIENT_MONITORING_CLUSTER': ['client-monitoring-server'], 'COLOR_CONTROL_CLUSTER': ['color-control-server'], 'COMMISSIONING_CLUSTER': [], 'CONTENT_LAUNCHER_CLUSTER': ['content-launch-server'], @@ -110,6 +111,7 @@ 'ACTIONS_CLUSTER': [], 'BRIDGED_DEVICE_BASIC_CLUSTER': [], 'CHANNEL_CLUSTER': [], + 'CLIENT_MONITORING_CLUSTER': [], 'COLOR_CONTROL_CLUSTER': [], 'COMMISSIONING_CLUSTER': [], 'CONTENT_LAUNCHER_CLUSTER': [], diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ebe66dee75d117..84904704965102 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -26805,6 +26805,235 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: +@dataclass +class ClientMonitoring(Cluster): + id: typing.ClassVar[int] = 0x1046 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="idleModeInterval", Tag=0x00000000, Type=uint), + ClusterObjectFieldDescriptor(Label="activeModeInterval", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="activeModeThreshold", Tag=0x00000002, Type=uint), + ClusterObjectFieldDescriptor(Label="expectedClients", Tag=0x00000003, Type=typing.List[ClientMonitoring.Structs.MonitoringRegistration]), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + idleModeInterval: 'uint' = None + activeModeInterval: 'uint' = None + activeModeThreshold: 'uint' = None + expectedClients: 'typing.List[ClientMonitoring.Structs.MonitoringRegistration]' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + + class Structs: + @dataclass + class MonitoringRegistration(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="clientNodeId", Tag=1, Type=uint), + ClusterObjectFieldDescriptor(Label="ICid", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), + ]) + + clientNodeId: 'uint' = 0 + ICid: 'uint' = 0 + fabricIndex: 'uint' = 0 + + + + class Commands: + @dataclass + class RegisterClientMonitoring(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x1046 + command_id: typing.ClassVar[int] = 0x0000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ClusterObjectFieldDescriptor(Label="clientNodeId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="ICid", Tag=1, Type=uint), + ]) + + clientNodeId: 'uint' = 0 + ICid: 'uint' = 0 + + @dataclass + class StayAwakeRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x1046 + command_id: typing.ClassVar[int] = 0x0001 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ]) + + + + class Attributes: + @dataclass + class IdleModeInterval(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ActiveModeInterval(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ActiveModeThreshold(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ExpectedClients(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000003 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[ClientMonitoring.Structs.MonitoringRegistration]) + + value: 'typing.List[ClientMonitoring.Structs.MonitoringRegistration]' = field(default_factory=lambda: []) + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x1046 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + + @dataclass class UnitTesting(Cluster): id: typing.ClassVar[int] = 0xFFF1FC05 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 63896e7e95f830..d6b5c27d560ac4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -99,6 +99,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterApplicationBasicID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDTypeApplicationBasicID") = 0x0000050D, MTRClusterAccountLoginID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDTypeAccountLoginID") = 0x0000050E, MTRClusterElectricalMeasurementID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDTypeElectricalMeasurementID") = 0x00000B04, + MTRClusterClientMonitoringID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDTypeClientMonitoringID") = 0x00001046, MTRClusterTestClusterID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDTypeUnitTestingID") = 0xFFF1FC05, MTRClusterFaultInjectionID MTR_NEWLY_DEPRECATED("Please use MTRClusterIDTypeFaultInjectionID") = 0xFFF1FC06, MTRClusterIDTypeIdentifyID MTR_NEWLY_AVAILABLE = 0x00000003, @@ -170,6 +171,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeApplicationBasicID MTR_NEWLY_AVAILABLE = 0x0000050D, MTRClusterIDTypeAccountLoginID MTR_NEWLY_AVAILABLE = 0x0000050E, MTRClusterIDTypeElectricalMeasurementID MTR_NEWLY_AVAILABLE = 0x00000B04, + MTRClusterIDTypeClientMonitoringID MTR_NEWLY_AVAILABLE = 0x00001046, MTRClusterIDTypeUnitTestingID MTR_NEWLY_AVAILABLE = 0xFFF1FC05, MTRClusterIDTypeFaultInjectionID MTR_NEWLY_AVAILABLE = 0xFFF1FC06, }; @@ -4887,6 +4889,51 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterElectricalMeasurementAttributeClusterRevisionID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster ClientMonitoring deprecated attribute names + MTRClusterClientMonitoringAttributeIdleModeIntervalID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeIdleModeIntervalID") + = 0x00000000, + MTRClusterClientMonitoringAttributeActiveModeIntervalID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeIntervalID") + = 0x00000001, + MTRClusterClientMonitoringAttributeActiveModeThresholdID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeThresholdID") + = 0x00000002, + MTRClusterClientMonitoringAttributeExpectedClientsID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeExpectedClientsID") + = 0x00000003, + MTRClusterClientMonitoringAttributeGeneratedCommandListID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeGeneratedCommandListID") + = MTRClusterGlobalAttributeGeneratedCommandListID, + MTRClusterClientMonitoringAttributeAcceptedCommandListID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeAcceptedCommandListID") + = MTRClusterGlobalAttributeAcceptedCommandListID, + MTRClusterClientMonitoringAttributeAttributeListID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeAttributeListID") + = MTRClusterGlobalAttributeAttributeListID, + MTRClusterClientMonitoringAttributeFeatureMapID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeFeatureMapID") + = MTRClusterGlobalAttributeFeatureMapID, + MTRClusterClientMonitoringAttributeClusterRevisionID MTR_NEWLY_DEPRECATED( + "Please use MTRAttributeIDTypeClusterClientMonitoringAttributeClusterRevisionID") + = MTRClusterGlobalAttributeClusterRevisionID, + + // Cluster ClientMonitoring attributes + MTRAttributeIDTypeClusterClientMonitoringAttributeIdleModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterClientMonitoringAttributeActiveModeThresholdID MTR_NEWLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterClientMonitoringAttributeExpectedClientsID MTR_NEWLY_AVAILABLE = 0x00000003, + MTRAttributeIDTypeClusterClientMonitoringAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterClientMonitoringAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterClientMonitoringAttributeAttributeListID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterClientMonitoringAttributeFeatureMapID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterClientMonitoringAttributeClusterRevisionID MTR_NEWLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster TestCluster deprecated attribute names MTRClusterTestClusterAttributeBooleanID MTR_NEWLY_DEPRECATED( "Please use MTRAttributeIDTypeClusterUnitTestingAttributeBooleanID") @@ -6199,6 +6246,18 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterElectricalMeasurementCommandGetMeasurementProfileResponseCommandID MTR_NEWLY_AVAILABLE = 0x00000001, MTRCommandIDTypeClusterElectricalMeasurementCommandGetMeasurementProfileCommandID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster ClientMonitoring deprecated command id names + MTRClusterClientMonitoringCommandRegisterClientMonitoringID MTR_NEWLY_DEPRECATED( + "Please use MTRCommandIDTypeClusterClientMonitoringCommandRegisterClientMonitoringID") + = 0x00000000, + MTRClusterClientMonitoringCommandStayAwakeRequestID MTR_NEWLY_DEPRECATED( + "Please use MTRCommandIDTypeClusterClientMonitoringCommandStayAwakeRequestID") + = 0x00000001, + + // Cluster ClientMonitoring commands + MTRCommandIDTypeClusterClientMonitoringCommandRegisterClientMonitoringID MTR_NEWLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterClientMonitoringCommandStayAwakeRequestID MTR_NEWLY_AVAILABLE = 0x00000001, + // Cluster TestCluster deprecated command id names MTRClusterTestClusterCommandTestID MTR_NEWLY_DEPRECATED("Please use MTRCommandIDTypeClusterUnitTestingCommandTestID") = 0x00000000, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 6ce42082934421..e13a48473d1196 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5276,6 +5276,50 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; +- (instancetype)init; +- (id)copyWithZone:(NSZone * _Nullable)zone; +@end +@interface MTRClientMonitoringClusterRegisterClientMonitoringParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull clientNodeId; + +@property (nonatomic, copy) NSNumber * _Nonnull iCid; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +- (instancetype)init; +- (id)copyWithZone:(NSZone * _Nullable)zone; +@end +@interface MTRClientMonitoringClusterStayAwakeRequestParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + - (instancetype)init; - (id)copyWithZone:(NSZone * _Nullable)zone; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 744bd8ceaa80e1..0f925b15110406 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -6995,6 +6995,63 @@ - (NSString *)description return descriptionString; } +@end +@implementation MTRClientMonitoringClusterRegisterClientMonitoringParams +- (instancetype)init +{ + if (self = [super init]) { + + _clientNodeId = @(0); + + _iCid = @(0); + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRClientMonitoringClusterRegisterClientMonitoringParams alloc] init]; + + other.clientNodeId = self.clientNodeId; + other.iCid = self.iCid; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: clientNodeId:%@; iCid:%@; >", NSStringFromClass([self class]), _clientNodeId, _iCid]; + return descriptionString; +} + +@end +@implementation MTRClientMonitoringClusterStayAwakeRequestParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRClientMonitoringClusterStayAwakeRequestParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + @end @implementation MTRUnitTestingClusterTestParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 3fc761310b2e4f..d48d05149e0814 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -970,6 +970,15 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr - (id)copyWithZone:(NSZone * _Nullable)zone; @end +@interface MTRClientMonitoringClusterMonitoringRegistration : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull clientNodeId; +@property (nonatomic, copy) NSNumber * _Nonnull iCid; +@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; + +- (instancetype)init; +- (id)copyWithZone:(NSZone * _Nullable)zone; +@end + MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterSimpleStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull a; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 78f31666267b70..07769ead2b09aa 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3581,6 +3581,40 @@ - (NSString *)description @end +@implementation MTRClientMonitoringClusterMonitoringRegistration +- (instancetype)init +{ + if (self = [super init]) { + + _clientNodeId = @(0); + + _iCid = @(0); + + _fabricIndex = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRClientMonitoringClusterMonitoringRegistration alloc] init]; + + other.clientNodeId = self.clientNodeId; + other.iCid = self.iCid; + other.fabricIndex = self.fabricIndex; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: clientNodeId:%@; iCid:%@; fabricIndex:%@; >", + NSStringFromClass([self class]), _clientNodeId, _iCid, _fabricIndex]; + return descriptionString; +} + +@end + @implementation MTRUnitTestingClusterSimpleStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index 3c1d5866c587f0..504c6d137296ba 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -368,6 +368,14 @@ typedef struct _LineupInfo uint8_t lineupInfoType; } LineupInfo; +// Struct for MonitoringRegistration +typedef struct _MonitoringRegistration +{ + chip::NodeId ClientNodeId; + uint64_t ICid; + chip::FabricIndex FabricIndex; +} MonitoringRegistration; + // Struct for NOCStruct typedef struct _NOCStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index ae5e84a0245133..db53fc67718181 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -1133,6 +1133,16 @@ #define ZCL_RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID (0x0A16) #define ZCL_RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID (0x0A17) +// Attribute ids for cluster: Client Monitoring + +// Client attributes + +// Server attributes +#define ZCL_IDLE_MODE_INTERVAL_ATTRIBUTE_ID (0x0000) +#define ZCL_ACTIVE_MODE_INTERVAL_ATTRIBUTE_ID (0x0001) +#define ZCL_ACTIVE_MODE_THRESHOLD_ATTRIBUTE_ID (0x0002) +#define ZCL_EXPECTED_CLIENTS_ATTRIBUTE_ID (0x0003) + // Attribute ids for cluster: Unit Testing // Client attributes diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index aba2445a5cba5d..6b644145702ab1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -27727,6 +27727,167 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ElectricalMeasurement +namespace ClientMonitoring { +namespace Attributes { + +namespace IdleModeInterval { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace IdleModeInterval + +namespace ActiveModeInterval { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); +} + +} // namespace ActiveModeInterval + +namespace ActiveModeThreshold { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ActiveModeThreshold + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ClientMonitoring::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ClientMonitoring + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index e1e6b3dd21d05d..9f35b1e9624458 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -4652,6 +4652,37 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace ElectricalMeasurement +namespace ClientMonitoring { +namespace Attributes { + +namespace IdleModeInterval { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace IdleModeInterval + +namespace ActiveModeInterval { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // int32u +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace ActiveModeInterval + +namespace ActiveModeThreshold { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ActiveModeThreshold + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ClientMonitoring + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 6669d106cd3da8..8c82bc550c2a7e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -586,6 +586,14 @@ void emberAfAccountLoginClusterInitCallback(chip::EndpointId endpoint); */ void emberAfElectricalMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** @brief Client Monitoring Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfClientMonitoringClusterInitCallback(chip::EndpointId endpoint); + /** @brief Unit Testing Cluster Init * * Cluster Init @@ -7255,6 +7263,104 @@ void emberAfElectricalMeasurementClusterServerTickCallback(chip::EndpointId endp */ void emberAfElectricalMeasurementClusterClientTickCallback(chip::EndpointId endpoint); +// +// Client Monitoring Cluster +// + +/** @brief Client Monitoring Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfClientMonitoringClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Client Monitoring Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfClientMonitoringClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Client Monitoring Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterClientMonitoringClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Client Monitoring Cluster Server Message Sent + * + * Server Message Sent + * + * @param destination The destination to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfClientMonitoringClusterServerMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Client Monitoring Cluster Client Message Sent + * + * Client Message Sent + * + * @param destination The destination to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfClientMonitoringClusterClientMessageSentCallback(const chip::MessageSendDestination & destination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Client Monitoring Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterClientMonitoringClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Client Monitoring Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterClientMonitoringClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Client Monitoring Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfClientMonitoringClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Client Monitoring Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfClientMonitoringClusterClientTickCallback(chip::EndpointId endpoint); + // // Unit Testing Cluster // @@ -8695,6 +8801,18 @@ bool emberAfElectricalMeasurementClusterGetMeasurementProfileResponseCommandCall bool emberAfElectricalMeasurementClusterGetMeasurementProfileCommandCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::DecodableType & commandData); +/** + * @brief Client Monitoring Cluster RegisterClientMonitoring Command callback (from client) + */ +bool emberAfClientMonitoringClusterRegisterClientMonitoringCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::DecodableType & commandData); +/** + * @brief Client Monitoring Cluster StayAwakeRequest Command callback (from client) + */ +bool emberAfClientMonitoringClusterStayAwakeRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ClientMonitoring::Commands::StayAwakeRequest::DecodableType & commandData); /** * @brief Unit Testing Cluster Test Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index b71d81dba7eaaf..12cb3de9b1caaf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2273,6 +2273,9 @@ namespace AccountLogin { namespace ElectricalMeasurement { } // namespace ElectricalMeasurement +namespace ClientMonitoring { +} // namespace ClientMonitoring + namespace UnitTesting { // Enum for SimpleEnum diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-id.h b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h new file mode 100644 index 00000000000000..087eb6fd1ae65c --- /dev/null +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-id.h @@ -0,0 +1,239 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +// Prevent multiple inclusion +#pragma once + +#include + +// Definitions for cluster: Identify +static constexpr chip::ClusterId ZCL_IDENTIFY_CLUSTER_ID = 0x0003; + +// Definitions for cluster: Groups +static constexpr chip::ClusterId ZCL_GROUPS_CLUSTER_ID = 0x0004; + +// Definitions for cluster: Scenes +static constexpr chip::ClusterId ZCL_SCENES_CLUSTER_ID = 0x0005; + +// Definitions for cluster: On/Off +static constexpr chip::ClusterId ZCL_ON_OFF_CLUSTER_ID = 0x0006; + +// Definitions for cluster: On/off Switch Configuration +static constexpr chip::ClusterId ZCL_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_ID = 0x0007; + +// Definitions for cluster: Level Control +static constexpr chip::ClusterId ZCL_LEVEL_CONTROL_CLUSTER_ID = 0x0008; + +// Definitions for cluster: Binary Input (Basic) +static constexpr chip::ClusterId ZCL_BINARY_INPUT_BASIC_CLUSTER_ID = 0x000F; + +// Definitions for cluster: Pulse Width Modulation +static constexpr chip::ClusterId ZCL_PWM_CLUSTER_ID = 0x001C; + +// Definitions for cluster: Descriptor +static constexpr chip::ClusterId ZCL_DESCRIPTOR_CLUSTER_ID = 0x001D; + +// Definitions for cluster: Binding +static constexpr chip::ClusterId ZCL_BINDING_CLUSTER_ID = 0x001E; + +// Definitions for cluster: Access Control +static constexpr chip::ClusterId ZCL_ACCESS_CONTROL_CLUSTER_ID = 0x001F; + +// Definitions for cluster: Actions +static constexpr chip::ClusterId ZCL_ACTIONS_CLUSTER_ID = 0x0025; + +// Definitions for cluster: Basic +static constexpr chip::ClusterId ZCL_BASIC_CLUSTER_ID = 0x0028; + +// Definitions for cluster: OTA Software Update Provider +static constexpr chip::ClusterId ZCL_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_ID = 0x0029; + +// Definitions for cluster: OTA Software Update Requestor +static constexpr chip::ClusterId ZCL_OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER_ID = 0x002A; + +// Definitions for cluster: Localization Configuration +static constexpr chip::ClusterId ZCL_LOCALIZATION_CONFIGURATION_CLUSTER_ID = 0x002B; + +// Definitions for cluster: Time Format Localization +static constexpr chip::ClusterId ZCL_TIME_FORMAT_LOCALIZATION_CLUSTER_ID = 0x002C; + +// Definitions for cluster: Unit Localization +static constexpr chip::ClusterId ZCL_UNIT_LOCALIZATION_CLUSTER_ID = 0x002D; + +// Definitions for cluster: Power Source Configuration +static constexpr chip::ClusterId ZCL_POWER_SOURCE_CONFIGURATION_CLUSTER_ID = 0x002E; + +// Definitions for cluster: Power Source +static constexpr chip::ClusterId ZCL_POWER_SOURCE_CLUSTER_ID = 0x002F; + +// Definitions for cluster: General Commissioning +static constexpr chip::ClusterId ZCL_GENERAL_COMMISSIONING_CLUSTER_ID = 0x0030; + +// Definitions for cluster: Network Commissioning +static constexpr chip::ClusterId ZCL_NETWORK_COMMISSIONING_CLUSTER_ID = 0x0031; + +// Definitions for cluster: Diagnostic Logs +static constexpr chip::ClusterId ZCL_DIAGNOSTIC_LOGS_CLUSTER_ID = 0x0032; + +// Definitions for cluster: General Diagnostics +static constexpr chip::ClusterId ZCL_GENERAL_DIAGNOSTICS_CLUSTER_ID = 0x0033; + +// Definitions for cluster: Software Diagnostics +static constexpr chip::ClusterId ZCL_SOFTWARE_DIAGNOSTICS_CLUSTER_ID = 0x0034; + +// Definitions for cluster: Thread Network Diagnostics +static constexpr chip::ClusterId ZCL_THREAD_NETWORK_DIAGNOSTICS_CLUSTER_ID = 0x0035; + +// Definitions for cluster: WiFi Network Diagnostics +static constexpr chip::ClusterId ZCL_WIFI_NETWORK_DIAGNOSTICS_CLUSTER_ID = 0x0036; + +// Definitions for cluster: Ethernet Network Diagnostics +static constexpr chip::ClusterId ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID = 0x0037; + +// Definitions for cluster: Time Synchronization +static constexpr chip::ClusterId ZCL_TIME_SYNCHRONIZATION_CLUSTER_ID = 0x0038; + +// Definitions for cluster: Bridged Device Basic +static constexpr chip::ClusterId ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID = 0x0039; + +// Definitions for cluster: Switch +static constexpr chip::ClusterId ZCL_SWITCH_CLUSTER_ID = 0x003B; + +// Definitions for cluster: AdministratorCommissioning +static constexpr chip::ClusterId ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_ID = 0x003C; + +// Definitions for cluster: Operational Credentials +static constexpr chip::ClusterId ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID = 0x003E; + +// Definitions for cluster: Group Key Management +static constexpr chip::ClusterId ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID = 0x003F; + +// Definitions for cluster: Fixed Label +static constexpr chip::ClusterId ZCL_FIXED_LABEL_CLUSTER_ID = 0x0040; + +// Definitions for cluster: User Label +static constexpr chip::ClusterId ZCL_USER_LABEL_CLUSTER_ID = 0x0041; + +// Definitions for cluster: Proxy Configuration +static constexpr chip::ClusterId ZCL_PROXY_CONFIGURATION_CLUSTER_ID = 0x0042; + +// Definitions for cluster: Proxy Discovery +static constexpr chip::ClusterId ZCL_PROXY_DISCOVERY_CLUSTER_ID = 0x0043; + +// Definitions for cluster: Proxy Valid +static constexpr chip::ClusterId ZCL_PROXY_VALID_CLUSTER_ID = 0x0044; + +// Definitions for cluster: Boolean State +static constexpr chip::ClusterId ZCL_BOOLEAN_STATE_CLUSTER_ID = 0x0045; + +// Definitions for cluster: Client Monitoring +static constexpr chip::ClusterId ZCL_CLIENT_MONITORING_CLUSTER_ID = 0x0046; + +// Definitions for cluster: Mode Select +static constexpr chip::ClusterId ZCL_MODE_SELECT_CLUSTER_ID = 0x0050; + +// Definitions for cluster: Door Lock +static constexpr chip::ClusterId ZCL_DOOR_LOCK_CLUSTER_ID = 0x0101; + +// Definitions for cluster: Window Covering +static constexpr chip::ClusterId ZCL_WINDOW_COVERING_CLUSTER_ID = 0x0102; + +// Definitions for cluster: Barrier Control +static constexpr chip::ClusterId ZCL_BARRIER_CONTROL_CLUSTER_ID = 0x0103; + +// Definitions for cluster: Pump Configuration and Control +static constexpr chip::ClusterId ZCL_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_ID = 0x0200; + +// Definitions for cluster: Thermostat +static constexpr chip::ClusterId ZCL_THERMOSTAT_CLUSTER_ID = 0x0201; + +// Definitions for cluster: Fan Control +static constexpr chip::ClusterId ZCL_FAN_CONTROL_CLUSTER_ID = 0x0202; + +// Definitions for cluster: Thermostat User Interface Configuration +static constexpr chip::ClusterId ZCL_THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER_ID = 0x0204; + +// Definitions for cluster: Color Control +static constexpr chip::ClusterId ZCL_COLOR_CONTROL_CLUSTER_ID = 0x0300; + +// Definitions for cluster: Ballast Configuration +static constexpr chip::ClusterId ZCL_BALLAST_CONFIGURATION_CLUSTER_ID = 0x0301; + +// Definitions for cluster: Illuminance Measurement +static constexpr chip::ClusterId ZCL_ILLUMINANCE_MEASUREMENT_CLUSTER_ID = 0x0400; + +// Definitions for cluster: Temperature Measurement +static constexpr chip::ClusterId ZCL_TEMPERATURE_MEASUREMENT_CLUSTER_ID = 0x0402; + +// Definitions for cluster: Pressure Measurement +static constexpr chip::ClusterId ZCL_PRESSURE_MEASUREMENT_CLUSTER_ID = 0x0403; + +// Definitions for cluster: Flow Measurement +static constexpr chip::ClusterId ZCL_FLOW_MEASUREMENT_CLUSTER_ID = 0x0404; + +// Definitions for cluster: Relative Humidity Measurement +static constexpr chip::ClusterId ZCL_RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER_ID = 0x0405; + +// Definitions for cluster: Occupancy Sensing +static constexpr chip::ClusterId ZCL_OCCUPANCY_SENSING_CLUSTER_ID = 0x0406; + +// Definitions for cluster: Wake on LAN +static constexpr chip::ClusterId ZCL_WAKE_ON_LAN_CLUSTER_ID = 0x0503; + +// Definitions for cluster: Channel +static constexpr chip::ClusterId ZCL_CHANNEL_CLUSTER_ID = 0x0504; + +// Definitions for cluster: Target Navigator +static constexpr chip::ClusterId ZCL_TARGET_NAVIGATOR_CLUSTER_ID = 0x0505; + +// Definitions for cluster: Media Playback +static constexpr chip::ClusterId ZCL_MEDIA_PLAYBACK_CLUSTER_ID = 0x0506; + +// Definitions for cluster: Media Input +static constexpr chip::ClusterId ZCL_MEDIA_INPUT_CLUSTER_ID = 0x0507; + +// Definitions for cluster: Low Power +static constexpr chip::ClusterId ZCL_LOW_POWER_CLUSTER_ID = 0x0508; + +// Definitions for cluster: Keypad Input +static constexpr chip::ClusterId ZCL_KEYPAD_INPUT_CLUSTER_ID = 0x0509; + +// Definitions for cluster: Content Launcher +static constexpr chip::ClusterId ZCL_CONTENT_LAUNCHER_CLUSTER_ID = 0x050A; + +// Definitions for cluster: Audio Output +static constexpr chip::ClusterId ZCL_AUDIO_OUTPUT_CLUSTER_ID = 0x050B; + +// Definitions for cluster: Application Launcher +static constexpr chip::ClusterId ZCL_APPLICATION_LAUNCHER_CLUSTER_ID = 0x050C; + +// Definitions for cluster: Application Basic +static constexpr chip::ClusterId ZCL_APPLICATION_BASIC_CLUSTER_ID = 0x050D; + +// Definitions for cluster: Account Login +static constexpr chip::ClusterId ZCL_ACCOUNT_LOGIN_CLUSTER_ID = 0x050E; + +// Definitions for cluster: Electrical Measurement +static constexpr chip::ClusterId ZCL_ELECTRICAL_MEASUREMENT_CLUSTER_ID = 0x0B04; + +// Definitions for cluster: Unit Testing +static constexpr chip::ClusterId ZCL_UNIT_TESTING_CLUSTER_ID = 0xFFF1FC05; + +// Definitions for cluster: Fault Injection +static constexpr chip::ClusterId ZCL_FAULT_INJECTION_CLUSTER_ID = 0xFFF1FC06; diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 37fdb4628962f7..51873b26562bcf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -18554,6 +18554,192 @@ namespace Events { } // namespace Events } // namespace ElectricalMeasurement +namespace ClientMonitoring { +namespace Structs { +namespace MonitoringRegistration { +CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + return DoEncode(writer, tag, NullOptional); +} + +CHIP_ERROR Type::EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const +{ + return DoEncode(writer, tag, MakeOptional(accessingFabricIndex)); +} + +CHIP_ERROR Type::DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kClientNodeId)), clientNodeId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kICid)), ICid)); + if (accessingFabricIndex.HasValue()) + { + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kFabricIndex)), fabricIndex)); + } + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kClientNodeId): + ReturnErrorOnFailure(DataModel::Decode(reader, clientNodeId)); + break; + case to_underlying(Fields::kICid): + ReturnErrorOnFailure(DataModel::Decode(reader, ICid)); + break; + case to_underlying(Fields::kFabricIndex): + ReturnErrorOnFailure(DataModel::Decode(reader, fabricIndex)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace MonitoringRegistration +} // namespace Structs + +namespace Commands { +namespace RegisterClientMonitoring { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kClientNodeId)), clientNodeId)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kICid)), ICid)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kClientNodeId): + ReturnErrorOnFailure(DataModel::Decode(reader, clientNodeId)); + break; + case to_underlying(Fields::kICid): + ReturnErrorOnFailure(DataModel::Decode(reader, ICid)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace RegisterClientMonitoring. +namespace StayAwakeRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace StayAwakeRequest. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::IdleModeInterval::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, idleModeInterval)); + break; + case Attributes::ActiveModeInterval::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activeModeInterval)); + break; + case Attributes::ActiveModeThreshold::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, activeModeThreshold)); + break; + case Attributes::ExpectedClients::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, expectedClients)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events { +} // namespace Events + +} // namespace ClientMonitoring namespace UnitTesting { namespace Structs { namespace SimpleStruct { @@ -21401,6 +21587,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::ClientMonitoring::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::UnitTesting::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 4fadf5d916bf8c..c08f33b94259ea 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -25185,6 +25185,228 @@ struct TypeInfo }; } // namespace Attributes } // namespace ElectricalMeasurement +namespace ClientMonitoring { +namespace Structs { +namespace MonitoringRegistration { +enum class Fields +{ + kClientNodeId = 1, + kICid = 2, + kFabricIndex = 254, +}; + +struct Type +{ +public: + chip::NodeId clientNodeId = static_cast(0); + uint64_t ICid = static_cast(0); + chip::FabricIndex fabricIndex = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = true; + + auto GetFabricIndex() const { return fabricIndex; } + + void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } + + CHIP_ERROR EncodeForWrite(TLV::TLVWriter & writer, TLV::Tag tag) const; + CHIP_ERROR EncodeForRead(TLV::TLVWriter & writer, TLV::Tag tag, FabricIndex accessingFabricIndex) const; + +private: + CHIP_ERROR DoEncode(TLV::TLVWriter & writer, TLV::Tag tag, const Optional & accessingFabricIndex) const; +}; + +using DecodableType = Type; + +} // namespace MonitoringRegistration +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace RegisterClientMonitoring { +struct Type; +struct DecodableType; +} // namespace RegisterClientMonitoring + +namespace StayAwakeRequest { +struct Type; +struct DecodableType; +} // namespace StayAwakeRequest + +} // namespace Commands + +namespace Commands { +namespace RegisterClientMonitoring { +enum class Fields +{ + kClientNodeId = 0, + kICid = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::RegisterClientMonitoring::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + + chip::NodeId clientNodeId = static_cast(0); + uint64_t ICid = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::RegisterClientMonitoring::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + + chip::NodeId clientNodeId = static_cast(0); + uint64_t ICid = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace RegisterClientMonitoring +namespace StayAwakeRequest { +enum class Fields +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::StayAwakeRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::StayAwakeRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace StayAwakeRequest +} // namespace Commands + +namespace Attributes { + +namespace IdleModeInterval { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::IdleModeInterval::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace IdleModeInterval +namespace ActiveModeInterval { +struct TypeInfo +{ + using Type = uint32_t; + using DecodableType = uint32_t; + using DecodableArgType = uint32_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveModeInterval::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveModeInterval +namespace ActiveModeThreshold { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveModeThreshold::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveModeThreshold +namespace ExpectedClients { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = + chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList< + chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::DecodableType> &; + + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ExpectedClients::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ExpectedClients +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } +}; +} // namespace AcceptedCommandList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::ClientMonitoring::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::IdleModeInterval::TypeInfo::DecodableType idleModeInterval = static_cast(0); + Attributes::ActiveModeInterval::TypeInfo::DecodableType activeModeInterval = static_cast(0); + Attributes::ActiveModeThreshold::TypeInfo::DecodableType activeModeThreshold = static_cast(0); + Attributes::ExpectedClients::TypeInfo::DecodableType expectedClients; + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace ClientMonitoring namespace UnitTesting { namespace Structs { namespace SimpleStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 45c8decb6fdc72..b443dfc0199f10 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -317,6 +317,10 @@ #define ZCL_GET_MEASUREMENT_PROFILE_RESPONSE_COMMAND_COMMAND_ID (0x01) #define ZCL_GET_MEASUREMENT_PROFILE_COMMAND_COMMAND_ID (0x01) +// Commands for cluster: Client Monitoring +#define ZCL_REGISTER_CLIENT_MONITORING_COMMAND_ID (0x00) +#define ZCL_STAY_AWAKE_REQUEST_COMMAND_ID (0x01) + // Commands for cluster: Unit Testing #define ZCL_TEST_COMMAND_ID (0x00) #define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index c7dce39a648afe..78fed4d2e9636f 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -4605,6 +4605,48 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ElectricalMeasurement +namespace ClientMonitoring { +namespace Attributes { + +namespace IdleModeInterval { +static constexpr AttributeId Id = 0x00000000; +} // namespace IdleModeInterval + +namespace ActiveModeInterval { +static constexpr AttributeId Id = 0x00000001; +} // namespace ActiveModeInterval + +namespace ActiveModeThreshold { +static constexpr AttributeId Id = 0x00000002; +} // namespace ActiveModeThreshold + +namespace ExpectedClients { +static constexpr AttributeId Id = 0x00000003; +} // namespace ExpectedClients + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace ClientMonitoring + namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index a5d2738c08311f..6d9fe6fbd0cfdd 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -232,6 +232,9 @@ static constexpr ClusterId Id = 0x0000050E; namespace ElectricalMeasurement { static constexpr ClusterId Id = 0x00000B04; } // namespace ElectricalMeasurement +namespace ClientMonitoring { +static constexpr ClusterId Id = 0x00001046; +} // namespace ClientMonitoring namespace UnitTesting { static constexpr ClusterId Id = 0xFFF1FC05; } // namespace UnitTesting diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index d7430e8e41f21b..1da2e63b9e3996 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1091,6 +1091,20 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ElectricalMeasurement +namespace ClientMonitoring { +namespace Commands { + +namespace RegisterClientMonitoring { +static constexpr CommandId Id = 0x00000000; +} // namespace RegisterClientMonitoring + +namespace StayAwakeRequest { +static constexpr CommandId Id = 0x00000001; +} // namespace StayAwakeRequest + +} // namespace Commands +} // namespace ClientMonitoring + namespace UnitTesting { namespace Commands { diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index c12c9c4da68c77..9b315e279a7397 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -461,6 +461,12 @@ #define CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER #endif +#if defined(ZCL_USING_CLIENT_MONITORING_CLUSTER_SERVER) || defined(ZCL_USING_CLIENT_MONITORING_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_CLIENT_MONITORING_CLUSTER { chip::app::Clusters::ClientMonitoring::Id, "Client Monitoring" }, +#else +#define CHIP_PRINTCLUSTER_CLIENT_MONITORING_CLUSTER +#endif + #if defined(ZCL_USING_UNIT_TESTING_CLUSTER_SERVER) || defined(ZCL_USING_UNIT_TESTING_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER { chip::app::Clusters::UnitTesting::Id, "Unit Testing" }, #else @@ -543,6 +549,7 @@ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ + CHIP_PRINTCLUSTER_CLIENT_MONITORING_CLUSTER \ CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 852804cdd7daff..aafc35794b3bf4 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -102,6 +102,7 @@ | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | | ElectricalMeasurement | 0x0B04 | +| ClientMonitoring | 0x1046 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| \*----------------------------------------------------------------------------*/ @@ -7296,6 +7297,89 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster ClientMonitoring | 0x1046 | +|------------------------------------------------------------------------------| +| Commands: | | +| * RegisterClientMonitoring | 0x00 | +| * StayAwakeRequest | 0x01 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * IdleModeInterval | 0x0000 | +| * ActiveModeInterval | 0x0001 | +| * ActiveModeThreshold | 0x0002 | +| * ExpectedClients | 0x0003 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command RegisterClientMonitoring + */ +class ClientMonitoringRegisterClientMonitoring : public ClusterCommand +{ +public: + ClientMonitoringRegisterClientMonitoring(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("register-client-monitoring", credsIssuerConfig) + { + AddArgument("ClientNodeId", 0, UINT64_MAX, &mRequest.clientNodeId); + AddArgument("ICid", 0, UINT64_MAX, &mRequest.ICid); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000000) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00001046, 0x00000000, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000000) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00001046, 0x00000000, mRequest); + } + +private: + chip::app::Clusters::ClientMonitoring::Commands::RegisterClientMonitoring::Type mRequest; +}; + +/* + * Command StayAwakeRequest + */ +class ClientMonitoringStayAwakeRequest : public ClusterCommand +{ +public: + ClientMonitoringStayAwakeRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("stay-awake-request", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000001) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00001046, 0x00000001, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00001046) command (0x00000001) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00001046, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::ClientMonitoring::Commands::StayAwakeRequest::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05| |------------------------------------------------------------------------------| @@ -12909,6 +12993,52 @@ void registerClusterElectricalMeasurement(Commands & commands, CredentialIssuerC commands.Register(clusterName, clusterCommands); } +void registerClusterClientMonitoring(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::ClientMonitoring; + + const char * clusterName = "ClientMonitoring"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "idle-mode-interval", Attributes::IdleModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-interval", Attributes::ActiveModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-threshold", Attributes::ActiveModeThreshold::Id, credsIssuerConfig), // + make_unique(Id, "expected-clients", Attributes::ExpectedClients::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "idle-mode-interval", Attributes::IdleModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-interval", Attributes::ActiveModeInterval::Id, credsIssuerConfig), // + make_unique(Id, "active-mode-threshold", Attributes::ActiveModeThreshold::Id, credsIssuerConfig), // + make_unique(Id, "expected-clients", Attributes::ExpectedClients::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::UnitTesting; @@ -13427,6 +13557,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterApplicationBasic(commands, credsIssuerConfig); registerClusterAccountLogin(commands, credsIssuerConfig); registerClusterElectricalMeasurement(commands, credsIssuerConfig); + registerClusterClientMonitoring(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); registerClusterSubscriptions(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 5fec5e0a074e79..ac4bcac9fc2dd7 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -997,6 +997,38 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ModeSelect::Structs::M ComplexArgumentParser::Finalize(request.mode); ComplexArgumentParser::Finalize(request.semanticTags); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MonitoringRegistration.clientNodeId", "clientNodeId", + value.isMember("clientNodeId"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("MonitoringRegistration.ICid", "ICid", value.isMember("ICid"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "clientNodeId"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.clientNodeId, value["clientNodeId"])); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "ICid"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.ICid, value["ICid"])); + + if (value.isMember("fabricIndex")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); + } + + return CHIP_NO_ERROR; +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::Type & request) +{ + ComplexArgumentParser::Finalize(request.clientNodeId); + ComplexArgumentParser::Finalize(request.ICid); + ComplexArgumentParser::Finalize(request.fabricIndex); +} CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 7a69b9477b2d65..dacf0f20365f4d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -142,6 +142,10 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ModeSelect::Str Json::Value & value); static void Finalize(chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index c9f8748cdbe4da..418d7dfd1b565a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -1021,6 +1021,39 @@ 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 chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ClientNodeId", indent + 1, value.clientNodeId); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ClientNodeId'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ICid", indent + 1, value.ICid); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ICid'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index c9b823373808fc..a0b5f9a78388a2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -81,6 +81,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Channel::Structs::LineupInfo::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ModeSelect::Structs::ModeOptionStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ClientMonitoring::Structs::MonitoringRegistration::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::OperationalCredentials::Structs::NOCStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 6af52880cbfe6a..ff16d0a26e1d58 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -104,6 +104,7 @@ | ApplicationBasic | 0x050D | | AccountLogin | 0x050E | | ElectricalMeasurement | 0x0B04 | +| ClientMonitoring | 0x1046 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| \*----------------------------------------------------------------------------*/ From a307034c9e6a77cf6eb3fe0cd9dae2cf51415805 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Dec 2022 11:39:39 -0500 Subject: [PATCH 19/30] Fix up cert bins docker script. (#23874) * Run cert bins compilation as a single run to preserve build environment * Need to also checkout submodules for builds to work * Update to the SHA inside #23869 * Re-create the npm CI logic since the repo SHA is pinned in certbins * make checkout and bootstrap separate layers, so they can be re-run separately. Checkout and bootstrap is slow. * update shell to bash to allow for source usage * Correct naming: in the image version I have, name of the app is without minimal * Remove minimal all clusters app build because build-examples script is buggy in the given version * Replace tabs with spaces * Install zap to make sure builds work --- .../docker/images/chip-cert-bins/Dockerfile | 187 ++++++++++-------- 1 file changed, 101 insertions(+), 86 deletions(-) diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index 14fce86b771cd8..0bd2932123a90c 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -2,26 +2,26 @@ FROM ubuntu:22.04 as chip-build-cert ARG TARGETPLATFORM # COMMITHASH defines the target commit to build from. May be passed in using --build-arg. -ARG COMMITHASH=e556daac2e1ed3a141034a6dcc7e410e4cd1f8f6 +ARG COMMITHASH=21245f42393e63dbb16fb4d99d8bf96aef7ae0fc # Ensure TARGETPLATFORM is set RUN case ${TARGETPLATFORM} in \ "linux/amd64") \ echo "Building for linux/amd64" \ - ;; \ + ;; \ "linux/arm64") \ echo "Building for linux/arm64" \ - ;; \ + ;; \ *) \ - if [ -z "$TARGETPLATFORM" ] ;\ - then \ - echo "TARGETPLATFORM not defined! Please run from buildkit (buildx)." \ - && return 1 ;\ - else \ - echo "Unsupported platform ${TARGETPLATFORM}." \ - && return 1 ;\ - fi \ - ;; \ + if [ -z "$TARGETPLATFORM" ] ;\ + then \ + echo "TARGETPLATFORM not defined! Please run from buildkit (buildx)." \ + && return 1 ;\ + else \ + echo "Unsupported platform ${TARGETPLATFORM}." \ + && return 1 ;\ + fi \ + ;; \ esac # Below should be the same as chip-build except arm64 logic for cmake and node. @@ -108,9 +108,9 @@ RUN case ${TARGETPLATFORM} in \ && exec bash \ ;; \ *) \ - test -n "$TARGETPLATFORM" \ - echo "Unsupported platform ${TARGETPLATFORM}" \ - ;; \ + test -n "$TARGETPLATFORM" \ + echo "Unsupported platform ${TARGETPLATFORM}" \ + ;; \ esac # Python 3 and PIP @@ -156,28 +156,28 @@ RUN set -x \ RUN case ${TARGETPLATFORM} in \ "linux/amd64") \ set -x \ - && mkdir node_js \ - && cd node_js \ - && wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \ - && tar xfvJ node-v12.19.0-linux-x64.tar.xz \ - && mv node-v12.19.0-linux-x64 /opt/ \ - && ln -s /opt/node-v12.19.0-linux-x64 /opt/node \ - && ln -s /opt/node/bin/* /usr/bin \ - && cd .. \ - && rm -rf node_js \ - ;; \ + && mkdir node_js \ + && cd node_js \ + && wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \ + && tar xfvJ node-v12.19.0-linux-x64.tar.xz \ + && mv node-v12.19.0-linux-x64 /opt/ \ + && ln -s /opt/node-v12.19.0-linux-x64 /opt/node \ + && ln -s /opt/node/bin/* /usr/bin \ + && cd .. \ + && rm -rf node_js \ + ;; \ "linux/arm64")\ set -x \ - && mkdir node_js \ - && cd node_js \ - && wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-arm64.tar.xz \ - && tar xfvJ node-v12.19.0-linux-arm64.tar.xz \ - && mv node-v12.19.0-linux-arm64 /opt/ \ - && ln -s /opt/node-v12.19.0-linux-arm64 /opt/node \ - && ln -s /opt/node/bin/* /usr/bin \ - && cd .. \ - && rm -rf node_js \ - ;; \ + && mkdir node_js \ + && cd node_js \ + && wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-arm64.tar.xz \ + && tar xfvJ node-v12.19.0-linux-arm64.tar.xz \ + && mv node-v12.19.0-linux-arm64 /opt/ \ + && ln -s /opt/node-v12.19.0-linux-arm64 /opt/node \ + && ln -s /opt/node/bin/* /usr/bin \ + && cd .. \ + && rm -rf node_js \ + ;; \ *) ;; \ esac @@ -186,71 +186,87 @@ RUN mkdir /root/connectedhomeip RUN git clone https://github.com/project-chip/connectedhomeip.git /root/connectedhomeip WORKDIR /root/connectedhomeip/ RUN git checkout ${COMMITHASH} +RUN ./scripts/checkout_submodules.py --shallow --platform linux RUN scripts/build/gn_bootstrap.sh -RUN gn gen out/debug --args='chip_mdns="platform" chip_inet_config_enable_ipv4=false' -RUN ninja -C out/debug +SHELL ["/bin/bash", "-c"] +RUN set -x && \ + source scripts/activate.sh \ + && gn gen out/debug --args='chip_mdns="platform" chip_inet_config_enable_ipv4=false' \ + && ninja -C out/debug # Stage 2: Build. from chip-build-cert as chip-build-cert-bins SHELL ["/bin/bash", "-c"] # Records Matter SDK commit hash to include in the image. RUN git rev-parse HEAD > /root/.sdk-sha-version + +# TODO: below the build of linux-arm64-all-clusters-minimal-ipv6only/linux-x64-all-clusters-minimal-ipv6only +# is NOT performed because the given SHA does not build minimal and +# builds the regular all-clusters app instead. RUN case ${TARGETPLATFORM} in \ "linux/amd64") \ set -x \ - && source scripts/activate.sh \ - && scripts/build/build_examples.py \ - --target linux-x64-all-clusters-ipv6only \ - --target linux-x64-all-clusters-minimal-ipv6only \ - --target linux-x64-bridge-ipv6only \ - --target linux-x64-tv-app-ipv6only \ - --target linux-x64-tv-casting-app-ipv6only \ - --target linux-x64-light-ipv6only \ - --target linux-x64-thermostat-ipv6only \ - --target linux-x64-ota-provider-ipv6only \ - --target linux-x64-ota-requestor-ipv6only \ - --target linux-x64-lock-ipv6only \ - build \ - && mv out/linux-x64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ - && mv out/linux-x64-all-clusters-minimal-ipv6only/chip-all-clusters-minimal-app out/chip-all-clusters-minimal-app \ - && mv out/linux-x64-bridge-ipv6only/chip-bridge-app out/chip-bridge-app \ - && mv out/linux-x64-tv-app-ipv6only/chip-tv-app out/chip-tv-app \ - && mv out/linux-x64-tv-casting-app-ipv6only/chip-tv-casting-app out/chip-tv-casting-app \ - && mv out/linux-x64-light-ipv6only/chip-lighting-app out/chip-lighting-app \ - && mv out/linux-x64-thermostat-ipv6only/thermostat-app out/thermostat-app \ - && mv out/linux-x64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ - && mv out/linux-x64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ - && mv out/linux-x64-lock-ipv6only/chip-lock-app out/chip-lock-app \ - ;; \ + && source scripts/activate.sh \ + && scripts/build/build_examples.py \ + --target linux-x64-all-clusters-ipv6only \ + --target linux-x64-bridge-ipv6only \ + --target linux-x64-tv-app-ipv6only \ + --target linux-x64-tv-casting-app-ipv6only \ + --target linux-x64-light-ipv6only \ + --target linux-x64-thermostat-ipv6only \ + --target linux-x64-ota-provider-ipv6only \ + --target linux-x64-ota-requestor-ipv6only \ + --target linux-x64-lock-ipv6only \ + build \ + && mv out/linux-x64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ + && mv out/linux-x64-bridge-ipv6only/chip-bridge-app out/chip-bridge-app \ + && mv out/linux-x64-tv-app-ipv6only/chip-tv-app out/chip-tv-app \ + && mv out/linux-x64-tv-casting-app-ipv6only/chip-tv-casting-app out/chip-tv-casting-app \ + && mv out/linux-x64-light-ipv6only/chip-lighting-app out/chip-lighting-app \ + && mv out/linux-x64-thermostat-ipv6only/thermostat-app out/thermostat-app \ + && mv out/linux-x64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ + && mv out/linux-x64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ + && mv out/linux-x64-lock-ipv6only/chip-lock-app out/chip-lock-app \ + ;; \ "linux/arm64")\ set -x \ - && source scripts/activate.sh \ - && scripts/build/build_examples.py \ - --target linux-arm64-all-clusters-ipv6only \ - --target linux-arm64-all-clusters-minimal-ipv6only \ - --target linux-arm64-bridge-ipv6only \ - --target linux-arm64-tv-app-ipv6only \ - --target linux-arm64-tv-casting-app-ipv6only \ - --target linux-arm64-light-ipv6only \ - --target linux-arm64-thermostat-ipv6only \ - --target linux-arm64-ota-provider-ipv6only \ - --target linux-arm64-ota-requestor-ipv6only \ - --target linux-arm64-lock-ipv6only \ - build \ - && mv out/linux-arm64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ - && mv out/linux-arm64-all-clusters-minimal-ipv6only/chip-all-clusters-minimal-app out/chip-all-clusters-minimal-app \ - && mv out/linux-arm64-bridge-ipv6only/chip-bridge-app out/chip-bridge-app \ - && mv out/linux-arm64-tv-app-ipv6only/chip-tv-app out/chip-tv-app \ - && mv out/linux-arm64-tv-casting-app-ipv6only/chip-tv-casting-app out/chip-tv-casting-app \ - && mv out/linux-arm64-light-ipv6only/chip-lighting-app out/chip-lighting-app \ - && mv out/linux-arm64-thermostat-ipv6only/thermostat-app out/thermostat-app \ - && mv out/linux-arm64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ - && mv out/linux-arm64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ - && mv out/linux-arm64-lock-ipv6only/chip-lock-app out/chip-lock-app \ - ;; \ + && source scripts/activate.sh \ + && scripts/build/build_examples.py \ + --target linux-arm64-all-clusters-ipv6only \ + --target linux-arm64-bridge-ipv6only \ + --target linux-arm64-tv-app-ipv6only \ + --target linux-arm64-tv-casting-app-ipv6only \ + --target linux-arm64-light-ipv6only \ + --target linux-arm64-thermostat-ipv6only \ + --target linux-arm64-ota-provider-ipv6only \ + --target linux-arm64-ota-requestor-ipv6only \ + --target linux-arm64-lock-ipv6only \ + build \ + && mv out/linux-arm64-all-clusters-ipv6only/chip-all-clusters-app out/chip-all-clusters-app \ + && mv out/linux-arm64-bridge-ipv6only/chip-bridge-app out/chip-bridge-app \ + && mv out/linux-arm64-tv-app-ipv6only/chip-tv-app out/chip-tv-app \ + && mv out/linux-arm64-tv-casting-app-ipv6only/chip-tv-casting-app out/chip-tv-casting-app \ + && mv out/linux-arm64-light-ipv6only/chip-lighting-app out/chip-lighting-app \ + && mv out/linux-arm64-thermostat-ipv6only/thermostat-app out/thermostat-app \ + && mv out/linux-arm64-ota-provider-ipv6only/chip-ota-provider-app out/chip-ota-provider-app \ + && mv out/linux-arm64-ota-requestor-ipv6only/chip-ota-requestor-app out/chip-ota-requestor-app \ + && mv out/linux-arm64-lock-ipv6only/chip-lock-app out/chip-lock-app \ + ;; \ *) ;; \ esac +# Install a known ZAP release +# Only keep the cli version, since `zap` is 143MB and not usable (UI) +ENV ZAP_VERSION=v2022.11.29-nightly +RUN set -x \ + && mkdir -p /opt/zap-${ZAP_VERSION} \ + && cd /opt/zap-${ZAP_VERSION} \ + && wget https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-linux.zip \ + && unzip zap-linux.zip \ + && rm zap-linux.zip \ + && rm zap \ + && ln -s /opt/zap-${ZAP_VERSION}/zap-cli /usr/bin/ \ + && : # last line RUN scripts/examples/gn_build_test_example.sh app1 RUN source scripts/activate.sh && scripts/build_python.sh -m platform -d true -i no @@ -267,7 +283,6 @@ COPY --from=chip-build-cert-bins /root/connectedhomeip/out/debug/chip-tool chip- COPY --from=chip-build-cert-bins /root/connectedhomeip/out/debug/chip-shell chip-shell COPY --from=chip-build-cert-bins /root/connectedhomeip/out/debug/chip-cert chip-cert COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-all-clusters-app chip-all-clusters-app -COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-all-clusters-minimal-app chip-all-clusters-minimal-app COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-lighting-app chip-lighting-app COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-tv-casting-app chip-tv-casting-app COPY --from=chip-build-cert-bins /root/connectedhomeip/out/chip-tv-app chip-tv-app From 5dfbd633a673b1a661ba142af7288a4b1e683d0c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 2 Dec 2022 12:36:02 -0500 Subject: [PATCH 20/30] Remove redundant init and copyWithZone declarations in Matter framework. (#23866) Fixes https://github.com/project-chip/connectedhomeip/issues/23482 --- .../templates/MTRCommandPayloadsObjc.zapt | 3 - .../CHIP/templates/MTRStructsObjc.zapt | 6 - .../zap-generated/MTRCommandPayloadsObjc.h | 737 +----------------- .../CHIP/zap-generated/MTRStructsObjc.h | 351 --------- 4 files changed, 1 insertion(+), 1096 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt index e7190cc935f3e6..16f8bf03697008 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt @@ -36,9 +36,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs {{#if (isStrEqual source "server")}}MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"){{/if}}; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end {{#*inline "deprecatedDecl"}} diff --git a/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt index 2a347486576795..7f26306abe1ffd 100644 --- a/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRStructsObjc.zapt @@ -12,9 +12,6 @@ NS_ASSUME_NONNULL_BEGIN {{#zcl_struct_items}} @property (nonatomic, copy{{#unless (isStrEqual (asGetterName label) (asStructPropertyName label))}}, getter={{asGetterName label}}{{/unless}}) {{asObjectiveCType type parent.parent.name}} {{asStructPropertyName label}}; {{/zcl_struct_items}} - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; {{/inline}} {{! TODO: We need a better setup for the API_AVALABLE annotations here; this does not scale at all sanely. }} {{#if (isStrEqual (asUpperCamelCase parent.name) "Descriptor")}} @@ -54,9 +51,6 @@ MTR_NEWLY_AVAILABLE {{#zcl_event_fields}} @property (nonatomic, copy{{#unless (isStrEqual (asGetterName name) (asStructPropertyName name))}}, getter={{asGetterName name}}{{/unless}}) {{asObjectiveCType type parent.parent.name}} {{asStructPropertyName name}}; {{/zcl_event_fields}} - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end {{#unless (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index e13a48473d1196..4c17683a2dc516 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -38,9 +38,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRIdentifyClusterTriggerEffectParams : NSObject @@ -62,9 +59,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterAddGroupParams : NSObject @@ -86,9 +80,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterAddGroupResponseParams : NSObject @@ -111,9 +102,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterViewGroupParams : NSObject @@ -133,9 +121,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterViewGroupResponseParams : NSObject @@ -160,9 +145,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterGetGroupMembershipParams : NSObject @@ -182,9 +164,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterGetGroupMembershipResponseParams : NSObject @@ -207,9 +186,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterRemoveGroupParams : NSObject @@ -229,9 +205,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterRemoveGroupResponseParams : NSObject @@ -254,9 +227,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterRemoveAllGroupsParams : NSObject /** @@ -274,9 +244,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupsClusterAddGroupIfIdentifyingParams : NSObject @@ -298,9 +265,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterAddSceneParams : NSObject @@ -328,9 +292,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterAddSceneResponseParams : NSObject @@ -355,9 +316,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterViewSceneParams : NSObject @@ -379,9 +337,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterViewSceneResponseParams : NSObject @@ -412,9 +367,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterRemoveSceneParams : NSObject @@ -436,9 +388,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterRemoveSceneResponseParams : NSObject @@ -463,9 +412,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterRemoveAllScenesParams : NSObject @@ -485,9 +431,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterRemoveAllScenesResponseParams : NSObject @@ -510,9 +453,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterStoreSceneParams : NSObject @@ -534,9 +474,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterStoreSceneResponseParams : NSObject @@ -561,9 +498,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterRecallSceneParams : NSObject @@ -587,9 +521,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterGetSceneMembershipParams : NSObject @@ -609,9 +540,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterGetSceneMembershipResponseParams : NSObject @@ -638,9 +566,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterEnhancedAddSceneParams : NSObject @@ -668,9 +593,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterEnhancedAddSceneResponseParams : NSObject @@ -695,9 +617,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterEnhancedViewSceneParams : NSObject @@ -719,9 +638,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterEnhancedViewSceneResponseParams : NSObject @@ -752,9 +668,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterCopySceneParams : NSObject @@ -782,9 +695,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterCopySceneResponseParams : NSObject @@ -809,9 +719,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROnOffClusterOffParams : NSObject /** @@ -829,9 +736,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROnOffClusterOnParams : NSObject /** @@ -849,9 +753,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROnOffClusterToggleParams : NSObject /** @@ -869,9 +770,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROnOffClusterOffWithEffectParams : NSObject @@ -893,9 +791,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROnOffClusterOnWithRecallGlobalSceneParams : NSObject /** @@ -913,9 +808,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROnOffClusterOnWithTimedOffParams : NSObject @@ -939,9 +831,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterMoveToLevelParams : NSObject @@ -967,9 +856,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterMoveParams : NSObject @@ -995,9 +881,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterStepParams : NSObject @@ -1025,9 +908,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterStopParams : NSObject @@ -1049,9 +929,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterMoveToLevelWithOnOffParams : NSObject @@ -1077,9 +954,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterMoveWithOnOffParams : NSObject @@ -1105,9 +979,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterStepWithOnOffParams : NSObject @@ -1135,9 +1006,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterStopWithOnOffParams : NSObject @@ -1159,9 +1027,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLevelControlClusterMoveToClosestFrequencyParams : NSObject @@ -1181,9 +1046,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterInstantActionParams : NSObject @@ -1205,9 +1067,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterInstantActionWithTransitionParams : NSObject @@ -1231,9 +1090,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterStartActionParams : NSObject @@ -1255,9 +1111,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterStartActionWithDurationParams : NSObject @@ -1281,9 +1134,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterStopActionParams : NSObject @@ -1305,9 +1155,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterPauseActionParams : NSObject @@ -1329,9 +1176,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterPauseActionWithDurationParams : NSObject @@ -1355,9 +1199,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterResumeActionParams : NSObject @@ -1379,9 +1220,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterEnableActionParams : NSObject @@ -1403,9 +1241,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterEnableActionWithDurationParams : NSObject @@ -1429,9 +1264,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterDisableActionParams : NSObject @@ -1453,9 +1285,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterDisableActionWithDurationParams : NSObject @@ -1479,9 +1308,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBasicClusterMfgSpecificPingParams : NSObject /** @@ -1499,9 +1325,6 @@ NS_ASSUME_NONNULL_BEGIN * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_AVAILABLE @interface MTROTASoftwareUpdateProviderClusterQueryImageParams : NSObject @@ -1536,9 +1359,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterQueryImageParams") @@ -1579,9 +1399,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterQueryImageResponseParams") @@ -1609,9 +1426,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterApplyUpdateRequestParams") @@ -1640,9 +1454,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams") @@ -1671,9 +1482,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterNotifyUpdateAppliedParams") @@ -1708,9 +1516,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOtaProviderParams") @@ -1738,9 +1543,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralCommissioningClusterArmFailSafeResponseParams : NSObject @@ -1763,9 +1565,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralCommissioningClusterSetRegulatoryConfigParams : NSObject @@ -1789,9 +1588,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams : NSObject @@ -1814,9 +1610,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralCommissioningClusterCommissioningCompleteParams : NSObject /** @@ -1834,9 +1627,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralCommissioningClusterCommissioningCompleteResponseParams : NSObject @@ -1859,9 +1649,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterScanNetworksParams : NSObject @@ -1883,9 +1670,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterScanNetworksResponseParams : NSObject @@ -1912,9 +1696,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams : NSObject @@ -1938,9 +1719,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterAddOrUpdateThreadNetworkParams : NSObject @@ -1962,9 +1740,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterRemoveNetworkParams : NSObject @@ -1986,9 +1761,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterNetworkConfigResponseParams : NSObject @@ -2013,9 +1785,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterConnectNetworkParams : NSObject @@ -2037,9 +1806,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterConnectNetworkResponseParams : NSObject @@ -2064,9 +1830,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterReorderNetworkParams : NSObject @@ -2090,9 +1853,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDiagnosticLogsClusterRetrieveLogsRequestParams : NSObject @@ -2116,9 +1876,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDiagnosticLogsClusterRetrieveLogsResponseParams : NSObject @@ -2145,9 +1902,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralDiagnosticsClusterTestEventTriggerParams : NSObject @@ -2169,9 +1923,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSoftwareDiagnosticsClusterResetWatermarksParams : NSObject /** @@ -2189,9 +1940,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterResetCountsParams : NSObject /** @@ -2209,9 +1957,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWiFiNetworkDiagnosticsClusterResetCountsParams : NSObject /** @@ -2229,9 +1974,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTREthernetNetworkDiagnosticsClusterResetCountsParams : NSObject /** @@ -2249,9 +1991,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRTimeSynchronizationClusterSetUtcTimeParams : NSObject @@ -2275,9 +2014,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAdministratorCommissioningClusterOpenCommissioningWindowParams : NSObject @@ -2305,9 +2041,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAdministratorCommissioningClusterOpenBasicCommissioningWindowParams : NSObject @@ -2327,9 +2060,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAdministratorCommissioningClusterRevokeCommissioningParams : NSObject /** @@ -2347,9 +2077,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterAttestationRequestParams : NSObject @@ -2369,9 +2096,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterAttestationResponseParams : NSObject @@ -2394,9 +2118,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterCertificateChainRequestParams : NSObject @@ -2416,9 +2137,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterCertificateChainResponseParams : NSObject @@ -2439,9 +2157,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterCSRRequestParams : NSObject @@ -2463,9 +2178,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterCSRResponseParams : NSObject @@ -2488,9 +2200,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterAddNOCParams : NSObject @@ -2518,9 +2227,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterUpdateNOCParams : NSObject @@ -2542,9 +2248,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterNOCResponseParams : NSObject @@ -2569,9 +2272,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterUpdateFabricLabelParams : NSObject @@ -2591,9 +2291,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterRemoveFabricParams : NSObject @@ -2613,9 +2310,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterAddTrustedRootCertificateParams : NSObject @@ -2635,9 +2329,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterKeySetWriteParams : NSObject @@ -2657,9 +2348,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterKeySetReadParams : NSObject @@ -2679,9 +2367,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterKeySetReadResponseParams : NSObject @@ -2702,9 +2387,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterKeySetRemoveParams : NSObject @@ -2724,9 +2406,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterKeySetReadAllIndicesParams : NSObject @@ -2746,9 +2425,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams : NSObject @@ -2769,9 +2445,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRModeSelectClusterChangeToModeParams : NSObject @@ -2791,9 +2464,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterLockDoorParams : NSObject @@ -2813,9 +2483,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterUnlockDoorParams : NSObject @@ -2835,9 +2502,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterUnlockWithTimeoutParams : NSObject @@ -2859,9 +2523,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterSetWeekDayScheduleParams : NSObject @@ -2893,9 +2554,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetWeekDayScheduleParams : NSObject @@ -2917,9 +2575,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetWeekDayScheduleResponseParams : NSObject @@ -2954,9 +2609,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterClearWeekDayScheduleParams : NSObject @@ -2978,9 +2630,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterSetYearDayScheduleParams : NSObject @@ -3006,9 +2655,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetYearDayScheduleParams : NSObject @@ -3030,9 +2676,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetYearDayScheduleResponseParams : NSObject @@ -3061,9 +2704,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterClearYearDayScheduleParams : NSObject @@ -3085,9 +2725,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterSetHolidayScheduleParams : NSObject @@ -3113,9 +2750,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetHolidayScheduleParams : NSObject @@ -3135,9 +2769,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetHolidayScheduleResponseParams : NSObject @@ -3166,9 +2797,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterClearHolidayScheduleParams : NSObject @@ -3188,9 +2816,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterSetUserParams : NSObject @@ -3222,9 +2847,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetUserParams : NSObject @@ -3244,9 +2866,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetUserResponseParams : NSObject @@ -3285,9 +2904,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterClearUserParams : NSObject @@ -3307,9 +2923,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterSetCredentialParams : NSObject @@ -3339,9 +2952,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterSetCredentialResponseParams : NSObject @@ -3366,9 +2976,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetCredentialStatusParams : NSObject @@ -3388,9 +2995,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterGetCredentialStatusResponseParams : NSObject @@ -3419,9 +3023,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterClearCredentialParams : NSObject @@ -3441,9 +3042,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterUpOrOpenParams : NSObject /** @@ -3461,9 +3059,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterDownOrCloseParams : NSObject /** @@ -3481,9 +3076,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterStopMotionParams : NSObject /** @@ -3501,9 +3093,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterGoToLiftValueParams : NSObject @@ -3523,9 +3112,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterGoToLiftPercentageParams : NSObject @@ -3545,9 +3131,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterGoToTiltValueParams : NSObject @@ -3567,9 +3150,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWindowCoveringClusterGoToTiltPercentageParams : NSObject @@ -3589,9 +3169,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBarrierControlClusterBarrierControlGoToPercentParams : NSObject @@ -3611,9 +3188,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBarrierControlClusterBarrierControlStopParams : NSObject /** @@ -3631,9 +3205,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThermostatClusterSetpointRaiseLowerParams : NSObject @@ -3655,9 +3226,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThermostatClusterGetWeeklyScheduleResponseParams : NSObject @@ -3684,9 +3252,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThermostatClusterSetWeeklyScheduleParams : NSObject @@ -3712,9 +3277,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThermostatClusterGetWeeklyScheduleParams : NSObject @@ -3736,9 +3298,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThermostatClusterClearWeeklyScheduleParams : NSObject /** @@ -3756,9 +3315,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveToHueParams : NSObject @@ -3786,9 +3342,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveHueParams : NSObject @@ -3814,9 +3367,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterStepHueParams : NSObject @@ -3844,9 +3394,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveToSaturationParams : NSObject @@ -3872,9 +3419,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveSaturationParams : NSObject @@ -3900,9 +3444,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterStepSaturationParams : NSObject @@ -3930,9 +3471,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveToHueAndSaturationParams : NSObject @@ -3960,9 +3498,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveToColorParams : NSObject @@ -3990,9 +3525,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveColorParams : NSObject @@ -4018,9 +3550,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterStepColorParams : NSObject @@ -4048,9 +3577,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveToColorTemperatureParams : NSObject @@ -4076,9 +3602,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterEnhancedMoveToHueParams : NSObject @@ -4105,10 +3628,7 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * request) within the timeout window. * */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; @end @interface MTRColorControlClusterEnhancedMoveHueParams : NSObject @@ -4134,9 +3654,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterEnhancedStepHueParams : NSObject @@ -4164,9 +3681,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterEnhancedMoveToHueAndSaturationParams : NSObject @@ -4194,9 +3708,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterColorLoopSetParams : NSObject @@ -4228,9 +3739,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterStopMoveStepParams : NSObject @@ -4252,9 +3760,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterMoveColorTemperatureParams : NSObject @@ -4284,9 +3789,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRColorControlClusterStepColorTemperatureParams : NSObject @@ -4318,9 +3820,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRChannelClusterChangeChannelParams : NSObject @@ -4340,9 +3839,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRChannelClusterChangeChannelResponseParams : NSObject @@ -4365,9 +3861,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRChannelClusterChangeChannelByNumberParams : NSObject @@ -4389,9 +3882,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRChannelClusterSkipChannelParams : NSObject @@ -4411,9 +3901,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRTargetNavigatorClusterNavigateTargetParams : NSObject @@ -4435,9 +3922,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRTargetNavigatorClusterNavigateTargetResponseParams : NSObject @@ -4460,9 +3944,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterPlayParams : NSObject /** @@ -4480,9 +3961,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterPauseParams : NSObject /** @@ -4500,9 +3978,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterStopPlaybackParams : NSObject /** @@ -4520,9 +3995,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterStartOverParams : NSObject /** @@ -4540,9 +4012,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterPreviousParams : NSObject /** @@ -4560,9 +4029,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterNextParams : NSObject /** @@ -4580,9 +4046,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterRewindParams : NSObject /** @@ -4600,9 +4063,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterFastForwardParams : NSObject /** @@ -4620,9 +4080,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterSkipForwardParams : NSObject @@ -4642,9 +4099,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterSkipBackwardParams : NSObject @@ -4664,9 +4118,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterPlaybackResponseParams : NSObject @@ -4689,9 +4140,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterSeekParams : NSObject @@ -4711,9 +4159,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaInputClusterSelectInputParams : NSObject @@ -4733,9 +4178,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaInputClusterShowInputStatusParams : NSObject /** @@ -4753,9 +4195,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaInputClusterHideInputStatusParams : NSObject /** @@ -4773,9 +4212,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaInputClusterRenameInputParams : NSObject @@ -4797,9 +4233,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRLowPowerClusterSleepParams : NSObject /** @@ -4817,9 +4250,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRKeypadInputClusterSendKeyParams : NSObject @@ -4839,9 +4269,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRKeypadInputClusterSendKeyResponseParams : NSObject @@ -4862,9 +4289,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterLaunchContentParams : NSObject @@ -4888,9 +4312,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterLaunchURLParams : NSObject @@ -4914,9 +4335,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterLaunchResponseParams : NSObject @@ -4939,9 +4357,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAudioOutputClusterSelectOutputParams : NSObject @@ -4961,9 +4376,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAudioOutputClusterRenameOutputParams : NSObject @@ -4985,9 +4397,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationLauncherClusterLaunchAppParams : NSObject @@ -5009,9 +4418,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationLauncherClusterStopAppParams : NSObject @@ -5031,9 +4437,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationLauncherClusterHideAppParams : NSObject @@ -5053,9 +4456,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationLauncherClusterLauncherResponseParams : NSObject @@ -5078,9 +4478,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccountLoginClusterGetSetupPINParams : NSObject @@ -5100,9 +4497,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccountLoginClusterGetSetupPINResponseParams : NSObject @@ -5123,9 +4517,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccountLoginClusterLoginParams : NSObject @@ -5147,9 +4538,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccountLoginClusterLogoutParams : NSObject /** @@ -5167,9 +4555,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams : NSObject @@ -5196,9 +4581,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRElectricalMeasurementClusterGetProfileInfoCommandParams : NSObject /** @@ -5216,9 +4598,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRElectricalMeasurementClusterGetMeasurementProfileResponseCommandParams : NSObject @@ -5249,9 +4628,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRElectricalMeasurementClusterGetMeasurementProfileCommandParams : NSObject @@ -5275,9 +4651,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRClientMonitoringClusterRegisterClientMonitoringParams : NSObject @@ -5340,9 +4713,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestParams") @@ -5369,9 +4739,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestSpecificResponseParams") @@ -5395,9 +4762,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestNotHandledParams") @@ -5424,9 +4788,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestAddArgumentsResponseParams") @@ -5450,9 +4811,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestSpecificParams") @@ -5479,9 +4837,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestSimpleArgumentResponseParams") @@ -5505,9 +4860,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestUnknownCommandParams") @@ -5544,9 +4896,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestStructArrayArgumentResponseParams") @@ -5574,9 +4923,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestAddArgumentsParams") @@ -5603,9 +4949,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestListInt8UReverseResponseParams") @@ -5631,9 +4974,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestSimpleArgumentRequestParams") @@ -5662,9 +5002,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEnumsResponseParams") @@ -5700,9 +5037,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestStructArrayArgumentRequestParams") @@ -5735,9 +5069,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestNullableOptionalResponseParams") @@ -5763,9 +5094,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestStructArgumentRequestParams") @@ -5846,9 +5174,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestComplexNullableOptionalResponseParams") @@ -5875,9 +5200,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestNestedStructArgumentRequestParams") @@ -5904,9 +5226,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterBooleanResponseParams") @@ -5932,9 +5251,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestListStructArgumentRequestParams") @@ -5961,9 +5277,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterSimpleStructResponseParams") @@ -5989,9 +5302,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestListInt8UArgumentRequestParams") @@ -6018,9 +5328,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestEventResponseParams") @@ -6046,9 +5353,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestNestedStructListArgumentRequestParams") @@ -6076,9 +5380,6 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_NEWLY_DEPRECATED("Timed invoke does not make sense for server to client commands"); - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams") @@ -6105,9 +5406,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestListNestedStructListArgumentRequestParams") @@ -6134,9 +5432,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestListInt8UReverseRequestParams") @@ -6164,9 +5459,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEnumsRequestParams") @@ -6192,9 +5484,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestNullableOptionalRequestParams") @@ -6242,9 +5531,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestComplexNullableOptionalRequestParams") @@ -6271,9 +5557,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterSimpleStructEchoRequestParams") @@ -6297,9 +5580,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTimedInvokeRequestParams") @@ -6325,9 +5605,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestSimpleOptionalArgumentRequestParams") @@ -6358,9 +5635,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestEventRequestParams") @@ -6386,9 +5660,6 @@ MTR_NEWLY_AVAILABLE * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestFabricScopedEventRequestParams") @@ -6422,9 +5693,6 @@ MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestFabricScopedEv * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRFaultInjectionClusterFailRandomlyAtFaultParams : NSObject @@ -6448,9 +5716,6 @@ MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestFabricScopedEv * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index d48d05149e0814..20b04e8d9b2b43 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -22,34 +22,22 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRScenesClusterAttributeValuePair : NSObject @property (nonatomic, copy) NSNumber * _Nullable attributeId; @property (nonatomic, copy) NSArray * _Nonnull attributeValue; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRScenesClusterExtensionFieldSet : NSObject @property (nonatomic, copy) NSNumber * _Nonnull clusterId; @property (nonatomic, copy) NSArray * _Nonnull attributeValueList; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @interface MTRDescriptorClusterDeviceTypeStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull type; @property (nonatomic, copy) NSNumber * _Nonnull revision; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDescriptorClusterDeviceType : NSObject @property (nonatomic, copy) NSNumber * _Nonnull type; @property (nonatomic, copy) NSNumber * _Nonnull revision; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBindingClusterTargetStruct : NSObject @@ -58,18 +46,12 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSNumber * _Nullable endpoint; @property (nonatomic, copy) NSNumber * _Nullable cluster; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccessControlClusterTarget : NSObject @property (nonatomic, copy) NSNumber * _Nullable cluster; @property (nonatomic, copy) NSNumber * _Nullable endpoint; @property (nonatomic, copy) NSNumber * _Nullable deviceType; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccessControlClusterAccessControlEntry : NSObject @@ -78,17 +60,11 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSArray * _Nullable subjects; @property (nonatomic, copy) NSArray * _Nullable targets; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccessControlClusterExtensionEntry : NSObject @property (nonatomic, copy) NSData * _Nonnull data; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccessControlClusterAccessControlEntryChangedEvent : NSObject @@ -97,9 +73,6 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSNumber * _Nonnull changeType; @property (nonatomic, copy) MTRAccessControlClusterAccessControlEntry * _Nullable latestValue; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAccessControlClusterAccessControlExtensionChangedEvent : NSObject @@ -108,9 +81,6 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSNumber * _Nonnull changeType; @property (nonatomic, copy) MTRAccessControlClusterExtensionEntry * _Nullable latestValue; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterActionStruct : NSObject @@ -120,9 +90,6 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSNumber * _Nonnull endpointListID; @property (nonatomic, copy) NSNumber * _Nonnull supportedCommands; @property (nonatomic, copy) NSNumber * _Nonnull state; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterEndpointListStruct : NSObject @@ -130,18 +97,12 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSString * _Nonnull name; @property (nonatomic, copy) NSNumber * _Nonnull type; @property (nonatomic, copy) NSArray * _Nonnull endpoints; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterStateChangedEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull actionID; @property (nonatomic, copy) NSNumber * _Nonnull invokeID; @property (nonatomic, copy, getter=getNewState) NSNumber * _Nonnull newState; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRActionsClusterActionFailedEvent : NSObject @@ -149,44 +110,26 @@ API_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @property (nonatomic, copy) NSNumber * _Nonnull invokeID; @property (nonatomic, copy, getter=getNewState) NSNumber * _Nonnull newState; @property (nonatomic, copy) NSNumber * _Nonnull error; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBasicClusterCapabilityMinimaStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull caseSessionsPerFabric; @property (nonatomic, copy) NSNumber * _Nonnull subscriptionsPerFabric; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBasicClusterStartUpEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull softwareVersion; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBasicClusterShutDownEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBasicClusterLeaveEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBasicClusterReachableChangedEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull reachableNewValue; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_AVAILABLE @@ -194,9 +137,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull providerNodeID; @property (nonatomic, copy) NSNumber * _Nonnull endpoint; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterProviderLocation") @@ -209,9 +149,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy, getter=getNewState) NSNumber * _Nonnull newState; @property (nonatomic, copy) NSNumber * _Nonnull reason; @property (nonatomic, copy) NSNumber * _Nullable targetSoftwareVersion; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterStateTransitionEvent") @@ -222,9 +159,6 @@ MTR_NEWLY_AVAILABLE @interface MTROTASoftwareUpdateRequestorClusterVersionAppliedEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull softwareVersion; @property (nonatomic, copy) NSNumber * _Nonnull productID; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterVersionAppliedEvent") @@ -237,9 +171,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull bytesDownloaded; @property (nonatomic, copy) NSNumber * _Nullable progressPercent; @property (nonatomic, copy) NSNumber * _Nullable platformCode; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErrorEvent") @@ -249,41 +180,26 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @interface MTRPowerSourceClusterBatChargeFaultChangeType : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPowerSourceClusterBatFaultChangeType : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPowerSourceClusterWiredFaultChangeType : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralCommissioningClusterBasicCommissioningInfo : NSObject @property (nonatomic, copy) NSNumber * _Nonnull failSafeExpiryLengthSeconds; @property (nonatomic, copy) NSNumber * _Nonnull maxCumulativeFailsafeSeconds; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterNetworkInfo : NSObject @property (nonatomic, copy) NSData * _Nonnull networkID; @property (nonatomic, copy) NSNumber * _Nonnull connected; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterThreadInterfaceScanResult : NSObject @@ -295,9 +211,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSData * _Nonnull extendedAddress; @property (nonatomic, copy) NSNumber * _Nonnull rssi; @property (nonatomic, copy) NSNumber * _Nonnull lqi; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRNetworkCommissioningClusterWiFiInterfaceScanResult : NSObject @@ -307,9 +220,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull channel; @property (nonatomic, copy) NSNumber * _Nonnull wiFiBand; @property (nonatomic, copy) NSNumber * _Nonnull rssi; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralDiagnosticsClusterNetworkInterfaceType : NSObject @@ -321,40 +231,25 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSArray * _Nonnull iPv4Addresses; @property (nonatomic, copy) NSArray * _Nonnull iPv6Addresses; @property (nonatomic, copy) NSNumber * _Nonnull type; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralDiagnosticsClusterHardwareFaultChangeEvent : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralDiagnosticsClusterRadioFaultChangeEvent : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralDiagnosticsClusterNetworkFaultChangeEvent : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGeneralDiagnosticsClusterBootReasonEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull bootReason; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSoftwareDiagnosticsClusterThreadMetrics : NSObject @@ -363,18 +258,12 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nullable stackFreeCurrent; @property (nonatomic, copy) NSNumber * _Nullable stackFreeMinimum; @property (nonatomic, copy) NSNumber * _Nullable stackSize; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSoftwareDiagnosticsClusterSoftwareFaultEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull id; @property (nonatomic, copy) NSString * _Nullable name; @property (nonatomic, copy) NSData * _Nullable faultRecording; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterNeighborTable : NSObject @@ -392,9 +281,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull fullThreadDevice; @property (nonatomic, copy) NSNumber * _Nonnull fullNetworkData; @property (nonatomic, copy) NSNumber * _Nonnull isChild; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents : NSObject @@ -410,9 +296,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull pskcPresent; @property (nonatomic, copy) NSNumber * _Nonnull securityPolicyPresent; @property (nonatomic, copy) NSNumber * _Nonnull channelMaskPresent; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterRouteTable : NSObject @@ -426,149 +309,89 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull age; @property (nonatomic, copy) NSNumber * _Nonnull allocated; @property (nonatomic, copy) NSNumber * _Nonnull linkEstablished; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterSecurityPolicy : NSObject @property (nonatomic, copy) NSNumber * _Nonnull rotationTime; @property (nonatomic, copy) NSNumber * _Nonnull flags; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterConnectionStatusEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull connectionStatus; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThreadNetworkDiagnosticsClusterNetworkFaultChangeEvent : NSObject @property (nonatomic, copy) NSArray * _Nonnull current; @property (nonatomic, copy) NSArray * _Nonnull previous; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWiFiNetworkDiagnosticsClusterDisconnectionEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull reasonCode; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWiFiNetworkDiagnosticsClusterAssociationFailureEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull associationFailure; @property (nonatomic, copy) NSNumber * _Nonnull status; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRWiFiNetworkDiagnosticsClusterConnectionStatusEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull connectionStatus; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRTimeSynchronizationClusterDstOffsetType : NSObject @property (nonatomic, copy) NSNumber * _Nonnull offset; @property (nonatomic, copy) NSNumber * _Nonnull validStarting; @property (nonatomic, copy) NSNumber * _Nonnull validUntil; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRTimeSynchronizationClusterTimeZoneType : NSObject @property (nonatomic, copy) NSNumber * _Nonnull offset; @property (nonatomic, copy) NSNumber * _Nonnull validAt; @property (nonatomic, copy) NSString * _Nullable name; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBridgedDeviceBasicClusterStartUpEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull softwareVersion; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBridgedDeviceBasicClusterShutDownEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBridgedDeviceBasicClusterLeaveEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBridgedDeviceBasicClusterReachableChangedEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull reachableNewValue; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterSwitchLatchedEvent : NSObject @property (nonatomic, copy, getter=getNewPosition) NSNumber * _Nonnull newPosition; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterInitialPressEvent : NSObject @property (nonatomic, copy, getter=getNewPosition) NSNumber * _Nonnull newPosition; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterLongPressEvent : NSObject @property (nonatomic, copy, getter=getNewPosition) NSNumber * _Nonnull newPosition; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterShortReleaseEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull previousPosition; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterLongReleaseEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull previousPosition; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterMultiPressOngoingEvent : NSObject @property (nonatomic, copy, getter=getNewPosition) NSNumber * _Nonnull newPosition; @property (nonatomic, copy) NSNumber * _Nonnull currentNumberOfPressesCounted; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRSwitchClusterMultiPressCompleteEvent : NSObject @property (nonatomic, copy, getter=getNewPosition) NSNumber * _Nonnull newPosition; @property (nonatomic, copy) NSNumber * _Nonnull totalNumberOfPressesCounted; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterFabricDescriptor : NSObject @@ -578,18 +401,12 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull nodeId; @property (nonatomic, copy) NSString * _Nonnull label; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTROperationalCredentialsClusterNOCStruct : NSObject @property (nonatomic, copy) NSData * _Nonnull noc; @property (nonatomic, copy) NSData * _Nullable icac; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterGroupInfoMapStruct : NSObject @@ -597,18 +414,12 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSArray * _Nonnull endpoints; @property (nonatomic, copy) NSString * _Nullable groupName; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterGroupKeyMapStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull groupId; @property (nonatomic, copy) NSNumber * _Nonnull groupKeySetID; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRGroupKeyManagementClusterGroupKeySetStruct : NSObject @@ -620,71 +431,44 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nullable epochStartTime1; @property (nonatomic, copy) NSData * _Nullable epochKey2; @property (nonatomic, copy) NSNumber * _Nullable epochStartTime2; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRFixedLabelClusterLabelStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label; @property (nonatomic, copy) NSString * _Nonnull value; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRUserLabelClusterLabelStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label; @property (nonatomic, copy) NSString * _Nonnull value; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRBooleanStateClusterStateChangeEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull stateValue; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRModeSelectClusterSemanticTag : NSObject @property (nonatomic, copy) NSNumber * _Nonnull mfgCode; @property (nonatomic, copy) NSNumber * _Nonnull value; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRModeSelectClusterModeOptionStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull label; @property (nonatomic, copy) NSNumber * _Nonnull mode; @property (nonatomic, copy) NSArray * _Nonnull semanticTags; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterDlCredential : NSObject @property (nonatomic, copy) NSNumber * _Nonnull credentialType; @property (nonatomic, copy) NSNumber * _Nonnull credentialIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterDoorLockAlarmEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull alarmCode; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterDoorStateChangeEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull doorState; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterLockOperationEvent : NSObject @@ -694,9 +478,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nullable fabricIndex; @property (nonatomic, copy) NSNumber * _Nullable sourceNode; @property (nonatomic, copy) NSArray * _Nullable credentials; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterLockOperationErrorEvent : NSObject @@ -707,9 +488,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nullable fabricIndex; @property (nonatomic, copy) NSNumber * _Nullable sourceNode; @property (nonatomic, copy) NSArray * _Nullable credentials; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRDoorLockClusterLockUserChangeEvent : NSObject @@ -720,120 +498,63 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nullable fabricIndex; @property (nonatomic, copy) NSNumber * _Nullable sourceNode; @property (nonatomic, copy) NSNumber * _Nullable dataIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterSupplyVoltageLowEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterSupplyVoltageHighEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterPowerMissingPhaseEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterSystemPressureLowEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterSystemPressureHighEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterDryRunningEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterMotorTemperatureHighEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterPumpMotorFatalFailureEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterElectronicTemperatureHighEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterPumpBlockedEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterSensorFailureEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterElectronicNonFatalFailureEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterElectronicFatalFailureEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterGeneralFaultEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterLeakageEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterAirDetectionEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRPumpConfigurationAndControlClusterTurbineOperationEvent : NSObject - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRThermostatClusterThermostatScheduleTransition : NSObject @property (nonatomic, copy) NSNumber * _Nonnull transitionTime; @property (nonatomic, copy) NSNumber * _Nullable heatSetpoint; @property (nonatomic, copy) NSNumber * _Nullable coolSetpoint; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRChannelClusterChannelInfo : NSObject @@ -842,9 +563,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSString * _Nullable name; @property (nonatomic, copy) NSString * _Nullable callSign; @property (nonatomic, copy) NSString * _Nullable affiliateCallSign; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRChannelClusterLineupInfo : NSObject @@ -852,25 +570,16 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSString * _Nullable lineupName; @property (nonatomic, copy) NSString * _Nullable postalCode; @property (nonatomic, copy) NSNumber * _Nonnull lineupInfoType; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRTargetNavigatorClusterTargetInfo : NSObject @property (nonatomic, copy) NSNumber * _Nonnull identifier; @property (nonatomic, copy) NSString * _Nonnull name; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaPlaybackClusterPlaybackPosition : NSObject @property (nonatomic, copy) NSNumber * _Nonnull updatedAt; @property (nonatomic, copy) NSNumber * _Nullable position; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRMediaInputClusterInputInfo : NSObject @@ -878,51 +587,33 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull inputType; @property (nonatomic, copy) NSString * _Nonnull name; @property (nonatomic, copy) NSString * _Nonnull descriptionString; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterDimension : NSObject @property (nonatomic, copy) NSNumber * _Nonnull width; @property (nonatomic, copy) NSNumber * _Nonnull height; @property (nonatomic, copy) NSNumber * _Nonnull metric; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterAdditionalInfo : NSObject @property (nonatomic, copy) NSString * _Nonnull name; @property (nonatomic, copy) NSString * _Nonnull value; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterParameter : NSObject @property (nonatomic, copy) NSNumber * _Nonnull type; @property (nonatomic, copy) NSString * _Nonnull value; @property (nonatomic, copy) NSArray * _Nullable externalIDList; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterContentSearch : NSObject @property (nonatomic, copy) NSArray * _Nonnull parameterList; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterStyleInformation : NSObject @property (nonatomic, copy) NSString * _Nullable imageUrl; @property (nonatomic, copy) NSString * _Nullable color; @property (nonatomic, copy) MTRContentLauncherClusterDimension * _Nullable size; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRContentLauncherClusterBrandingInformation : NSObject @@ -932,42 +623,27 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) MTRContentLauncherClusterStyleInformation * _Nullable progressBar; @property (nonatomic, copy) MTRContentLauncherClusterStyleInformation * _Nullable splash; @property (nonatomic, copy) MTRContentLauncherClusterStyleInformation * _Nullable waterMark; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRAudioOutputClusterOutputInfo : NSObject @property (nonatomic, copy) NSNumber * _Nonnull index; @property (nonatomic, copy) NSNumber * _Nonnull outputType; @property (nonatomic, copy) NSString * _Nonnull name; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationLauncherClusterApplication : NSObject @property (nonatomic, copy) NSNumber * _Nonnull catalogVendorId; @property (nonatomic, copy) NSString * _Nonnull applicationId; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationLauncherClusterApplicationEP : NSObject @property (nonatomic, copy) MTRApplicationLauncherClusterApplication * _Nonnull application; @property (nonatomic, copy) NSNumber * _Nullable endpoint; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRApplicationBasicClusterApplicationBasicApplication : NSObject @property (nonatomic, copy) NSNumber * _Nonnull catalogVendorId; @property (nonatomic, copy) NSString * _Nonnull applicationId; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRClientMonitoringClusterMonitoringRegistration : NSObject @@ -989,9 +665,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull f; @property (nonatomic, copy) NSNumber * _Nonnull g; @property (nonatomic, copy) NSNumber * _Nonnull h; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterSimpleStruct") @@ -1007,9 +680,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) MTRUnitTestingClusterSimpleStruct * _Nonnull fabricSensitiveStruct; @property (nonatomic, copy) NSArray * _Nonnull fabricSensitiveInt8uList; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestFabricScoped") @@ -1029,9 +699,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSArray * _Nullable nullableList; @property (nonatomic, copy) NSArray * _Nullable optionalList; @property (nonatomic, copy) NSArray * _Nullable nullableOptionalList; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterNullablesAndOptionalsStruct") @@ -1042,9 +709,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull a; @property (nonatomic, copy) NSNumber * _Nonnull b; @property (nonatomic, copy) MTRUnitTestingClusterSimpleStruct * _Nonnull c; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterNestedStruct") @@ -1059,9 +723,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) NSArray * _Nonnull e; @property (nonatomic, copy) NSArray * _Nonnull f; @property (nonatomic, copy) NSArray * _Nonnull g; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterNestedStructList") @@ -1070,9 +731,6 @@ MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterNestedStructList") MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterDoubleNestedStructList : NSObject @property (nonatomic, copy) NSArray * _Nonnull a; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterDoubleNestedStructList") @@ -1082,9 +740,6 @@ MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterTestListStructOctet : NSObject @property (nonatomic, copy) NSNumber * _Nonnull member1; @property (nonatomic, copy) NSData * _Nonnull member2; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestListStructOctet") @@ -1099,9 +754,6 @@ MTR_NEWLY_AVAILABLE @property (nonatomic, copy) MTRUnitTestingClusterSimpleStruct * _Nonnull arg4; @property (nonatomic, copy) NSArray * _Nonnull arg5; @property (nonatomic, copy) NSArray * _Nonnull arg6; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEventEvent") @@ -1111,9 +763,6 @@ MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestEventEvent") MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterTestFabricScopedEventEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_DEPRECATED("Please use MTRUnitTestingClusterTestFabricScopedEventEvent") From a541b5b226a06bc95d85cd5b0f9c36e2082d161a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 2 Dec 2022 18:38:01 +0100 Subject: [PATCH 21/30] [typo] Replace ' Unit / Interation Tests' with ' Unit / Integration Tests' (#23875) --- .github/workflows/unit_integration_test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 959815a7963816..dd3547731fa906 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: Unit / Interation Tests +name: Unit / Integration Tests on: push: @@ -24,7 +24,7 @@ concurrency: jobs: unit_tests: - name: Unit / Interation Tests + name: Unit / Integration Tests timeout-minutes: 60 if: github.actor != 'restyled-io[bot]' From c276f727a093341253b7ef5c28abbab4d4bb74ee Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Dec 2022 12:38:28 -0500 Subject: [PATCH 22/30] Fix typo in build targets for minimal app (#23876) --- scripts/build/build/targets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7f408c538e011f..d25bb983d932de 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -97,7 +97,7 @@ def BuildHostTarget(): app_parts = [ TargetPart('rpc-console', app=HostApp.RPC_CONSOLE).OnlyIfRe(f'{native_board_name}-'), TargetPart('all-clusters', app=HostApp.ALL_CLUSTERS), - TargetPart('all-clusters-minimal', app=HostApp.ALL_CLUSTERS), + TargetPart('all-clusters-minimal', app=HostApp.ALL_CLUSTERS_MINIMAL), TargetPart('chip-tool', app=HostApp.CHIP_TOOL), TargetPart('thermostat', app=HostApp.THERMOSTAT), TargetPart('java-matter-controller', app=HostApp.JAVA_MATTER_CONTROLLER), From 1e06479f412b78eea0dfbeacf7cad51d005b649b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Dec 2022 14:01:19 -0500 Subject: [PATCH 23/30] zap regen (#23879) * zap regen * Undo regen for files that master zap complains about. I am unclear why differences exist though --- .../Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h | 6 ------ src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h | 3 --- 2 files changed, 9 deletions(-) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 4c17683a2dc516..0809cb2d5dc57f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -4672,9 +4672,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end @interface MTRClientMonitoringClusterStayAwakeRequestParams : NSObject /** @@ -4692,9 +4689,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterAnnounceOta * */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_AVAILABLE @interface MTRUnitTestingClusterTestParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 20b04e8d9b2b43..96b8ae47f2b02c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -650,9 +650,6 @@ MTR_NEWLY_DEPRECATED("Please use MTROTASoftwareUpdateRequestorClusterDownloadErr @property (nonatomic, copy) NSNumber * _Nonnull clientNodeId; @property (nonatomic, copy) NSNumber * _Nonnull iCid; @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex; - -- (instancetype)init; -- (id)copyWithZone:(NSZone * _Nullable)zone; @end MTR_NEWLY_AVAILABLE From 35422eb5ade1301700eb4a075a1e5b81083ece81 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 2 Dec 2022 20:41:21 +0100 Subject: [PATCH 24/30] [chip-tool] Add --skip-commissioning-complete optional parameter for non-concurrent connection use case (#23701) --- .../chip-tool/commands/pairing/PairingCommand.cpp | 14 ++++++++++---- .../chip-tool/commands/pairing/PairingCommand.h | 6 ++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index 9f827004d087f4..adc560a812fe11 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -70,17 +70,23 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId) CommissioningParameters PairingCommand::GetCommissioningParameters() { + auto params = CommissioningParameters(); + params.SetSkipCommissioningComplete(mSkipCommissioningComplete.ValueOr(false)); + switch (mNetworkType) { case PairingNetworkType::WiFi: - return CommissioningParameters().SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword)); + params.SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword)); + break; case PairingNetworkType::Thread: - return CommissioningParameters().SetThreadOperationalDataset(mOperationalDataset); + params.SetThreadOperationalDataset(mOperationalDataset); + break; case PairingNetworkType::Ethernet: case PairingNetworkType::None: - return CommissioningParameters(); + break; } - return CommissioningParameters(); + + return params; } CHIP_ERROR PairingCommand::PaseWithCode(NodeId remoteId) diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index 61c7440ad9963e..3edd1cfd9e3f4e 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -78,20 +78,24 @@ class PairingCommand : public CHIPCommand, case PairingMode::None: break; case PairingMode::Code: + AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete); case PairingMode::CodePaseOnly: AddArgument("payload", &mOnboardingPayload); AddArgument("discover-once", 0, 1, &mDiscoverOnce); AddArgument("use-only-onnetwork-discovery", 0, 1, &mUseOnlyOnNetworkDiscovery); break; case PairingMode::Ble: + AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete); AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); AddArgument("discriminator", 0, 4096, &mDiscriminator); break; case PairingMode::OnNetwork: + AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete); AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); AddArgument("pase-only", 0, 1, &mPaseOnly); break; case PairingMode::SoftAP: + AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete); AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); AddArgument("discriminator", 0, 4096, &mDiscriminator); AddArgument("device-remote-ip", &mRemoteAddr); @@ -99,6 +103,7 @@ class PairingCommand : public CHIPCommand, AddArgument("pase-only", 0, 1, &mPaseOnly); break; case PairingMode::Ethernet: + AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete); AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode); AddArgument("discriminator", 0, 4096, &mDiscriminator); AddArgument("device-remote-ip", &mRemoteAddr); @@ -169,6 +174,7 @@ class PairingCommand : public CHIPCommand, chip::Optional mDiscoverOnce; chip::Optional mUseOnlyOnNetworkDiscovery; chip::Optional mPaseOnly; + chip::Optional mSkipCommissioningComplete; uint16_t mRemotePort; uint16_t mDiscriminator; uint32_t mSetupPINCode; From 85aa1446604accd632d3ec461bdba910895cf0ae Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 2 Dec 2022 20:41:41 +0100 Subject: [PATCH 25/30] [darwin-framework-tool] Do not build Matter SDK twice when config_enable_yaml_tests=false (#23682) --- .../chip-tool/commands/common/Command.cpp | 2 +- examples/chip-tool/commands/common/Command.h | 1 - .../common/CredentialIssuerCommands.h | 8 ++- .../discover/DiscoverCommissionersCommand.cpp | 1 + .../example/ExampleCredentialIssuerCommands.h | 1 + examples/darwin-framework-tool/BUILD.gn | 68 +++++++++++++++---- .../commands/clusters/ModelCommandBridge.h | 2 - .../commands/common/CHIPCommandBridge.h | 1 + .../pairing/OpenCommissioningWindowCommand.h | 4 +- .../templates/tests/commands.zapt | 1 + scripts/build/build_darwin_framework.py | 4 ++ .../zap-generated/test/Commands.h | 1 + 12 files changed, 73 insertions(+), 21 deletions(-) diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp index 077e0fb715f589..ebfb99bad5c9e5 100644 --- a/examples/chip-tool/commands/common/Command.cpp +++ b/examples/chip-tool/commands/common/Command.cpp @@ -17,8 +17,8 @@ */ #include "Command.h" -#include "platform/PlatformManager.h" +#include #include #include #include diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h index 96de49477621d8..265bf1af3c5925 100644 --- a/examples/chip-tool/commands/common/Command.h +++ b/examples/chip-tool/commands/common/Command.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/chip-tool/commands/common/CredentialIssuerCommands.h b/examples/chip-tool/commands/common/CredentialIssuerCommands.h index 2a5df5a42abe63..1ea712ffa9593f 100644 --- a/examples/chip-tool/commands/common/CredentialIssuerCommands.h +++ b/examples/chip-tool/commands/common/CredentialIssuerCommands.h @@ -19,12 +19,18 @@ #pragma once #include -#include #include #include #include #include +namespace chip { +namespace Controller { +struct SetupParams; +class OperationalCredentialsDelegate; +} // namespace Controller +} // namespace chip + class CredentialIssuerCommands { public: diff --git a/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp b/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp index b2fe353931328a..0d1c9a032de02c 100644 --- a/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp +++ b/examples/chip-tool/commands/discover/DiscoverCommissionersCommand.cpp @@ -18,6 +18,7 @@ #include "DiscoverCommissionersCommand.h" #include +#include using namespace ::chip; diff --git a/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h b/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h index da4716e957e921..e06466ca4ab67d 100644 --- a/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h +++ b/examples/chip-tool/commands/example/ExampleCredentialIssuerCommands.h @@ -19,6 +19,7 @@ #pragma once #include +#include #include #include #include diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index 5a9fbabfbbe5b2..51746d12455679 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -143,20 +143,6 @@ executable("darwin-framework-tool") { deps = [ ":build-darwin-framework", - "${chip_root}/src/app/tests/suites/commands/delay", - - # IM is needed for MTRError - "${chip_root}/src/app/tests/suites/commands/interaction_model", - - # Log is needed by tests UserPrompt and Log - "${chip_root}/src/app/tests/suites/commands/log", - - # System is needed by tests FactoryReset etc.. - "${chip_root}/src/app/tests/suites/commands/system", - - # pics is needed by tests - "${chip_root}/src/app/tests/suites/pics", - "${chip_root}/third_party/inipp", "${chip_root}/third_party/jsoncpp", ] @@ -175,6 +161,60 @@ executable("darwin-framework-tool") { "Security.framework", ] + # When config_enable_yaml_tests=true the Matter SDK is pulled in as a dependency because the code of the test suite + # uses some helpers from the Matter SDK. As a result, the SDK is built twice. Once because of this dependency and once + # when the Matter.framework is built. + # It may results in different versions of the Matter SDK between the output binary and the linked Matter.framework. + # + # When config_enable_yaml_tests=false the Matter SDK is built once when the Matter.framework is built and the resulting + # libCHIP.a library is linked statically to the output binary. + if (config_enable_yaml_tests) { + deps += [ + "${chip_root}/src/app/tests/suites/commands/delay", + + # IM is needed for MTRError + "${chip_root}/src/app/tests/suites/commands/interaction_model", + + # Log is needed by tests UserPrompt and Log + "${chip_root}/src/app/tests/suites/commands/log", + + # System is needed by tests FactoryReset etc.. + "${chip_root}/src/app/tests/suites/commands/system", + + # pics is needed by tests + "${chip_root}/src/app/tests/suites/pics", + ] + } else { + include_dirs = [ + "${chip_root}/config/standalone/", + "${chip_root}/src/", + "${chip_root}/src/include/", + "${chip_root}/third_party/nlassert/repo/include/", + "${chip_root}/third_party/nlio/repo/include/", + "${chip_root}/zzz_generated/app-common/", + "${root_gen_dir}/include", + "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/gen/include", + ] + + defines = [ + "CHIP_HAVE_CONFIG_H=1", + "CHIP_SYSTEM_CONFIG_USE_SOCKETS=1", + ] + + frameworks += [ + "CoreFoundation.framework", + "Foundation.framework", + "CoreBluetooth.framework", + "Network.framework", + ] + + # Other SDKs are linked statically to Matter.framework but the macosx SDK is linked dynamically but needs some symbols that are + # not exposed by the dylib. + if (sdk == "macosx") { + libs = [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ] + } + } + public_configs = [ ":config" ] output_dir = root_out_dir diff --git a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h index df6cf196c04569..447d2c2ae5ccf6 100644 --- a/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h +++ b/examples/darwin-framework-tool/commands/clusters/ModelCommandBridge.h @@ -24,8 +24,6 @@ class ModelCommand : public CHIPCommandBridge { public: - using ChipDevice = ::chip::OperationalDeviceProxy; - ModelCommand(const char * _Nonnull commandName) : CHIPCommandBridge(commandName) {} void AddArguments() diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index ca11c746e30e09..bf5e7b49fce0fd 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "../provider/OTAProviderDelegate.h" diff --git a/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.h b/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.h index e9fc4ce373b352..68c0d2b7aab6aa 100644 --- a/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.h +++ b/examples/darwin-framework-tool/commands/pairing/OpenCommissioningWindowCommand.h @@ -31,8 +31,8 @@ class OpenCommissioningWindowCommand : public CHIPCommandBridge "1 to use Enhanced Commissioning Method.\n 0 to use Basic Commissioning Method."); AddArgument("window-timeout", 0, UINT16_MAX, &mCommissioningWindowTimeoutMs, "Time, in seconds, before the commissioning window closes."); - AddArgument("iteration", chip::kSpake2p_Min_PBKDF_Iterations, chip::kSpake2p_Max_PBKDF_Iterations, &mIteration, - "Number of PBKDF iterations to use to derive the verifier. Ignored if 'option' is 0."); + AddArgument("iteration", chip::Crypto::kSpake2p_Min_PBKDF_Iterations, chip::Crypto::kSpake2p_Max_PBKDF_Iterations, + &mIteration, "Number of PBKDF iterations to use to derive the verifier. Ignored if 'option' is 0."); AddArgument("discriminator", 0, 4096, &mDiscriminator, "Discriminator to use for advertising. Ignored if 'option' is 0."); AddArgument("timeout", 0, UINT16_MAX, &mTimeout, "Time, in seconds, before this command is considered to have timed out."); } diff --git a/examples/darwin-framework-tool/templates/tests/commands.zapt b/examples/darwin-framework-tool/templates/tests/commands.zapt index adfa4662f7b1c5..4040d94975a8be 100644 --- a/examples/darwin-framework-tool/templates/tests/commands.zapt +++ b/examples/darwin-framework-tool/templates/tests/commands.zapt @@ -4,6 +4,7 @@ #if CONFIG_ENABLE_YAML_TESTS +#include #include #include #include diff --git a/scripts/build/build_darwin_framework.py b/scripts/build/build_darwin_framework.py index d84ea53cf20837..77b033d019883f 100644 --- a/scripts/build/build_darwin_framework.py +++ b/scripts/build/build_darwin_framework.py @@ -65,6 +65,10 @@ def build_darwin_framework(args): # Build Matter.framework as a static library "SUPPORTS_TEXT_BASED_API=NO", "MACH_O_TYPE=staticlib", + # Change visibility flags such that both darwin-framework-tool and Matter.framework + # are built with the same flags. + "GCC_INLINES_ARE_PRIVATE_EXTERN=NO", + "GCC_SYMBOLS_PRIVATE_EXTERN=NO", ] command_result = run_command(command) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 560a723adefbd1..2329031ef9ec52 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -21,6 +21,7 @@ #if CONFIG_ENABLE_YAML_TESTS +#include #include #include #include From cee77649fcf61432ffec125dcea72e446b76dbf3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Dec 2022 16:21:21 -0500 Subject: [PATCH 26/30] Add platform-mdns variant for builders (was used in CI but not working) (#23856) --- scripts/build/build/targets.py | 1 + scripts/build/testdata/all_targets_linux_x64.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index d25bb983d932de..b68e6fa59e43fb 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -125,6 +125,7 @@ def BuildHostTarget(): target.AppendModifier('nodeps', enable_ble=False, enable_wifi=False, enable_thread=False, crypto_library=HostCryptoLibrary.MBEDTLS, use_clang=True).ExceptIfRe('-(clang|noble|boringssl|mbedtls)') + target.AppendModifier('platform-mdns', use_platform_mdns=True) target.AppendModifier('minmdns-verbose', minmdns_high_verbosity=True) target.AppendModifier('libnl', minmdns_address_policy="libnl") target.AppendModifier('same-event-loop', separate_event_loop=False).OnlyIfRe('-(chip-tool|darwin-framework-tool)') diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 8b29b271fe80b8..644a6d22b89cdf 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -7,7 +7,7 @@ efr32-{brd4161a,brd4187c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,brd4187a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-requestor,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool}[-nodeps][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang][-test][-rpc] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,python-bindings,tv-app,tv-casting-app,bridge,dynamic-bridge,tests,chip-cert,address-resolve-tool}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-libfuzzer][-coverage][-dmalloc][-clang][-test][-rpc] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] From 5529d74114ee60d3d7ed3e92281165d26326d3a6 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Fri, 2 Dec 2022 22:23:01 +0100 Subject: [PATCH 27/30] Set auto_envvar_prefix for click apps to CHIP (#23797) This change will allow setting default values for e.g. build_examples.py script with environment variables. Simple use case might be to enable ccache for all targets and disable timestamp logs with: export CHIP_NO_LOG_TIMESTAMPS=true export CHIP_PW_COMMAND_LAUNCHER=ccache --- .github/workflows/build.yaml | 14 +-- .github/workflows/darwin-tests.yaml | 3 + .github/workflows/examples-ameba.yaml | 3 + .github/workflows/examples-bouffalolab.yaml | 3 + .../workflows/examples-cc13x2x7_26x2x7.yaml | 3 + .github/workflows/examples-efr32.yaml | 3 + .github/workflows/examples-esp32.yaml | 3 + .github/workflows/examples-infineon.yaml | 11 ++- .github/workflows/examples-k32w.yaml | 3 + .github/workflows/examples-linux-arm.yaml | 5 ++ .github/workflows/examples-linux-imx.yaml | 36 +++++--- .../workflows/examples-linux-standalone.yaml | 87 ++++++++++++------- .github/workflows/examples-mbed.yaml | 5 +- .github/workflows/examples-mw320.yaml | 3 + .github/workflows/examples-nrfconnect.yaml | 7 +- .github/workflows/examples-qpg.yaml | 3 + .github/workflows/examples-telink.yaml | 15 ++-- .github/workflows/examples-tizen.yaml | 9 +- .github/workflows/full-android.yaml | 17 ++-- .github/workflows/fuzzing-build.yaml | 3 + .github/workflows/qemu.yaml | 3 + .github/workflows/smoketest-android.yaml | 5 +- .github/workflows/tests.yaml | 12 ++- scripts/build/build_examples.py | 2 +- scripts/codegen.py | 2 +- scripts/helpers/iwyu-check.py | 2 +- scripts/idl/lint/lint_rules_parser.py | 2 +- scripts/idl/matter_idl_parser.py | 11 +-- scripts/idl/xml_parser.py | 2 +- scripts/idl_lint.py | 2 +- scripts/run-clang-tidy-on-compile-commands.py | 8 +- scripts/run_in_build_env.sh | 2 +- scripts/tests/run_python_test.py | 8 +- scripts/tests/run_test_suite.py | 3 +- scripts/tools/convert_ini.py | 11 +-- 35 files changed, 209 insertions(+), 102 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3b2904617233a7..866dfd3bbfacf1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,11 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: + build_linux_gcc_debug: name: Build on Linux (gcc_debug) timeout-minutes: 85 @@ -125,6 +129,7 @@ jobs: # path: out/ # # objdirs are big; don't hold on to them too long. # retention-days: 5 + build_linux: name: Build on Linux (fake, gcc_release, clang, simulated) timeout-minutes: 150 @@ -219,7 +224,6 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ - --no-log-timestamps \ --compile-database out/sanitizers/compile_commands.json \ --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/' \ check \ @@ -228,7 +232,7 @@ jobs: timeout-minutes: 60 run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps \ + "./scripts/build/build_examples.py \ --target linux-x64-minmdns-ipv6only-clang \ --target linux-x64-rpc-console \ build \ @@ -241,7 +245,7 @@ jobs: timeout-minutes: 60 run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps \ + "./scripts/build/build_examples.py \ --target linux-x64-all-clusters-ipv6only-clang \ --target linux-x64-chip-tool-ipv6only-clang \ --pregen-dir ./zzz_pregenerated \ @@ -255,7 +259,7 @@ jobs: timeout-minutes: 15 run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target linux-fake-tests build" + "./scripts/build/build_examples.py --target linux-fake-tests build" - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} @@ -295,6 +299,7 @@ jobs: # - name: Perform CodeQL Analysis # if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }} # uses: github/codeql-action/analyze@v1 + build_linux_python_lib: name: Build on Linux (python_lib) timeout-minutes: 60 @@ -430,7 +435,6 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ - --no-log-timestamps \ --compile-database out/default/compile_commands.json \ check \ " diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index aa9c9a7ac5c236..7d1db5f479dc6c 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -25,6 +25,9 @@ concurrency: 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: test_suites_chip_tool_darwin: name: Test Suites - Darwin diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 16f1dac307801f..50ab9277ab21e9 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: ameba: name: Ameba diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 2fbee87d14b155..150774f100cafa 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: bl602: name: BL602 diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index 192c1ce4e5b965..0345616d4cd901 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: cc26x2x7: name: cc26x2x7 diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 7ec57b528f8ec9..0fe49c305bd6e1 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: efr32: name: EFR32 diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index d58631614fc1d3..a65d5695ef6892 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: esp32: name: ESP32 diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index a5424b626892d6..235c5e30e498b2 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -23,6 +23,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: infineon: name: Infineon examples building @@ -69,7 +72,7 @@ jobs: run: | scripts/run_in_build_env.sh \ "scripts/build/build_examples.py \ - --enable-flashbundle --no-log-timestamps \ + --enable-flashbundle \ --target infineon-psoc6-lock \ build \ --copy-artifacts-to out/artifacts \ @@ -83,7 +86,7 @@ jobs: run: | scripts/run_in_build_env.sh \ "scripts/build/build_examples.py \ - --enable-flashbundle --no-log-timestamps \ + --enable-flashbundle \ --target infineon-psoc6-all-clusters \ build \ --copy-artifacts-to out/artifacts \ @@ -97,7 +100,7 @@ jobs: run: | scripts/run_in_build_env.sh \ "scripts/build/build_examples.py \ - --enable-flashbundle --no-log-timestamps \ + --enable-flashbundle \ --target infineon-psoc6-all-clusters-minimal \ build \ --copy-artifacts-to out/artifacts \ @@ -111,7 +114,7 @@ jobs: run: | scripts/run_in_build_env.sh \ "scripts/build/build_examples.py \ - --enable-flashbundle --no-log-timestamps \ + --enable-flashbundle \ --target infineon-psoc6-light \ build \ --copy-artifacts-to out/artifacts \ diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 890debf6989f57..cb2432b709bbca 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: k32w: name: K32W diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index deb4c5b83870b8..5aa8ebd1f3673a 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: arm_crosscompile: name: Linux ARM Cross compile @@ -64,11 +67,13 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Some samples timeout-minutes: 45 run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ + --target linux-arm64-chip-cert \ --target linux-arm64-all-clusters-clang \ --target linux-arm64-chip-tool-ipv6only-clang \ --target linux-arm64-lock-clang \ diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index b10825a43506f0..af74fd4ec93cec 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: imx: name: Linux i.MX Build @@ -45,18 +48,25 @@ jobs: - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux - - name: Build App + - name: Bootstrap + run: scripts/build/gn_bootstrap.sh + + - name: Build lighting-app timeout-minutes: 30 run: | - ./scripts/examples/imxlinux_example.sh \ - examples/lighting-app/linux/ examples/lighting-app/linux/out/aarch64 + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-lighting-app \ + build" - name: Clean out build output run: rm -rf ./out - name: Build chip-tool timeout-minutes: 30 run: | - ./scripts/examples/imxlinux_example.sh \ - examples/chip-tool examples/chip-tool/out/aarch64 + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target imx-chip-tool \ + build" - name: Clean out build output run: rm -rf ./out - name: Build thermostat @@ -64,8 +74,8 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target imx-thermostat build \ - " + --target imx-thermostat \ + build" - name: Clean out build output run: rm -rf ./out - name: Build all-cluster @@ -73,8 +83,8 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target imx-all-clusters-app build \ - " + --target imx-all-clusters-app \ + build" - name: Clean out build output run: rm -rf ./out - name: Build all-cluster-minimal @@ -82,8 +92,8 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target imx-all-clusters-minimal-app build \ - " + --target imx-all-clusters-minimal-app \ + build" - name: Clean out build output run: rm -rf ./out - name: Build ota-provider-app @@ -91,7 +101,7 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target imx-ota-provider-app build - " + --target imx-ota-provider-app \ + build" - name: Clean out build output run: rm -rf ./out diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 0d9a6f65ab124b..f8f50697244699 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -22,14 +22,14 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: linux_standalone: name: Linux Standalone timeout-minutes: 90 - env: - BUILD_TYPE: gn_linux - runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]' @@ -67,59 +67,75 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Standalone cert tool timeout-minutes: 10 run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps \ - --target linux-x64-chip-cert \ - --target linux-arm64-chip-cert \ - build \ - " + "./scripts/build/build_examples.py \ + --target linux-x64-chip-cert \ + build" - name: Build minmdns example with platform dns timeout-minutes: 10 run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target linux-x64-address-resolve-tool-platform-mdns-ipv6only build" + "./scripts/build/build_examples.py \ + --target linux-x64-address-resolve-tool-platform-mdns-ipv6only \ + build" - name: Build example Standalone Echo Client timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/chip-tool out/chip_tool_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-chip-tool \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug chip-tool \ - out/chip_tool_debug/chip-tool \ + out/linux-x64-chip-tool/chip-tool \ /tmp/bloat_reports/ - name: Build example Standalone Shell timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/shell/standalone out/shell_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-shell \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug shell \ - out/shell_debug/chip-shell \ + out/linux-x64-shell/chip-shell \ /tmp/bloat_reports/ - name: Build example Standalone All Clusters Server timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/all_clusters_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug all-clusters-app \ - out/all_clusters_debug/chip-all-clusters-app \ + out/linux-x64-all-clusters/chip-all-clusters-app \ /tmp/bloat_reports/ - name: Build example Standalone All Clusters Mininal Server timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/all-clusters-minimal-app/linux out/all_clusters_minimal_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-all-clusters-minimal \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug all-clusters-minimal-app \ - out/all_clusters_minimal_debug/chip-all-clusters-minimal-app \ + out/linux-x64-all-clusters-minimal/chip-all-clusters-app \ /tmp/bloat_reports/ - name: Build example TV app timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/tv-app/linux out/tv_app_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-tv-app \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug tv-app \ - out/tv_app_debug/chip-tv-app \ + out/linux-x64-tv-app/chip-tv-app \ /tmp/bloat_reports/ - name: Build example Standalone TV Casting App timeout-minutes: 10 @@ -135,37 +151,47 @@ jobs: - name: Build example lighting app with RPCs timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/lighting-app/linux out/lighting_app_debug_rpc \ - 'import("//with_pw_rpc.gni")' + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-light-rpc \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug+rpc lighting-app \ - out/lighting_app_debug_rpc/chip-lighting-app \ + out/linux-x64-light-rpc/chip-lighting-app \ /tmp/bloat_reports/ - name: Build example Standalone Bridge timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/bridge-app/linux out/bridge_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-bridge \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux debug+rpc bridge-app \ - out/bridge_debug/chip-bridge-app \ + linux debug bridge-app \ + out/linux-x64-bridge/chip-bridge-app \ /tmp/bloat_reports/ - name: Build example OTA Provider timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota_provider_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-ota-provider \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug ota-provider-app \ - out/ota_provider_debug/chip-ota-provider-app \ + out/linux-x64-ota-provider/chip-ota-provider-app \ /tmp/bloat_reports/ - name: Build example OTA Requestor timeout-minutes: 10 run: | - scripts/examples/gn_build_example.sh examples/ota-requestor-app/linux out/ota_requestor_debug + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-x64-ota-requestor \ + build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug ota-requestor-app \ - out/ota_requestor_debug/chip-ota-requestor-app \ + out/linux-x64-ota-requestor/chip-ota-requestor-app \ /tmp/bloat_reports/ - - name: Build example Standalone Lock App timeout-minutes: 10 run: | @@ -177,6 +203,7 @@ jobs: linux debug lock-app \ out/linux-x64-lock/chip-lock-app \ /tmp/bloat_reports/ + - name: Uploading Size Reports uses: actions/upload-artifact@v3 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 40df18d434ef59..1c9f28566a53f7 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -23,6 +23,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: mbedos: name: Mbed OS examples building @@ -150,7 +153,7 @@ jobs: mbed $APP_TARGET+$APP_PROFILE shell \ examples/ota-requestor-app/mbed/build-CY8CPROTO_062_4343W/release/chip-mbed-ota-requestor-app-example.elf \ /tmp/bloat_reports/ - + - name: Build unit tests # Temporarily disable build due to running out of flash space if: false diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index c0b8c9c53a987e..6fc10692981af7 100755 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: mw320: name: MW320 diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 8aaeb88d833534..29489e4cf41d62 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: nrfconnect: name: nRF Connect SDK @@ -209,7 +212,7 @@ jobs: .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf7002dk_nrf5340_cpuapp light-switch-app \ examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \ - /tmp/bloat_reports/ + /tmp/bloat_reports/ - name: Build example nRF Connect SDK Lighting App on nRF7002 PDK if: github.event_name == 'push' || steps.changed_paths.outputs.nrfconnect == 'true' timeout-minutes: 20 @@ -218,7 +221,7 @@ jobs: .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ nrfconnect nrf7002dk_nrf5340_cpuapp lighting-app \ examples/light-switch-app/nrfconnect/build/zephyr/zephyr.elf \ - /tmp/bloat_reports/ + /tmp/bloat_reports/ - name: Build example nRF Connect SDK All Clusters App on nRF7002 PDK timeout-minutes: 20 run: | diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 813318c8441aad..65aef1dcfce152 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: qpg: name: QPG diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index eac0d95ba6dae8..71855f1f4795f9 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: telink: name: Telink @@ -57,7 +60,7 @@ jobs: - name: Build example Telink All Clusters App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-all-clusters' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d all-clusters-app \ out/telink-tlsr9518adk80d-all-clusters/zephyr/zephyr.elf \ @@ -66,7 +69,7 @@ jobs: - name: Build example Telink All Clusters Minimal App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-all-clusters-minimal' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters-minimal' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d all-clusters-minimal-app \ out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \ @@ -75,7 +78,7 @@ jobs: - name: Build example Telink Lighting App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-light' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d lighting-app \ out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \ @@ -84,7 +87,7 @@ jobs: - name: Build example Telink Light Switch App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-light-switch' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-switch' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d light-switch-app \ out/telink-tlsr9518adk80d-light-switch/zephyr/zephyr.elf \ @@ -93,7 +96,7 @@ jobs: - name: Build example Telink OTA Requestor App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-ota-requestor' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-ota-requestor' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d ota-requestor-app \ out/telink-tlsr9518adk80d-ota-requestor/zephyr/zephyr.elf \ @@ -102,7 +105,7 @@ jobs: - name: Build example Telink Thermostat App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target 'telink-tlsr9518adk80d-thermostat' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ telink tlsr9518adk80d thermostat \ out/telink-tlsr9518adk80d-thermostat/zephyr/zephyr.elf \ diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index 5776927bfcaaea..ea8c08053b9ee0 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -22,11 +22,12 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: tizen: name: Tizen - env: - BUILD_TYPE: tizen runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]' @@ -49,6 +50,10 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform tizen + + - name: Bootstrap + run: scripts/build/gn_bootstrap.sh + - name: Build Tizen examples run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 457d727ce856bb..f159c28ed12488 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -22,6 +22,9 @@ concurrency: group: full-${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: full_android: name: Run @@ -73,35 +76,35 @@ jobs: - name: Build Android arm-chip-tool run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm-chip-tool build" + "./scripts/build/build_examples.py --target android-arm-chip-tool build" - name: Clean out build output run: rm -rf ./out - name: Build Android arm-tv-casting-app run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm-tv-casting-app build" + "./scripts/build/build_examples.py --target android-arm-tv-casting-app build" - name: Clean out build output run: rm -rf ./out - name: Build Android arm-tv-server run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm-tv-server build" + "./scripts/build/build_examples.py --target android-arm-tv-server build" - name: Clean out build output run: rm -rf ./out - name: Build Android arm64-tv-casting-app run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-tv-casting-app build" + "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" - name: Clean out build output run: rm -rf ./out - name: Build Android arm64-tv-server run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-tv-server build" + "./scripts/build/build_examples.py --target android-arm64-tv-server build" - name: Build Android arm64-chip-tool run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-chip-tool build" + "./scripts/build/build_examples.py --target android-arm64-chip-tool build" - name: Run Android build rule tests run: | ./scripts/run_in_build_env.sh \ @@ -111,4 +114,4 @@ jobs: # - name: Build Android Studio build (arm64 only) # run: | # ./scripts/run_in_build_env.sh \ - # "./scripts/build/build_examples.py --no-log-timestamps --target android-androidstudio-arm64-chip-tool build" + # "./scripts/build/build_examples.py --target android-androidstudio-arm64-chip-tool build" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index c654404df084cc..72001f45554873 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: build_linux_fuzzing: name: Build on Linux diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 08e4c59f7a2ad6..17bf5a5c45631e 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -22,6 +22,9 @@ concurrency: group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: qemu: name: ESP32 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 63aaa6790efd68..f74ec2160a3cad 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -22,6 +22,9 @@ concurrency: group: smoke-${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: android: name: Smoke Run - Android @@ -63,7 +66,7 @@ jobs: - name: Build Android CHIPTool and CHIPTest (ARM64) run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --no-log-timestamps --target android-arm64-chip-tool build" + "./scripts/build/build_examples.py --target android-arm64-chip-tool build" - name: Run Android build rule tests run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ea0dc5d1e2806a..23c03459c369c5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,6 +25,9 @@ concurrency: 'workflow_dispatch' && github.run_number) || github.sha }} cancel-in-progress: true +env: + CHIP_NO_LOG_TIMESTAMPS: true + jobs: test_suites_linux: name: Test Suites - Linux @@ -86,7 +89,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log - - name: Validate that xml are parseable + - name: Validate that xml are parsable timeout-minutes: 10 # The sub-items being run here are the same as the input XMLs listed # at src/app/zap-templates/zcl/zcl.json @@ -96,9 +99,9 @@ jobs: # unit tests) # # Also note ordering: global attributes are parsed first because other XML files may - # reference these. + # reference these. # - # TODO: some multipass/postprocess may be more appropriate to allow any ordering of + # TODO: some multipass/postprocess may be more appropriate to allow any ordering of # things. run: | ./scripts/run_in_build_env.sh \ @@ -225,6 +228,7 @@ jobs: path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 + test_suites_darwin: name: Test Suites - Darwin timeout-minutes: 150 @@ -336,6 +340,7 @@ jobs: path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 + repl_tests_linux: name: REPL Tests - Linux timeout-minutes: 130 @@ -408,6 +413,7 @@ jobs: path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 + java_tests_linux: name: Java Tests - Linux timeout-minutes: 130 diff --git a/scripts/build/build_examples.py b/scripts/build/build_examples.py index 780241f089a35f..14439f32289376 100755 --- a/scripts/build/build_examples.py +++ b/scripts/build/build_examples.py @@ -205,4 +205,4 @@ def cmd_build(context, copy_artifacts_to, create_archives): if __name__ == '__main__': - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/codegen.py b/scripts/codegen.py index ef228cb0486abc..67898af6ebce5f 100755 --- a/scripts/codegen.py +++ b/scripts/codegen.py @@ -147,4 +147,4 @@ def main(log_level, generator, output_dir, dry_run, name_only, expected_outputs, if __name__ == '__main__': - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/helpers/iwyu-check.py b/scripts/helpers/iwyu-check.py index 261544a3ecaad9..f4419ccd99ff10 100755 --- a/scripts/helpers/iwyu-check.py +++ b/scripts/helpers/iwyu-check.py @@ -197,4 +197,4 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir, if __name__ == '__main__': - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/idl/lint/lint_rules_parser.py b/scripts/idl/lint/lint_rules_parser.py index 9af6b8c0f05724..fdd507cdbc383e 100755 --- a/scripts/idl/lint/lint_rules_parser.py +++ b/scripts/idl/lint/lint_rules_parser.py @@ -306,4 +306,4 @@ def main(log_level, filename=None): logging.info("Data:") logging.info("%r" % data) - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/idl/matter_idl_parser.py b/scripts/idl/matter_idl_parser.py index e694a7a7aec7c9..4d84b8a7464193 100755 --- a/scripts/idl/matter_idl_parser.py +++ b/scripts/idl/matter_idl_parser.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -import enum import functools import logging +from enum import Enum from lark import Lark from lark.visitors import Transformer, v_args @@ -61,7 +61,7 @@ def apply(self, endpoint): class MatterIdlTransformer(Transformer): """ - A transformer capable to transform data parsed by Lark according to + A transformer capable to transform data parsed by Lark according to matter_grammar.lark. Generally transforms a ".matter" file into an Abstract Syntax Tree (AST). @@ -72,7 +72,7 @@ class MatterIdlTransformer(Transformer): purpose is to convert LARK tokens (that ar generally inputted by name) into underlying python types. - Some documentation to get started is available at + Some documentation to get started is available at https://lark-parser.readthedocs.io/en/latest/visitors.html#transformer TLDR would be: @@ -438,9 +438,10 @@ def CreateParser(skip_meta: bool = False): if __name__ == '__main__': # This Parser is generally not intended to be run as a stand-alone binary. # The ability to run is for debug and to print out the parsed AST. + import pprint + import click import coloredlogs - import pprint # Supported log levels, mapping string values required for argument # parsing into logging constants @@ -469,4 +470,4 @@ def main(log_level, filename=None): logging.info("Data:") pprint.pp(data) - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/idl/xml_parser.py b/scripts/idl/xml_parser.py index 979167ca11b156..f2955c973ef632 100755 --- a/scripts/idl/xml_parser.py +++ b/scripts/idl/xml_parser.py @@ -76,4 +76,4 @@ def main(log_level, no_print, filenames): print("Data:") pprint.pp(data) - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/idl_lint.py b/scripts/idl_lint.py index 01b8413d8c9fd6..83f606201f8bac 100755 --- a/scripts/idl_lint.py +++ b/scripts/idl_lint.py @@ -86,4 +86,4 @@ def main(log_level, rules, idl_path): if __name__ == "__main__": - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/run-clang-tidy-on-compile-commands.py b/scripts/run-clang-tidy-on-compile-commands.py index 728cd44b7c8f8c..90ca9ed6cf9fac 100755 --- a/scripts/run-clang-tidy-on-compile-commands.py +++ b/scripts/run-clang-tidy-on-compile-commands.py @@ -27,9 +27,6 @@ """ -import build -import click -import coloredlogs import glob import json import logging @@ -43,6 +40,9 @@ import tempfile import threading import traceback + +import click +import coloredlogs import yaml @@ -483,4 +483,4 @@ def cmd_fix(context): if __name__ == "__main__": - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/run_in_build_env.sh b/scripts/run_in_build_env.sh index 890f86fc5b6025..0d515bfe5b7ecc 100755 --- a/scripts/run_in_build_env.sh +++ b/scripts/run_in_build_env.sh @@ -26,5 +26,5 @@ fi set -e -echo "Executing in build environment: $@" +echo "Executing in build environment: $*" bash -c -- "$@" diff --git a/scripts/tests/run_python_test.py b/scripts/tests/run_python_test.py index e13d9b5edcd905..4318ee1221da35 100755 --- a/scripts/tests/run_python_test.py +++ b/scripts/tests/run_python_test.py @@ -14,13 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import click -import coloredlogs import datetime import logging import os -import pathlib -import pty import queue import re import shlex @@ -31,6 +27,8 @@ import time import typing +import click +import coloredlogs from colorama import Fore, Style DEFAULT_CHIP_ROOT = os.path.abspath( @@ -164,4 +162,4 @@ def main(app: str, factoryreset: bool, app_args: str, script: str, script_args: if __name__ == '__main__': - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index dbbda2a3863da2..1aac9d5ad9a442 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -16,7 +16,6 @@ import logging import os -import shutil import sys import time import typing @@ -281,4 +280,4 @@ def cmd_shell(context): if __name__ == '__main__': - main() + main(auto_envvar_prefix='CHIP') diff --git a/scripts/tools/convert_ini.py b/scripts/tools/convert_ini.py index d1abd22c4498df..35b43fb02cc8d0 100755 --- a/scripts/tools/convert_ini.py +++ b/scripts/tools/convert_ini.py @@ -17,12 +17,13 @@ # limitations under the License. # import json -from configparser import ConfigParser -import click -import typing +import logging import re +import typing +from configparser import ConfigParser from os.path import exists -import logging + +import click def convert_ini_to_json(ini_dir: str, json_path: str): @@ -106,4 +107,4 @@ def main(ini_dir: str, json_path: str): if __name__ == '__main__': - main() + main(auto_envvar_prefix='CHIP') From 013514b62c6d944cdf3cad030ec5499d623d750f Mon Sep 17 00:00:00 2001 From: achaulk-goog <107196446+achaulk-goog@users.noreply.github.com> Date: Fri, 2 Dec 2022 16:30:01 -0500 Subject: [PATCH 28/30] Fix -Wsign-conversion report in OpenSSL usage (#23839) * Fix -Wsign-conversion report in OpenSSL usage * Restyled by clang-format Co-authored-by: Restyled.io --- src/crypto/CHIPCryptoPALOpenSSL.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index f630aa40f4e9a2..8a24fde3c54fd4 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -1674,7 +1674,8 @@ CHIP_ERROR VerifyAttestationCertificateFormat(const ByteSpan & cert, Attestation { bool keyCertSignFlag = keyUsage & X509v3_KU_KEY_CERT_SIGN; bool crlSignFlag = keyUsage & X509v3_KU_CRL_SIGN; - bool otherFlags = keyUsage & ~(X509v3_KU_CRL_SIGN | X509v3_KU_KEY_CERT_SIGN | X509v3_KU_DIGITAL_SIGNATURE); + bool otherFlags = keyUsage & + ~static_cast(X509v3_KU_CRL_SIGN | X509v3_KU_KEY_CERT_SIGN | X509v3_KU_DIGITAL_SIGNATURE); VerifyOrExit(keyCertSignFlag && crlSignFlag && !otherFlags, err = CHIP_ERROR_INTERNAL); } } From 1945a0f5392538d9b78d79178f6cdd3e4936b9b3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 2 Dec 2022 17:00:58 -0500 Subject: [PATCH 29/30] Print onboarding codes in esp32 ota-requestor/provider apps. (#23863) We're not printing them now, which makes it hard to commission them. --- examples/ota-provider-app/esp32/main/main.cpp | 4 ++++ examples/ota-requestor-app/esp32/main/main.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/examples/ota-provider-app/esp32/main/main.cpp b/examples/ota-provider-app/esp32/main/main.cpp index 27f46ed6154efc..17276f9ac6cb56 100644 --- a/examples/ota-provider-app/esp32/main/main.cpp +++ b/examples/ota-provider-app/esp32/main/main.cpp @@ -20,6 +20,7 @@ #include "esp_spi_flash.h" #include "esp_spiffs.h" #include "nvs_flash.h" +#include #include #include #include @@ -75,6 +76,9 @@ chip::Callback::Callback onTransferFailedCallback(OnTransfe static void InitServer(intptr_t context) { + // Print QR Code URL + PrintOnboardingCodes(chip::RendezvousInformationFlags(CONFIG_RENDEZVOUS_MODE)); + Esp32AppServer::Init(); // Init ZCL Data Model and CHIP App Server AND Initialize device attestation config BdxOtaSender * bdxOtaSender = otaProvider.GetBdxOtaSender(); diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp index ba9ed616b05e5f..4b3c4d7a331339 100644 --- a/examples/ota-requestor-app/esp32/main/main.cpp +++ b/examples/ota-requestor-app/esp32/main/main.cpp @@ -27,6 +27,7 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "nvs_flash.h" +#include #include #include #include @@ -65,6 +66,9 @@ constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; static void InitServer(intptr_t context) { + // Print QR Code URL + PrintOnboardingCodes(chip::RendezvousInformationFlags(CONFIG_RENDEZVOUS_MODE)); + Esp32AppServer::Init(); // Init ZCL Data Model and CHIP App Server AND Initialize device attestation config // We only have network commissioning on endpoint 0. From 9c0ca132b88df505909636dc26ba6763e0f57735 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 3 Dec 2022 09:52:23 -0500 Subject: [PATCH 30/30] Fix Linux standalone job. (#23897) https://github.com/project-chip/connectedhomeip/pull/23797 raced with https://github.com/project-chip/connectedhomeip/pull/23876 to lead to a failing job. --- .github/workflows/examples-linux-standalone.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index f8f50697244699..16b1d8505cfd6d 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -115,7 +115,7 @@ jobs: linux debug all-clusters-app \ out/linux-x64-all-clusters/chip-all-clusters-app \ /tmp/bloat_reports/ - - name: Build example Standalone All Clusters Mininal Server + - name: Build example Standalone All Clusters Minimal Server timeout-minutes: 10 run: | ./scripts/run_in_build_env.sh \ @@ -124,7 +124,7 @@ jobs: build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ linux debug all-clusters-minimal-app \ - out/linux-x64-all-clusters-minimal/chip-all-clusters-app \ + out/linux-x64-all-clusters-minimal/chip-all-clusters-minimal-app \ /tmp/bloat_reports/ - name: Build example TV app timeout-minutes: 10