From ccaa43edd0e22e0f34094c99d811d0feaa9e157a Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 21 Oct 2024 05:58:01 -0700 Subject: [PATCH 01/13] [Fabric-Bridge] Cleanup unused flag (#36156) --- examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn | 1 - .../fabric-bridge-common/include/CHIPProjectAppConfig.h | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn b/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn index 3db4f1ebb13425..18615a0d195a50 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn +++ b/examples/fabric-bridge-app/fabric-bridge-common/BUILD.gn @@ -22,7 +22,6 @@ config("config") { chip_data_model("fabric-bridge-common-zap") { zap_file = "fabric-bridge-app.zap" is_server = true - cflags = [ "-DDYNAMIC_ENDPOINT_COUNT=16" ] } # This includes all the clusters that only exist on the dynamic endpoint. diff --git a/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h b/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h index 534079821043a8..f61f9f469fa2b4 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h +++ b/examples/fabric-bridge-app/fabric-bridge-common/include/CHIPProjectAppConfig.h @@ -30,8 +30,8 @@ // overrides CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT in CHIPProjectConfig #define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 16 -// include the CHIPProjectConfig from config/standalone -#include - // Allows app options (ports) to be configured on launch of app #define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +// Include the CHIPProjectConfig from platform implementation config +#include From d0e9166f93f2dccb038e87aa39c6b865b9225cf0 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 21 Oct 2024 05:58:56 -0700 Subject: [PATCH 02/13] [Fabric-Sync] Add build target for Raspberry Pi (#36158) --- examples/fabric-sync/README.md | 36 +++++++++++++++++-- scripts/build/build/targets.py | 1 + scripts/build/builders/host.py | 6 ++++ .../build/testdata/all_targets_linux_x64.txt | 2 +- 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/examples/fabric-sync/README.md b/examples/fabric-sync/README.md index dd24d3794457c2..6cbe9da9e9428d 100644 --- a/examples/fabric-sync/README.md +++ b/examples/fabric-sync/README.md @@ -83,12 +83,44 @@ defined: ### For Linux host example: ``` - ./scripts/examples/gn_build_example.sh examples/fabric-sync out/debug/standalone + source scripts/activate.sh + ./scripts/build/build_examples.py --target linux-x64-fabric-sync-no-ble build ``` ### For Raspberry Pi 4 example: - TODO + Pull Docker Images + + ``` + docker pull connectedhomeip/chip-build-vscode:latest + ``` + + Run docker + + ``` + docker run -it -v ~/connectedhomeip:/var/connectedhomeip connectedhomeip/chip-build-vscode:latest /bin/bash + ``` + + Build + + ``` + cd /var/connectedhomeip + + git config --global --add safe.directory /var/connectedhomeip + git config --global --add safe.directory /var/connectedhomeip/third_party/pigweed/repo + git config --global --add safe.directory /var/connectedhomeip/examples/common/QRCode/repo + + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-arm64-fabric-sync-no-ble-clang \ + build" + ``` + + Transfer the fabric-bridge-app binary to a Raspberry Pi + + ``` + scp ./fabric-sync ubuntu@xxx.xxx.xxx.xxx:/home/ubuntu + ``` ## Running the Complete Example on Ubuntu diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index fb68a3276c705a..9ddb7801530ae1 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -133,6 +133,7 @@ def BuildHostTarget(): TargetPart('bridge', app=HostApp.BRIDGE), TargetPart('fabric-admin', app=HostApp.FABRIC_ADMIN).OnlyIfRe("-rpc"), TargetPart('fabric-bridge', app=HostApp.FABRIC_BRIDGE).OnlyIfRe("-rpc"), + TargetPart('fabric-sync', app=HostApp.FABRIC_SYNC), TargetPart('tests', app=HostApp.TESTS), TargetPart('chip-cert', app=HostApp.CERT_TOOL), TargetPart('address-resolve-tool', app=HostApp.ADDRESS_RESOLVE), diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 8d209d6d29bf3f..3b81f5d94423fa 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -72,6 +72,7 @@ class HostApp(Enum): BRIDGE = auto() FABRIC_ADMIN = auto() FABRIC_BRIDGE = auto() + FABRIC_SYNC = auto() JAVA_MATTER_CONTROLLER = auto() KOTLIN_MATTER_CONTROLLER = auto() CONTACT_SENSOR = auto() @@ -131,6 +132,8 @@ def ExamplePath(self): return 'fabric-admin' elif self == HostApp.FABRIC_BRIDGE: return 'fabric-bridge-app/linux' + elif self == HostApp.FABRIC_SYNC: + return 'fabric-sync' elif self == HostApp.JAVA_MATTER_CONTROLLER: return 'java-matter-controller' elif self == HostApp.KOTLIN_MATTER_CONTROLLER: @@ -236,6 +239,9 @@ def OutputNames(self): elif self == HostApp.FABRIC_BRIDGE: yield 'fabric-bridge-app' yield 'fabric-bridge-app.map' + elif self == HostApp.FABRIC_SYNC: + yield 'fabric-sync' + yield 'fabric-sync.map' elif self == HostApp.JAVA_MATTER_CONTROLLER: yield 'java-matter-controller' yield 'java-matter-controller.map' diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 65755878191856..59466f91e6ec42 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -9,7 +9,7 @@ efr32-{brd2704b,brd4316a,brd4317a,brd4318a,brd4319a,brd4186a,brd4187a,brd2601b,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,energy-management,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only][-tracing][-data-model-disabled][-data-model-enabled] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management,water-leak-detector}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-no-shell][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,kotlin-matter-controller,minmdns,light,light-data-model-no-unique-id,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,fabric-admin,fabric-bridge,fabric-sync,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,microwave-oven,refrigerator,rvc,air-purifier,lit-icd,air-quality-sensor,network-manager,energy-management,water-leak-detector}[-nodeps][-nlfaultinject][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-no-shell][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-pw-fuzztest][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui][-evse-test-event][-enable-dnssd-tests][-disable-dnssd-tests][-chip-casting-simplified][-data-model-check][-data-model-disabled][-data-model-enabled][-check-failure-die] 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][-trustm] From 562acf2077f6130bae23bae45ae6701eb9bca363 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Mon, 21 Oct 2024 16:01:50 +0300 Subject: [PATCH 03/13] riscv:telink: fix alexa auto connect. (#36143) - enlarge the rx stack size to avoid crash. Signed-off-by: Haiwen Xia Co-authored-by: Haiwen Xia --- config/telink/chip-module/Kconfig.defaults | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/telink/chip-module/Kconfig.defaults b/config/telink/chip-module/Kconfig.defaults index ed8172b1824584..835b14c1811be0 100644 --- a/config/telink/chip-module/Kconfig.defaults +++ b/config/telink/chip-module/Kconfig.defaults @@ -137,7 +137,7 @@ config BT_BUF_ACL_TX_SIZE default 251 config BT_RX_STACK_SIZE - default 810 if BT_B9X + default 1352 if BT_B9X default 2048 if BT_W91 config BT_HCI_TX_STACK_SIZE From 8c31c3f92f5be28d224eba7d3dc428cb16394dfa Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Mon, 21 Oct 2024 15:03:49 +0200 Subject: [PATCH 04/13] Label platform changes in examples and test drivers (#36140) --- .github/labeler.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 7e02fe6d368df3..68d976ecd5b0df 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -275,14 +275,22 @@ darwin: silabs: - changed-files: - any-glob-to-any-file: + - examples/platform/silabs/* + - examples/platform/silabs/**/* - src/platform/silabs/* - src/platform/silabs/**/* + - src/test_driver/efr32/* + - src/test_driver/efr32/**/* esp32: - changed-files: - any-glob-to-any-file: + - examples/platform/esp32/* + - examples/platform/esp32/**/* - src/platform/ESP32/* - src/platform/ESP32/**/* + - src/test_driver/esp32/* + - src/test_driver/esp32/**/* freeRTOS: - changed-files: @@ -290,23 +298,31 @@ freeRTOS: - src/platform/FreeRTOS/* - src/platform/FreeRTOS/**/* -k32w: +nxp: - changed-files: - any-glob-to-any-file: - - src/platform/K32W/* - - src/platform/K32W/**/* + - examples/platform/nxp/* + - examples/platform/nxp/**/* + - src/platform/nxp/* + - src/platform/nxp/**/* linux: - changed-files: - any-glob-to-any-file: + - examples/platform/linux/* + - examples/platform/linux/**/* - src/platform/Linux/* - src/platform/Linux/**/* nrf connect: - changed-files: - any-glob-to-any-file: + - examples/platform/nrfconnect/* + - examples/platform/nrfconnect/**/* - src/platform/nrfconnect/* - src/platform/nrfconnect/**/* + - src/test_driver/nrfconnect/* + - src/test_driver/nrfconnect/**/* openthread: - changed-files: @@ -323,11 +339,17 @@ zephyr: telink: - changed-files: - any-glob-to-any-file: + - examples/platform/telink/* + - examples/platform/telink/**/* - src/platform/telink/* - src/platform/telink/**/* tizen: - changed-files: - any-glob-to-any-file: + - examples/platform/tizen/* + - examples/platform/tizen/**/* - src/platform/Tizen/* - src/platform/Tizen/**/* + - src/test_driver/tizen/* + - src/test_driver/tizen/**/* From db7c54a53c094988840de612692c5af0552c8993 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 21 Oct 2024 10:29:46 -0400 Subject: [PATCH 05/13] Minor update: avoid extra constructor on IsExistentAttributePath (#36130) --- src/app/InteractionModelEngine.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 269cc7f9158ee3..d88299c29da412 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -1507,20 +1507,14 @@ bool InteractionModelEngine::IsExistentAttributePath(const ConcreteAttributePath { #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE #if CHIP_CONFIG_USE_EMBER_DATA_MODEL - - bool providerResult = GetDataModelProvider() - ->GetAttributeInfo(ConcreteAttributePath(path.mEndpointId, path.mClusterId, path.mAttributeId)) - .has_value(); + bool providerResult = GetDataModelProvider()->GetAttributeInfo(path).has_value(); bool emberResult = emberAfContainsAttribute(path.mEndpointId, path.mClusterId, path.mAttributeId); // Ensure that Provider interface and ember are IDENTICAL in attribute location (i.e. "check" mode) VerifyOrDie(providerResult == emberResult); #endif - - return GetDataModelProvider() - ->GetAttributeInfo(ConcreteAttributePath(path.mEndpointId, path.mClusterId, path.mAttributeId)) - .has_value(); + return GetDataModelProvider()->GetAttributeInfo(path).has_value(); #else return emberAfContainsAttribute(path.mEndpointId, path.mClusterId, path.mAttributeId); #endif From 605e3f5250852a4068350a6b479501665ab0a906 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 21 Oct 2024 12:11:11 -0400 Subject: [PATCH 06/13] Remove the linux auto-label. (#36177) It tends to mark a lot of issues as 'linux' even though they are not. --- .github/issue-labeler.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml index 909ef045c039e4..f47ce859328801 100644 --- a/.github/issue-labeler.yml +++ b/.github/issue-labeler.yml @@ -12,8 +12,18 @@ darwin: # (?![a-z]) means "there is no next char in the range a-z". - "/(\\b[Ii][Oo][Ss](?![a-zA-Z])|[Hh][Oo][Mm][Ee][Pp][Oo][Dd]|[Dd][Aa][Rr][Ww][Ii][Nn]|\\bm[Aa][Cc]\\b|\\bMa[Cc]\\b|\\bM[Aa]c\\b|[Mm][Aa][Cc][Oo][Ss])/" -linux: - - "/(linux)/i" + +# NOTE: +# Linux intentionally disabled: most people compile either on linux or darwin and +# as a result a lot of issues get tagged as such even though they are not platform specific +# (e.g. we get test case failures reported as linux even though they are just normal +# test runs) +# +# Linux label should be reserved to platform-specific problems (usually bootstrap/packages +# or integration with wifi/ethernet/bluetootn/etc.) +# +# linux: +# - "/(linux)/i" # Special Keywords for Cert Blockers air purifiers: From 6f0a70c6c0c4ec0fc14bcbab1493dd1b8de40f27 Mon Sep 17 00:00:00 2001 From: andrei-menzopol <96489227+andrei-menzopol@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:59:46 +0300 Subject: [PATCH 07/13] [nxp][examples][common][lock-app] Add DiagnosticLog and Update zap file (#36120) * [nxp][examples][common] Update zap files to support Aliro Signed-off-by: Andrei Menzopol * [nxp][examples][common][lock-app] Add DiagnosticLog and Update zap file * Add DiagnosticLogs in lock-app ZclCallbacks.cpp * Update zap file: enable door-lock attributes Signed-off-by: Andrei Menzopol Signed-off-by: Ethan Tan --------- Signed-off-by: Andrei Menzopol Signed-off-by: Ethan Tan --- .../lock-app/nxp/common/main/ZclCallbacks.cpp | 17 + examples/lock-app/nxp/zap/lock-app.matter | 64 +- examples/lock-app/nxp/zap/lock-app.zap | 834 +++++++++++++++++- 3 files changed, 863 insertions(+), 52 deletions(-) diff --git a/examples/lock-app/nxp/common/main/ZclCallbacks.cpp b/examples/lock-app/nxp/common/main/ZclCallbacks.cpp index 98fb0f8c2bc20f..8806a2c058d6a2 100644 --- a/examples/lock-app/nxp/common/main/ZclCallbacks.cpp +++ b/examples/lock-app/nxp/common/main/ZclCallbacks.cpp @@ -35,11 +35,20 @@ #include "UserInterfaceFeedback.h" #endif +#if CONFIG_DIAG_LOGS_DEMO +#include +#include +#endif + using namespace ::chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::DoorLock; using chip::app::DataModel::Nullable; +#if CONFIG_DIAG_LOGS_DEMO +using namespace ::chip::app::Clusters::DiagnosticLogs; +#endif + void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value) { chip::DeviceManager::CHIPDeviceManagerCallbacks * cb = @@ -158,3 +167,11 @@ void emberAfPluginDoorLockOnAutoRelock(chip::EndpointId endpointId) DoorLockServer::Instance().SetLockState(1, DlLockState::kLocked, OperationSourceEnum::kAuto, NullNullable, NullNullable, NullNullable, NullNullable); } + +#if CONFIG_DIAG_LOGS_DEMO +void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint) +{ + auto & logProvider = LogProvider::GetInstance(); + DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider); +} +#endif diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index fc3a8917b2a3a0..8cf448449a5d76 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -2384,6 +2384,10 @@ endpoint 0 { callback attribute serverList; callback attribute clientList; callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; callback attribute featureMap; callback attribute clusterRevision; } @@ -2400,7 +2404,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 1; callback attribute clusterRevision; } @@ -2439,6 +2443,10 @@ endpoint 0 { ram attribute updatePossible default = 1; ram attribute updateState default = 0; ram attribute updateStateProgress default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -2622,6 +2630,10 @@ endpoint 0 { callback attribute windowStatus; callback attribute adminFabricIndex; callback attribute adminVendorId; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -2636,6 +2648,10 @@ endpoint 0 { callback attribute commissionedFabrics; callback attribute trustedRootCertificates; callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; @@ -2658,6 +2674,10 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; callback attribute featureMap; callback attribute clusterRevision; @@ -2725,13 +2745,18 @@ endpoint 1 { ram attribute numberOfTotalUsersSupported default = 10; ram attribute numberOfPINUsersSupported default = 10; ram attribute numberOfRFIDUsersSupported default = 10; + ram attribute numberOfWeekDaySchedulesSupportedPerUser default = 10; + ram attribute numberOfYearDaySchedulesSupportedPerUser default = 10; + ram attribute numberOfHolidaySchedulesSupported default = 10; ram attribute maxPINCodeLength default = 8; ram attribute minPINCodeLength default = 6; ram attribute maxRFIDCodeLength default = 20; ram attribute minRFIDCodeLength default = 10; ram attribute credentialRulesSupport default = 1; ram attribute numberOfCredentialsSupportedPerUser default = 5; - ram attribute autoRelockTime; + ram attribute language default = "en"; + ram attribute autoRelockTime default = 60; + ram attribute soundVolume default = 0; ram attribute operatingMode default = 0x00; ram attribute supportedOperatingModes default = 0xFFF6; ram attribute enableOneTouchLocking default = 0x00; @@ -2739,16 +2764,49 @@ endpoint 1 { ram attribute wrongCodeEntryLimit default = 3; ram attribute userCodeTemporaryDisableTime default = 10; ram attribute requirePINforRemoteOperation default = 0; + callback attribute aliroReaderVerificationKey; + callback attribute aliroReaderGroupIdentifier; + callback attribute aliroReaderGroupSubIdentifier; + callback attribute aliroExpeditedTransactionSupportedProtocolVersions; + callback attribute aliroGroupResolvingKey; + callback attribute aliroSupportedBLEUWBProtocolVersions; + callback attribute aliroBLEAdvertisingVersion; + callback attribute numberOfAliroCredentialIssuerKeysSupported; + callback attribute numberOfAliroEndpointKeysSupported; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0x0001; + ram attribute featureMap default = 0x7DB3; ram attribute clusterRevision default = 7; handle command LockDoor; handle command UnlockDoor; handle command UnlockWithTimeout; + handle command SetWeekDaySchedule; + handle command GetWeekDaySchedule; + handle command GetWeekDayScheduleResponse; + handle command ClearWeekDaySchedule; + handle command SetYearDaySchedule; + handle command GetYearDaySchedule; + handle command GetYearDayScheduleResponse; + handle command ClearYearDaySchedule; + handle command SetHolidaySchedule; + handle command GetHolidaySchedule; + handle command GetHolidayScheduleResponse; + handle command ClearHolidaySchedule; + handle command SetUser; + handle command GetUser; + handle command GetUserResponse; + handle command ClearUser; + handle command SetCredential; + handle command SetCredentialResponse; + handle command GetCredentialStatus; + handle command GetCredentialStatusResponse; + handle command ClearCredential; + handle command UnboltDoor; + handle command SetAliroReaderConfig; + handle command ClearAliroReaderConfig; } } diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 67da76956d2e1d..e888db45055184 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -96,7 +96,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -112,7 +112,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -128,6 +128,70 @@ "singleton": 0, "bounded": 0, "defaultValue": null, + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -186,7 +250,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -202,7 +266,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -329,7 +393,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "1", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -388,7 +452,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -404,7 +468,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -420,7 +484,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -436,7 +500,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -452,7 +516,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -468,7 +532,7 @@ "singleton": 1, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -484,7 +548,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -500,7 +564,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -516,7 +580,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -532,7 +596,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -548,7 +612,7 @@ "singleton": 1, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -870,6 +934,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -946,7 +1074,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -962,7 +1090,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -1834,7 +1962,7 @@ "singleton": 0, "bounded": 0, "defaultValue": null, - "reportable": 1, + "reportable": 0, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -2056,8 +2184,8 @@ "bounded": 0, "defaultValue": null, "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 }, { @@ -3244,6 +3372,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -3481,52 +3673,116 @@ "reportableChange": 0 }, { - "name": "FeatureMap", - "code": 65532, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", - "type": "bitmap32", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", - "type": "int16u", + "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": null, "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, + "minInterval": 1, + "maxInterval": 65534, "reportableChange": 0 - } - ] - }, - { - "name": "Group Key Management", - "code": 63, - "mfgCode": null, - "define": "GROUP_KEY_MANAGEMENT_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ + }, { - "name": "KeySetWrite", - "code": 0, + "name": "EventList", + "code": 65530, "mfgCode": null, - "source": "client", + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", "isIncoming": 1, "isEnabled": 1 }, @@ -3636,6 +3892,70 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -4210,6 +4530,198 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "SetWeekDaySchedule", + "code": 11, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetWeekDaySchedule", + "code": 12, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetWeekDayScheduleResponse", + "code": 12, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ClearWeekDaySchedule", + "code": 13, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetYearDaySchedule", + "code": 14, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetYearDaySchedule", + "code": 15, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetYearDayScheduleResponse", + "code": 15, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ClearYearDaySchedule", + "code": 16, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetHolidaySchedule", + "code": 17, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetHolidaySchedule", + "code": 18, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetHolidayScheduleResponse", + "code": 18, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ClearHolidaySchedule", + "code": 19, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetUser", + "code": 26, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetUser", + "code": 27, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetUserResponse", + "code": 28, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ClearUser", + "code": 29, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetCredential", + "code": 34, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetCredentialResponse", + "code": 35, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "GetCredentialStatus", + "code": 36, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "GetCredentialStatusResponse", + "code": 37, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "ClearCredential", + "code": 38, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "UnboltDoor", + "code": 39, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "SetAliroReaderConfig", + "code": 40, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ClearAliroReaderConfig", + "code": 41, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -4325,6 +4837,54 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "NumberOfWeekDaySchedulesSupportedPerUser", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfYearDaySchedulesSupportedPerUser", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfHolidaySchedulesSupported", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "MaxPINCodeLength", "code": 23, @@ -4421,6 +4981,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "Language", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "AutoRelockTime", "code": 35, @@ -4431,7 +5007,23 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "60", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoundVolume", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4549,6 +5141,150 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "AliroReaderVerificationKey", + "code": 128, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AliroReaderGroupIdentifier", + "code": 129, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AliroReaderGroupSubIdentifier", + "code": 130, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AliroExpeditedTransactionSupportedProtocolVersions", + "code": 131, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AliroGroupResolvingKey", + "code": 132, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AliroSupportedBLEUWBProtocolVersions", + "code": 133, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AliroBLEAdvertisingVersion", + "code": 134, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfAliroCredentialIssuerKeysSupported", + "code": 135, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfAliroEndpointKeysSupported", + "code": 136, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -4623,7 +5359,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0x7DB3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From 9ee0499d591039e75ab20cad845d384e3d957688 Mon Sep 17 00:00:00 2001 From: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:25:48 +0100 Subject: [PATCH 08/13] DEMM, EVSEM, WHM, EEVSE, DEM, EWATERHTR zap XML out of date with 1.4 specs (#36155) * Fixes #36059 * regen_all after change to mode cluster ZCL XML * Checking on EEVSE the cluster revision was wrong (looks like the rev 4 was backed out after it was felt to still be a draft). Taken in the DEM and WHM latest descriptions based on Alchemy autogen. * revert description in DEM which was truncated by Alchemy * regen_all * Removed src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml, Test_TC_EEVSEM_3_2.yaml, Test_TC_EEVSEM_3_3.yaml which were removed in test plan PR: https://github.com/CHIP-Specifications/chip-test-plans/pull/4553 * Reverted change to domain since ZAP does not show the clusters if the element text is empty --- .../all-clusters-app.matter | 30 +- .../data_model/dishwasher-thread-app.matter | 11 +- .../data_model/dishwasher-wifi-app.matter | 11 +- .../energy-management-app.matter | 30 +- .../certification/Test_TC_EEVSEM_3_1.yaml | 134 --- .../certification/Test_TC_EEVSEM_3_2.yaml | 172 ---- .../certification/Test_TC_EEVSEM_3_3.yaml | 189 ---- .../chip/device-energy-management-cluster.xml | 41 +- .../device-energy-management-mode-cluster.xml | 49 +- .../data-model/chip/energy-evse-cluster.xml | 48 +- .../chip/energy-evse-mode-cluster.xml | 42 +- .../chip/water-heater-management-cluster.xml | 12 +- .../chip/water-heater-mode-cluster.xml | 40 +- .../data_model/controller-clusters.matter | 30 +- .../chip/devicecontroller/ChipClusters.java | 240 ------ .../devicecontroller/ClusterIDMapping.java | 6 - .../devicecontroller/ClusterInfoMapping.java | 126 --- .../devicecontroller/ClusterReadMapping.java | 66 -- .../devicecontroller/ClusterWriteMapping.java | 132 --- .../DeviceEnergyManagementModeCluster.kt | 305 ------- .../cluster/clusters/EnergyEvseModeCluster.kt | 305 ------- .../clusters/WaterHeaterModeCluster.kt | 305 ------- .../CHIPAttributeTLVValueDecoder.cpp | 138 --- .../python/chip/clusters/CHIPClusters.py | 42 - .../python/chip/clusters/Objects.py | 109 +-- .../MTRAttributeSpecifiedCheck.mm | 18 - .../MTRAttributeTLVValueDecoder.mm | 90 -- .../CHIP/zap-generated/MTRBaseClusters.h | 58 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 414 --------- .../CHIP/zap-generated/MTRClusterConstants.h | 6 - .../CHIP/zap-generated/MTRClusterNames.mm | 24 - .../CHIP/zap-generated/MTRClusters.h | 24 - .../CHIP/zap-generated/MTRClusters.mm | 96 --- .../zap-generated/attributes/Accessors.cpp | 574 +------------ .../zap-generated/attributes/Accessors.h | 66 -- .../app-common/zap-generated/cluster-enums.h | 1 + .../zap-generated/cluster-objects.cpp | 12 - .../zap-generated/cluster-objects.h | 78 -- .../app-common/zap-generated/ids/Attributes.h | 24 - .../zap-generated/cluster/Commands.h | 30 - .../cluster/logging/DataModelLogger.cpp | 30 - .../cluster/logging/EntryToText.cpp | 12 - .../zap-generated/cluster/Commands.h | 810 ------------------ 43 files changed, 179 insertions(+), 4801 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index aa3ef44b066cdd..4888bf464cf85d 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4709,13 +4709,13 @@ provisional cluster DeviceEnergyManagement = 152 { command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; - /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. */ command CancelRequest(): DefaultSuccess = 7; } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ cluster EnergyEvse = 153 { - revision 4; + revision 3; enum EnergyTransferStoppedReasonEnum : enum8 { kEVStopped = 0; @@ -4880,9 +4880,9 @@ cluster EnergyEvse = 153 { /** Allows a client to disable the EVSE from charging and discharging. */ timed command Disable(): DefaultSuccess = 1; - /** This command allows a client to enable the EVSE to charge an EV, */ + /** This command allows a client to enable the EVSE to charge an EV, and to provide or update the maximum and minimum charge current. */ timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; - /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ + /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, and to provide or update the maximum discharge current. */ timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; /** Allows a client to put the EVSE into a self-diagnostics mode. */ timed command StartDiagnostics(): DefaultSuccess = 4; @@ -4951,7 +4951,7 @@ cluster PowerTopology = 156 { /** Attributes and commands for selecting a mode from a list of supported options. */ cluster EnergyEvseMode = 157 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -4967,6 +4967,7 @@ cluster EnergyEvseMode = 157 { kManual = 16384; kTimeOfUse = 16385; kSolarCharging = 16386; + kV2X = 16387; } bitmap Feature : bitmap32 { @@ -4986,8 +4987,6 @@ cluster EnergyEvseMode = 157 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5004,8 +5003,7 @@ cluster EnergyEvseMode = 157 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } @@ -5046,8 +5044,6 @@ cluster WaterHeaterMode = 158 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5061,17 +5057,16 @@ cluster WaterHeaterMode = 158 { response struct ChangeToModeResponse = 1 { enum8 status = 0; - optional char_string statusText = 1; + optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster DeviceEnergyManagementMode = 159 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -5107,8 +5102,6 @@ provisional cluster DeviceEnergyManagementMode = 159 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5125,8 +5118,7 @@ provisional cluster DeviceEnergyManagementMode = 159 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter index 0d217ab47b4256..43ac95d4ba4b7c 100644 --- a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter @@ -2227,7 +2227,7 @@ provisional cluster DeviceEnergyManagement = 152 { command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; - /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. */ command CancelRequest(): DefaultSuccess = 7; } @@ -2254,7 +2254,7 @@ cluster PowerTopology = 156 { /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster DeviceEnergyManagementMode = 159 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -2290,8 +2290,6 @@ provisional cluster DeviceEnergyManagementMode = 159 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2308,8 +2306,7 @@ provisional cluster DeviceEnergyManagementMode = 159 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } @@ -2792,8 +2789,6 @@ endpoint 3 { server cluster DeviceEnergyManagementMode { callback attribute supportedModes; callback attribute currentMode; - ram attribute startUpMode; - ram attribute onMode; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter index 3c8601d09bee9b..4d1106449ad2fd 100644 --- a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter @@ -2138,7 +2138,7 @@ provisional cluster DeviceEnergyManagement = 152 { command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; - /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. */ command CancelRequest(): DefaultSuccess = 7; } @@ -2165,7 +2165,7 @@ cluster PowerTopology = 156 { /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster DeviceEnergyManagementMode = 159 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -2201,8 +2201,6 @@ provisional cluster DeviceEnergyManagementMode = 159 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2219,8 +2217,7 @@ provisional cluster DeviceEnergyManagementMode = 159 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } @@ -2652,8 +2649,6 @@ endpoint 3 { server cluster DeviceEnergyManagementMode { callback attribute supportedModes; callback attribute currentMode; - ram attribute startUpMode; - ram attribute onMode; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter index a8a10075efec17..5da8448194d2f8 100644 --- a/examples/energy-management-app/energy-management-common/energy-management-app.matter +++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter @@ -2019,13 +2019,13 @@ provisional cluster DeviceEnergyManagement = 152 { command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; - /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. */ command CancelRequest(): DefaultSuccess = 7; } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ cluster EnergyEvse = 153 { - revision 4; + revision 3; enum EnergyTransferStoppedReasonEnum : enum8 { kEVStopped = 0; @@ -2190,9 +2190,9 @@ cluster EnergyEvse = 153 { /** Allows a client to disable the EVSE from charging and discharging. */ timed command Disable(): DefaultSuccess = 1; - /** This command allows a client to enable the EVSE to charge an EV, */ + /** This command allows a client to enable the EVSE to charge an EV, and to provide or update the maximum and minimum charge current. */ timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; - /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ + /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, and to provide or update the maximum discharge current. */ timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; /** Allows a client to put the EVSE into a self-diagnostics mode. */ timed command StartDiagnostics(): DefaultSuccess = 4; @@ -2227,7 +2227,7 @@ cluster PowerTopology = 156 { /** Attributes and commands for selecting a mode from a list of supported options. */ cluster EnergyEvseMode = 157 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -2243,6 +2243,7 @@ cluster EnergyEvseMode = 157 { kManual = 16384; kTimeOfUse = 16385; kSolarCharging = 16386; + kV2X = 16387; } bitmap Feature : bitmap32 { @@ -2262,8 +2263,6 @@ cluster EnergyEvseMode = 157 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2280,8 +2279,7 @@ cluster EnergyEvseMode = 157 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } @@ -2322,8 +2320,6 @@ cluster WaterHeaterMode = 158 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2337,17 +2333,16 @@ cluster WaterHeaterMode = 158 { response struct ChangeToModeResponse = 1 { enum8 status = 0; - optional char_string statusText = 1; + optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster DeviceEnergyManagementMode = 159 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -2383,8 +2378,6 @@ provisional cluster DeviceEnergyManagementMode = 159 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2401,8 +2394,7 @@ provisional cluster DeviceEnergyManagementMode = 159 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml deleted file mode 100644 index 2d38a6c1465236..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_1.yaml +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (c) 2024 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. - -name: 183.3.1. [TC-EEVSEM-3.1] On Mode functionality with DUT as Server - -PICS: - - EEVSEM.S.A0003 - - MOD.S.F00 - - OO.S.C00.Rsp - - OO.S.C01.Rsp - -config: - nodeId: 0x12344321 - cluster: "Energy EVSE Mode" - endpoint: 1 - - ConfigureOnMode: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 2 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Precondition: TH writes from the DUT the OnMode attribute.NOTE: To - execute this test case set onmode to any integer value because as - default it value has null." - PICS: EEVSEM.S.A0003 && MOD.S.F00 - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: ConfigureOnMode - - - label: "Step 2: TH reads from the DUT the OnMode attribute." - PICS: EEVSEM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: on_mode_dut - constraints: - type: int8u - minValue: 0 - maxValue: 254 - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: EEVSEM.S.A0001 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - constraints: - type: int8u - minValue: 0 - maxValue: 254 - - - label: - "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. - Else proceed to step 6." - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: on_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 4: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: EEVSEM.S.A0000 && MOD.S.F00 - command: "readAttribute" - attribute: "SupportedModes" - response: - constraints: - type: list - minLength: 2 - - - label: - "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - runIf: IsExpectedValue - PICS: EEVSEM.S.C00.Rsp && MOD.S.F00 - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 6:TH sends a Off command to the DUT" - PICS: OO.S.C00.Rsp - cluster: "On/Off" - command: "Off" - - - label: "Step 7:TH sends a On command to the DUT" - PICS: OO.S.C01.Rsp - cluster: "On/Off" - command: "On" - - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." - PICS: EEVSEM.S.A0001 && EEVSEM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "CurrentMode" - response: - value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml deleted file mode 100644 index 0251528f9ffe94..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_2.yaml +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright (c) 2024 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. - -name: 269.3.2. [TC-EEVSEM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - EEVSEM.S.A0002 - -config: - nodeId: 0x12344321 - cluster: "Energy EVSE Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: EEVSEM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - - - label: - "Step 2: If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5." - PICS: EEVSEM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: EEVSEM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: EEVSEM.S.A0002 - runIf: IsExpectedValue - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: EEVSEM.S.A0001 - command: "readAttribute" - attribute: "CurrentMode" - response: - saveAs: old_current_mode_dut - - - label: - "Step 5: If startup_mode_dut is equal to old_current_mode_dut proceed - to step 6. Else proceed to step 8." - PICS: EEVSEM.S.A0001 && EEVSEM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: old_current_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: EEVSEM.S.A0000 - runIf: Step5_IsExpectedValue - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: EEVSEM.S.C00.Rsp - runIf: Step5_IsExpectedValue - command: "ChangeToMode" - arguments: - values: - - name: "NewMode" - value: new_mode_th - response: - values: - - name: "Status" - value: 0x00 - - - label: "Step 8: Physically power cycle the device" - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: EEVSEM.S.A0002 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: new_start_up_mode_dut - constraints: - anyOf: [startup_mode_dut, new_start_up_mode_th] - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: EEVSEM.S.A0001 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_start_up_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml deleted file mode 100644 index e60aa1ca60c740..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_EEVSEM_3_3.yaml +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright (c) 2024 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. - -name: - 269.3.3. [TC-EEVSEM-3.3] On Mode and Startup Mode functionality with DUT as - Server - -PICS: - - EEVSEM.S.A0002 - - EEVSEM.S.A0003 - - MOD.S.F00 - - OO.S.A4003 - -config: - nodeId: 0x12344321 - cluster: "Energy EVSE Mode" - endpoint: 1 - - new_start_up_mode_th: - type: int8u - defaultValue: 0 - new_mode_th: - type: int8u - defaultValue: 1 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: EEVSEM.S.A0002 - command: "readAttribute" - attribute: "StartUpMode" - response: - saveAs: startup_mode_dut - - - label: - "Step 2: If startup_mode_dut is null proceed to step 3. Else save - startup_mode_dut as new_start_up_mode_th and proceed to step 5." - PICS: EEVSEM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: startup_mode_dut - - name: "Value2" - value: null - response: - - values: - - name: "Equals" - saveAs: IsExpectedValue - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - runIf: IsExpectedValue - PICS: EEVSEM.S.A0000 - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: EEVSEM.S.A0002 - runIf: IsExpectedValue - command: "writeAttribute" - attribute: "StartUpMode" - arguments: - value: new_start_up_mode_th - - - label: "Step 5: TH reads from the DUT the OnMode attribute." - PICS: EEVSEM.S.A0003 && EEVSEM.S.A0002 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: old_on_mode_dut - - - label: - "Step 5: If startup_mode_dut is equal to old_on_mode_dut proceed to - step 6. Else proceed to step 8." - PICS: EEVSEM.S.A0002 - cluster: "EqualityCommands" - command: "UnsignedNumberEquals" - arguments: - values: - - name: "Value1" - value: old_on_mode_dut - - name: "Value2" - value: startup_mode_dut - response: - - values: - - name: "Equals" - saveAs: Step5_IsExpectedValue - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: EEVSEM.S.A0000 && EEVSEM.S.A0002 - runIf: Step5_IsExpectedValue - command: "readAttribute" - attribute: "SupportedModes" - response: - saveAs: Step6_supported_modes_dut - constraints: - type: list - minLength: 2 - - - label: - "Step 7: TH writes to the DUT the OnMode attribute with the - new_mode_th value" - PICS: EEVSEM.S.A0003 - runIf: Step5_IsExpectedValue - command: "writeAttribute" - attribute: "OnMode" - arguments: - value: new_mode_th - - - label: "Step 8: TH reads from the DUT the OnMode attribute." - PICS: EEVSEM.S.A0003 && MOD.S.F00 - command: "readAttribute" - attribute: "OnMode" - response: - saveAs: new_on_mode_dut - - - label: - "Step 9: TH writes to the DUT the StartUpOnOff attribute with the - value 1." - PICS: OO.S.A4003 - cluster: "On/Off" - command: "writeAttribute" - attribute: "StartUpOnOff" - arguments: - value: 1 - - - label: "Step 10: Physically power cycle the device" - verification: | - Physically power cycle the device. - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: "Step 11: TH reads from the DUT the StartUpMode attribute." - PICS: EEVSEM.S.A0002 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "StartUpMode" - response: - constraints: - anyOf: [new_start_up_mode_th, startup_mode_dut] - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: EEVSEM.S.A0001 && PICS_USER_PROMPT - command: "readAttribute" - attribute: "CurrentMode" - response: - value: new_on_mode_dut diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml index b087f3c162ab8d..3550dd0301be99 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-cluster.xml @@ -1,6 +1,6 @@ - + + Device Energy Management @@ -26,12 +32,10 @@ limitations under the License. This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). - + - + @@ -49,28 +53,23 @@ future power consumption vs time."> - + - + - + - + - + @@ -126,26 +125,26 @@ planned operation."> - Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command + Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. - PowerAdjustStart + This event SHALL be generated when the Power Adjustment session is started. - PowerAdjustEnd + This event SHALL be generated when the Power Adjustment session ends. - Paused + This event SHALL be generated when the ESA enters the Paused state. - Resumed + This event SHALL be generated when the ESA leaves the Paused state and resumes operation. diff --git a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml index 3ee32897b4df06..c3440adebef3f6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/device-energy-management-mode-cluster.xml @@ -14,9 +14,14 @@ 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. --> - + + - - - - - + + + + - General + Energy Management Device Energy Management Mode 0x009F DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER true true Attributes and commands for selecting a mode from a list of supported options. - - + - + - - SupportedModes - CurrentMode - StartUpMode - OnMode - + SupportedModes + CurrentMode - - This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - + This command is used to change device modes. + - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - + This command is sent by the device on receipt of the ChangeToMode command. + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml index 94774774d53a10..7a4a40d2e39966 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-cluster.xml @@ -1,6 +1,6 @@ - + + @@ -94,25 +100,31 @@ limitations under the License. true true Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. - + + + + - + - - - - + + + + - + + + + @@ -146,7 +158,7 @@ limitations under the License. NextChargeTargetSoC - + ApproximateEVEfficiency @@ -169,13 +181,13 @@ limitations under the License. - This command allows a client to enable the EVSE to charge an EV, + This command allows a client to enable the EVSE to charge an EV, and to provide or update the maximum and minimum charge current. - Upon receipt, this SHALL allow a client to enable the discharge of an EV, + Upon receipt, this SHALL allow a client to enable the discharge of an EV, and to provide or update the maximum discharge current. @@ -201,12 +213,12 @@ limitations under the License. - EVConnected + This event SHALL be generated when the EV is plugged in. - EVNotDetected + This event SHALL be generated when the EV is unplugged or not detected (having been previously plugged in). @@ -215,7 +227,7 @@ limitations under the License. - EnergyTransferStarted + This event SHALL be generated whenever the EV starts charging or discharging, except when an EV has switched between charging and discharging under the control of the PowerAdjustment feature of the Device Energy Management cluster of the associated Device Energy Management device. @@ -223,7 +235,7 @@ limitations under the License. - EnergyTransferStopped + This event SHALL be generated whenever the EV stops charging or discharging, except when an EV has switched between charging and discharging under the control of the PowerAdjustment feature of the Device Energy Management cluster of the associated Device Energy Management device. @@ -232,7 +244,7 @@ limitations under the License. - Fault + If the EVSE detects a fault it SHALL generate a Fault Event. @@ -240,7 +252,7 @@ limitations under the License. - RFID + This event SHALL be generated when a RFID card has been read. diff --git a/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml index b5dc56682132a5..b28daf8899636c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/energy-evse-mode-cluster.xml @@ -14,9 +14,14 @@ 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. --> - + + - + - General + Energy Management Energy EVSE Mode 0x009D ENERGY_EVSE_MODE_CLUSTER true true Attributes and commands for selecting a mode from a list of supported options. - - + - + - - SupportedModes - CurrentMode - StartUpMode - OnMode - + SupportedModes + CurrentMode - - This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - + This command is used to change device modes. + - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - + This command is sent by the device on receipt of the ChangeToMode command. + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml index 8246930e5b4dab..beeaf277b77d2e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/water-heater-management-cluster.xml @@ -14,7 +14,13 @@ 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. --> - + + @@ -76,12 +82,12 @@ limitations under the License. - BoostStarted + This event SHALL be generated whenever a Boost command is accepted. - BoostEnded + This event SHALL be generated whenever the BoostState transitions from Active to Inactive. diff --git a/src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml index 502f9e3f032b54..d9211e808467fb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/water-heater-mode-cluster.xml @@ -14,12 +14,16 @@ 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. --> - + + - - @@ -33,7 +37,6 @@ limitations under the License. - @@ -41,7 +44,7 @@ limitations under the License. - General + Energy Management Water Heater Mode 0x009E WATER_HEATER_MODE_CLUSTER @@ -49,34 +52,25 @@ limitations under the License. true Attributes and commands for selecting a mode from a list of supported options. - - + - - SupportedModes - CurrentMode - StartUpMode - OnMode - + SupportedModes + CurrentMode - - This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. - - + This command is used to change device modes. + - - This command is sent by the device on receipt of the ChangeToModeWithStatus command. - - - + This command is sent by the device on receipt of the ChangeToMode command. + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 3b777477b217d6..d663a5f018a217 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5260,13 +5260,13 @@ provisional cluster DeviceEnergyManagement = 152 { command ModifyForecastRequest(ModifyForecastRequestRequest): DefaultSuccess = 5; /** Allows a client to ask the ESA to recompute its Forecast based on power and time constraints. */ command RequestConstraintBasedForecast(RequestConstraintBasedForecastRequest): DefaultSuccess = 6; - /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command */ + /** Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. */ command CancelRequest(): DefaultSuccess = 7; } /** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */ cluster EnergyEvse = 153 { - revision 4; + revision 3; enum EnergyTransferStoppedReasonEnum : enum8 { kEVStopped = 0; @@ -5431,9 +5431,9 @@ cluster EnergyEvse = 153 { /** Allows a client to disable the EVSE from charging and discharging. */ timed command Disable(): DefaultSuccess = 1; - /** This command allows a client to enable the EVSE to charge an EV, */ + /** This command allows a client to enable the EVSE to charge an EV, and to provide or update the maximum and minimum charge current. */ timed command EnableCharging(EnableChargingRequest): DefaultSuccess = 2; - /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, */ + /** Upon receipt, this SHALL allow a client to enable the discharge of an EV, and to provide or update the maximum discharge current. */ timed command EnableDischarging(EnableDischargingRequest): DefaultSuccess = 3; /** Allows a client to put the EVSE into a self-diagnostics mode. */ timed command StartDiagnostics(): DefaultSuccess = 4; @@ -5502,7 +5502,7 @@ cluster PowerTopology = 156 { /** Attributes and commands for selecting a mode from a list of supported options. */ cluster EnergyEvseMode = 157 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -5518,6 +5518,7 @@ cluster EnergyEvseMode = 157 { kManual = 16384; kTimeOfUse = 16385; kSolarCharging = 16386; + kV2X = 16387; } bitmap Feature : bitmap32 { @@ -5537,8 +5538,6 @@ cluster EnergyEvseMode = 157 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5555,8 +5554,7 @@ cluster EnergyEvseMode = 157 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } @@ -5597,8 +5595,6 @@ cluster WaterHeaterMode = 158 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5612,17 +5608,16 @@ cluster WaterHeaterMode = 158 { response struct ChangeToModeResponse = 1 { enum8 status = 0; - optional char_string statusText = 1; + optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } /** Attributes and commands for selecting a mode from a list of supported options. */ provisional cluster DeviceEnergyManagementMode = 159 { - revision 1; + revision 2; enum ModeTag : enum16 { kAuto = 0; @@ -5658,8 +5653,6 @@ provisional cluster DeviceEnergyManagementMode = 159 { readonly attribute ModeOptionStruct supportedModes[] = 0; readonly attribute int8u currentMode = 1; - attribute optional nullable int8u startUpMode = 2; - attribute optional nullable int8u onMode = 3; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5676,8 +5669,7 @@ provisional cluster DeviceEnergyManagementMode = 159 { optional char_string<64> statusText = 1; } - /** This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + /** This command is used to change device modes. */ command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 5560704fd36ced..dff134bddd1a18 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -33304,8 +33304,6 @@ public static class EnergyEvseModeCluster extends BaseChipCluster { private static final long SUPPORTED_MODES_ATTRIBUTE_ID = 0L; private static final long CURRENT_MODE_ATTRIBUTE_ID = 1L; - private static final long START_UP_MODE_ATTRIBUTE_ID = 2L; - private static final long ON_MODE_ATTRIBUTE_ID = 3L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -33368,14 +33366,6 @@ public interface SupportedModesAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public interface StartUpModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); - } - - public interface OnModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); - } - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -33444,76 +33434,6 @@ public void onSuccess(byte[] tlv) { }, CURRENT_MODE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readStartUpModeAttribute( - StartUpModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, START_UP_MODE_ATTRIBUTE_ID, true); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value) { - writeStartUpModeAttribute(callback, value, 0); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), START_UP_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeStartUpModeAttribute( - StartUpModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, START_UP_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readOnModeAttribute( - OnModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, true); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { - writeOnModeAttribute(callback, value, 0); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), ON_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeOnModeAttribute( - OnModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); @@ -33676,8 +33596,6 @@ public static class WaterHeaterModeCluster extends BaseChipCluster { private static final long SUPPORTED_MODES_ATTRIBUTE_ID = 0L; private static final long CURRENT_MODE_ATTRIBUTE_ID = 1L; - private static final long START_UP_MODE_ATTRIBUTE_ID = 2L; - private static final long ON_MODE_ATTRIBUTE_ID = 3L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -33740,14 +33658,6 @@ public interface SupportedModesAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public interface StartUpModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); - } - - public interface OnModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); - } - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -33816,76 +33726,6 @@ public void onSuccess(byte[] tlv) { }, CURRENT_MODE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readStartUpModeAttribute( - StartUpModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, START_UP_MODE_ATTRIBUTE_ID, true); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value) { - writeStartUpModeAttribute(callback, value, 0); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), START_UP_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeStartUpModeAttribute( - StartUpModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, START_UP_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readOnModeAttribute( - OnModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, true); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { - writeOnModeAttribute(callback, value, 0); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), ON_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeOnModeAttribute( - OnModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); @@ -34048,8 +33888,6 @@ public static class DeviceEnergyManagementModeCluster extends BaseChipCluster { private static final long SUPPORTED_MODES_ATTRIBUTE_ID = 0L; private static final long CURRENT_MODE_ATTRIBUTE_ID = 1L; - private static final long START_UP_MODE_ATTRIBUTE_ID = 2L; - private static final long ON_MODE_ATTRIBUTE_ID = 3L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -34112,14 +33950,6 @@ public interface SupportedModesAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } - public interface StartUpModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); - } - - public interface OnModeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Integer value); - } - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -34188,76 +34018,6 @@ public void onSuccess(byte[] tlv) { }, CURRENT_MODE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readStartUpModeAttribute( - StartUpModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, START_UP_MODE_ATTRIBUTE_ID, true); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value) { - writeStartUpModeAttribute(callback, value, 0); - } - - public void writeStartUpModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), START_UP_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeStartUpModeAttribute( - StartUpModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, START_UP_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, START_UP_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readOnModeAttribute( - OnModeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, true); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value) { - writeOnModeAttribute(callback, value, 0); - } - - public void writeOnModeAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); - writeAttribute(new WriteAttributesCallbackImpl(callback), ON_MODE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeOnModeAttribute( - OnModeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ON_MODE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ON_MODE_ATTRIBUTE_ID, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute( GeneratedCommandListAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 9ab44a7257397a..a43df66e40bf0a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -10227,8 +10227,6 @@ public long getID() { public enum Attribute { SupportedModes(0L), CurrentMode(1L), - StartUpMode(2L), - OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -10349,8 +10347,6 @@ public long getID() { public enum Attribute { SupportedModes(0L), CurrentMode(1L), - StartUpMode(2L), - OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -10471,8 +10467,6 @@ public long getID() { public enum Attribute { SupportedModes(0L), CurrentMode(1L), - StartUpMode(2L), - OnMode(3L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 6e89ac926fd9a3..d0e83258a32ae5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -11742,48 +11742,6 @@ public void onError(Exception ex) { } } - public static class DelegatedEnergyEvseModeClusterStartUpModeAttributeCallback implements ChipClusters.EnergyEvseModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Integer value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedEnergyEvseModeClusterOnModeAttributeCallback implements ChipClusters.EnergyEvseModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Integer value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedEnergyEvseModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.EnergyEvseModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -11913,48 +11871,6 @@ public void onError(Exception ex) { } } - public static class DelegatedWaterHeaterModeClusterStartUpModeAttributeCallback implements ChipClusters.WaterHeaterModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Integer value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedWaterHeaterModeClusterOnModeAttributeCallback implements ChipClusters.WaterHeaterModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Integer value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedWaterHeaterModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.WaterHeaterModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -12084,48 +12000,6 @@ public void onError(Exception ex) { } } - public static class DelegatedDeviceEnergyManagementModeClusterStartUpModeAttributeCallback implements ChipClusters.DeviceEnergyManagementModeCluster.StartUpModeAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Integer value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedDeviceEnergyManagementModeClusterOnModeAttributeCallback implements ChipClusters.DeviceEnergyManagementModeCluster.OnModeAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(@Nullable Integer value) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedDeviceEnergyManagementModeClusterGeneratedCommandListAttributeCallback implements ChipClusters.DeviceEnergyManagementModeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 616f9f299bee1a..9abbcd879c5503 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -10236,28 +10236,6 @@ private static Map readEnergyEvseModeInteractionInfo() readEnergyEvseModeCurrentModeCommandParams ); result.put("readCurrentModeAttribute", readEnergyEvseModeCurrentModeAttributeInteractionInfo); - Map readEnergyEvseModeStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readEnergyEvseModeStartUpModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EnergyEvseModeCluster) cluster).readStartUpModeAttribute( - (ChipClusters.EnergyEvseModeCluster.StartUpModeAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedEnergyEvseModeClusterStartUpModeAttributeCallback(), - readEnergyEvseModeStartUpModeCommandParams - ); - result.put("readStartUpModeAttribute", readEnergyEvseModeStartUpModeAttributeInteractionInfo); - Map readEnergyEvseModeOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readEnergyEvseModeOnModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EnergyEvseModeCluster) cluster).readOnModeAttribute( - (ChipClusters.EnergyEvseModeCluster.OnModeAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedEnergyEvseModeClusterOnModeAttributeCallback(), - readEnergyEvseModeOnModeCommandParams - ); - result.put("readOnModeAttribute", readEnergyEvseModeOnModeAttributeInteractionInfo); Map readEnergyEvseModeGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readEnergyEvseModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -10350,28 +10328,6 @@ private static Map readWaterHeaterModeInteractionInfo() readWaterHeaterModeCurrentModeCommandParams ); result.put("readCurrentModeAttribute", readWaterHeaterModeCurrentModeAttributeInteractionInfo); - Map readWaterHeaterModeStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readWaterHeaterModeStartUpModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WaterHeaterModeCluster) cluster).readStartUpModeAttribute( - (ChipClusters.WaterHeaterModeCluster.StartUpModeAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedWaterHeaterModeClusterStartUpModeAttributeCallback(), - readWaterHeaterModeStartUpModeCommandParams - ); - result.put("readStartUpModeAttribute", readWaterHeaterModeStartUpModeAttributeInteractionInfo); - Map readWaterHeaterModeOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readWaterHeaterModeOnModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WaterHeaterModeCluster) cluster).readOnModeAttribute( - (ChipClusters.WaterHeaterModeCluster.OnModeAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedWaterHeaterModeClusterOnModeAttributeCallback(), - readWaterHeaterModeOnModeCommandParams - ); - result.put("readOnModeAttribute", readWaterHeaterModeOnModeAttributeInteractionInfo); Map readWaterHeaterModeGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readWaterHeaterModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -10464,28 +10420,6 @@ private static Map readDeviceEnergyManagementModeIntera readDeviceEnergyManagementModeCurrentModeCommandParams ); result.put("readCurrentModeAttribute", readDeviceEnergyManagementModeCurrentModeAttributeInteractionInfo); - Map readDeviceEnergyManagementModeStartUpModeCommandParams = new LinkedHashMap(); - InteractionInfo readDeviceEnergyManagementModeStartUpModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DeviceEnergyManagementModeCluster) cluster).readStartUpModeAttribute( - (ChipClusters.DeviceEnergyManagementModeCluster.StartUpModeAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedDeviceEnergyManagementModeClusterStartUpModeAttributeCallback(), - readDeviceEnergyManagementModeStartUpModeCommandParams - ); - result.put("readStartUpModeAttribute", readDeviceEnergyManagementModeStartUpModeAttributeInteractionInfo); - Map readDeviceEnergyManagementModeOnModeCommandParams = new LinkedHashMap(); - InteractionInfo readDeviceEnergyManagementModeOnModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DeviceEnergyManagementModeCluster) cluster).readOnModeAttribute( - (ChipClusters.DeviceEnergyManagementModeCluster.OnModeAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedDeviceEnergyManagementModeClusterOnModeAttributeCallback(), - readDeviceEnergyManagementModeOnModeCommandParams - ); - result.put("readOnModeAttribute", readDeviceEnergyManagementModeOnModeAttributeInteractionInfo); Map readDeviceEnergyManagementModeGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readDeviceEnergyManagementModeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index cfc302460fbcf6..725fd0baeccf65 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -1205,142 +1205,10 @@ public Map> getWriteAttributeMap() { Map writePowerTopologyInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("powerTopology", writePowerTopologyInteractionInfo); Map writeEnergyEvseModeInteractionInfo = new LinkedHashMap<>(); - Map writeEnergyEvseModeStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo energyEvseModestartUpModeCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeEnergyEvseModeStartUpModeCommandParams.put( - "value", - energyEvseModestartUpModeCommandParameterInfo - ); - InteractionInfo writeEnergyEvseModeStartUpModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EnergyEvseModeCluster) cluster).writeStartUpModeAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeEnergyEvseModeStartUpModeCommandParams - ); - writeEnergyEvseModeInteractionInfo.put("writeStartUpModeAttribute", writeEnergyEvseModeStartUpModeAttributeInteractionInfo); - Map writeEnergyEvseModeOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo energyEvseModeonModeCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeEnergyEvseModeOnModeCommandParams.put( - "value", - energyEvseModeonModeCommandParameterInfo - ); - InteractionInfo writeEnergyEvseModeOnModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.EnergyEvseModeCluster) cluster).writeOnModeAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeEnergyEvseModeOnModeCommandParams - ); - writeEnergyEvseModeInteractionInfo.put("writeOnModeAttribute", writeEnergyEvseModeOnModeAttributeInteractionInfo); writeAttributeMap.put("energyEvseMode", writeEnergyEvseModeInteractionInfo); Map writeWaterHeaterModeInteractionInfo = new LinkedHashMap<>(); - Map writeWaterHeaterModeStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo waterHeaterModestartUpModeCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeWaterHeaterModeStartUpModeCommandParams.put( - "value", - waterHeaterModestartUpModeCommandParameterInfo - ); - InteractionInfo writeWaterHeaterModeStartUpModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WaterHeaterModeCluster) cluster).writeStartUpModeAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeWaterHeaterModeStartUpModeCommandParams - ); - writeWaterHeaterModeInteractionInfo.put("writeStartUpModeAttribute", writeWaterHeaterModeStartUpModeAttributeInteractionInfo); - Map writeWaterHeaterModeOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo waterHeaterModeonModeCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeWaterHeaterModeOnModeCommandParams.put( - "value", - waterHeaterModeonModeCommandParameterInfo - ); - InteractionInfo writeWaterHeaterModeOnModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.WaterHeaterModeCluster) cluster).writeOnModeAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeWaterHeaterModeOnModeCommandParams - ); - writeWaterHeaterModeInteractionInfo.put("writeOnModeAttribute", writeWaterHeaterModeOnModeAttributeInteractionInfo); writeAttributeMap.put("waterHeaterMode", writeWaterHeaterModeInteractionInfo); Map writeDeviceEnergyManagementModeInteractionInfo = new LinkedHashMap<>(); - Map writeDeviceEnergyManagementModeStartUpModeCommandParams = new LinkedHashMap(); - CommandParameterInfo deviceEnergyManagementModestartUpModeCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeDeviceEnergyManagementModeStartUpModeCommandParams.put( - "value", - deviceEnergyManagementModestartUpModeCommandParameterInfo - ); - InteractionInfo writeDeviceEnergyManagementModeStartUpModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DeviceEnergyManagementModeCluster) cluster).writeStartUpModeAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeDeviceEnergyManagementModeStartUpModeCommandParams - ); - writeDeviceEnergyManagementModeInteractionInfo.put("writeStartUpModeAttribute", writeDeviceEnergyManagementModeStartUpModeAttributeInteractionInfo); - Map writeDeviceEnergyManagementModeOnModeCommandParams = new LinkedHashMap(); - CommandParameterInfo deviceEnergyManagementModeonModeCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeDeviceEnergyManagementModeOnModeCommandParams.put( - "value", - deviceEnergyManagementModeonModeCommandParameterInfo - ); - InteractionInfo writeDeviceEnergyManagementModeOnModeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.DeviceEnergyManagementModeCluster) cluster).writeOnModeAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeDeviceEnergyManagementModeOnModeCommandParams - ); - writeDeviceEnergyManagementModeInteractionInfo.put("writeOnModeAttribute", writeDeviceEnergyManagementModeOnModeAttributeInteractionInfo); writeAttributeMap.put("deviceEnergyManagementMode", writeDeviceEnergyManagementModeInteractionInfo); Map writeDoorLockInteractionInfo = new LinkedHashMap<>(); Map writeDoorLockDoorOpenEventsCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementModeCluster.kt index 657941cb3f0964..95ccc5a67287d9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/DeviceEnergyManagementModeCluster.kt @@ -32,9 +32,6 @@ import matter.controller.SubscriptionState import matter.controller.UByteSubscriptionState import matter.controller.UIntSubscriptionState import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse import matter.controller.cluster.structs.* import matter.controller.model.AttributePath import matter.controller.model.CommandPath @@ -60,26 +57,6 @@ class DeviceEnergyManagementModeCluster( object SubscriptionEstablished : SupportedModesAttributeSubscriptionState() } - class StartUpModeAttribute(val value: UByte?) - - sealed class StartUpModeAttributeSubscriptionState { - data class Success(val value: UByte?) : StartUpModeAttributeSubscriptionState() - - data class Error(val exception: Exception) : StartUpModeAttributeSubscriptionState() - - object SubscriptionEstablished : StartUpModeAttributeSubscriptionState() - } - - class OnModeAttribute(val value: UByte?) - - sealed class OnModeAttributeSubscriptionState { - data class Success(val value: UByte?) : OnModeAttributeSubscriptionState() - - data class Error(val exception: Exception) : OnModeAttributeSubscriptionState() - - object SubscriptionEstablished : OnModeAttributeSubscriptionState() - } - class GeneratedCommandListAttribute(val value: List) sealed class GeneratedCommandListAttributeSubscriptionState { @@ -364,288 +341,6 @@ class DeviceEnergyManagementModeCluster( } } - suspend fun readStartUpModeAttribute(): StartUpModeAttribute { - val ATTRIBUTE_ID: UInt = 2u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Startupmode attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - return StartUpModeAttribute(decodedValue) - } - - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 2u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeStartUpModeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - StartUpModeAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Startupmode attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - decodedValue?.let { emit(StartUpModeAttributeSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(StartUpModeAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readOnModeAttribute(): OnModeAttribute { - val ATTRIBUTE_ID: UInt = 3u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Onmode attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - return OnModeAttribute(decodedValue) - } - - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 3u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeOnModeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 3u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - OnModeAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Onmode attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - decodedValue?.let { emit(OnModeAttributeSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(OnModeAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { val ATTRIBUTE_ID: UInt = 65528u diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseModeCluster.kt index a854ec8d1f71b4..00baf3ce4a4173 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseModeCluster.kt @@ -32,9 +32,6 @@ import matter.controller.SubscriptionState import matter.controller.UByteSubscriptionState import matter.controller.UIntSubscriptionState import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse import matter.controller.cluster.structs.* import matter.controller.model.AttributePath import matter.controller.model.CommandPath @@ -60,26 +57,6 @@ class EnergyEvseModeCluster( object SubscriptionEstablished : SupportedModesAttributeSubscriptionState() } - class StartUpModeAttribute(val value: UByte?) - - sealed class StartUpModeAttributeSubscriptionState { - data class Success(val value: UByte?) : StartUpModeAttributeSubscriptionState() - - data class Error(val exception: Exception) : StartUpModeAttributeSubscriptionState() - - object SubscriptionEstablished : StartUpModeAttributeSubscriptionState() - } - - class OnModeAttribute(val value: UByte?) - - sealed class OnModeAttributeSubscriptionState { - data class Success(val value: UByte?) : OnModeAttributeSubscriptionState() - - data class Error(val exception: Exception) : OnModeAttributeSubscriptionState() - - object SubscriptionEstablished : OnModeAttributeSubscriptionState() - } - class GeneratedCommandListAttribute(val value: List) sealed class GeneratedCommandListAttributeSubscriptionState { @@ -362,288 +339,6 @@ class EnergyEvseModeCluster( } } - suspend fun readStartUpModeAttribute(): StartUpModeAttribute { - val ATTRIBUTE_ID: UInt = 2u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Startupmode attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - return StartUpModeAttribute(decodedValue) - } - - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 2u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeStartUpModeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - StartUpModeAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Startupmode attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - decodedValue?.let { emit(StartUpModeAttributeSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(StartUpModeAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readOnModeAttribute(): OnModeAttribute { - val ATTRIBUTE_ID: UInt = 3u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Onmode attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - return OnModeAttribute(decodedValue) - } - - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 3u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeOnModeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 3u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - OnModeAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Onmode attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - decodedValue?.let { emit(OnModeAttributeSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(OnModeAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { val ATTRIBUTE_ID: UInt = 65528u diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterModeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterModeCluster.kt index 27352644935c8a..d2bc5094fe12a9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterModeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/WaterHeaterModeCluster.kt @@ -32,9 +32,6 @@ import matter.controller.SubscriptionState import matter.controller.UByteSubscriptionState import matter.controller.UIntSubscriptionState import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse import matter.controller.cluster.structs.* import matter.controller.model.AttributePath import matter.controller.model.CommandPath @@ -60,26 +57,6 @@ class WaterHeaterModeCluster( object SubscriptionEstablished : SupportedModesAttributeSubscriptionState() } - class StartUpModeAttribute(val value: UByte?) - - sealed class StartUpModeAttributeSubscriptionState { - data class Success(val value: UByte?) : StartUpModeAttributeSubscriptionState() - - data class Error(val exception: Exception) : StartUpModeAttributeSubscriptionState() - - object SubscriptionEstablished : StartUpModeAttributeSubscriptionState() - } - - class OnModeAttribute(val value: UByte?) - - sealed class OnModeAttributeSubscriptionState { - data class Success(val value: UByte?) : OnModeAttributeSubscriptionState() - - data class Error(val exception: Exception) : OnModeAttributeSubscriptionState() - - object SubscriptionEstablished : OnModeAttributeSubscriptionState() - } - class GeneratedCommandListAttribute(val value: List) sealed class GeneratedCommandListAttributeSubscriptionState { @@ -362,288 +339,6 @@ class WaterHeaterModeCluster( } } - suspend fun readStartUpModeAttribute(): StartUpModeAttribute { - val ATTRIBUTE_ID: UInt = 2u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Startupmode attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - return StartUpModeAttribute(decodedValue) - } - - suspend fun writeStartUpModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 2u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeStartUpModeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - StartUpModeAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Startupmode attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - decodedValue?.let { emit(StartUpModeAttributeSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(StartUpModeAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readOnModeAttribute(): OnModeAttribute { - val ATTRIBUTE_ID: UInt = 3u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Onmode attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - return OnModeAttribute(decodedValue) - } - - suspend fun writeOnModeAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 3u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeOnModeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 3u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - OnModeAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Onmode attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - } else { - tlvReader.getNull(AnonymousTag) - null - } - - decodedValue?.let { emit(OnModeAttributeSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(OnModeAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { val ATTRIBUTE_ID: UInt = 65528u diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 905347e73f92d8..972cc32e536787 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -25877,52 +25877,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - if (cppValue.IsNull()) - { - value = nullptr; - } - else - { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - if (cppValue.IsNull()) - { - value = nullptr; - } - else - { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -26194,52 +26148,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - if (cppValue.IsNull()) - { - value = nullptr; - } - else - { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - if (cppValue.IsNull()) - { - value = nullptr; - } - else - { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -26513,52 +26421,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - if (cppValue.IsNull()) - { - value = nullptr; - } - else - { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - if (cppValue.IsNull()) - { - value = nullptr; - } - else - { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue.Value()); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index a3b2a05cb67553..7bc1cb66b4a9c4 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -7336,20 +7336,6 @@ class ChipClusters: "type": "int", "reportable": True, }, - 0x00000002: { - "attributeName": "StartUpMode", - "attributeId": 0x00000002, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000003: { - "attributeName": "OnMode", - "attributeId": 0x00000003, - "type": "int", - "reportable": True, - "writable": True, - }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, @@ -7413,20 +7399,6 @@ class ChipClusters: "type": "int", "reportable": True, }, - 0x00000002: { - "attributeName": "StartUpMode", - "attributeId": 0x00000002, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000003: { - "attributeName": "OnMode", - "attributeId": 0x00000003, - "type": "int", - "reportable": True, - "writable": True, - }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, @@ -7490,20 +7462,6 @@ class ChipClusters: "type": "int", "reportable": True, }, - 0x00000002: { - "attributeName": "StartUpMode", - "attributeId": 0x00000002, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000003: { - "attributeName": "OnMode", - "attributeId": 0x00000003, - "type": "int", - "reportable": True, - "writable": True, - }, 0x0000FFF8: { "attributeName": "GeneratedCommandList", "attributeId": 0x0000FFF8, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 076dc946e39898..e6e74717dc739a 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -27020,8 +27020,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[EnergyEvseMode.Structs.ModeOptionStruct]), ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -27032,8 +27030,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: supportedModes: typing.List[EnergyEvseMode.Structs.ModeOptionStruct] = field(default_factory=lambda: []) currentMode: uint = 0 - startUpMode: typing.Union[None, Nullable, uint] = None - onMode: typing.Union[None, Nullable, uint] = None generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) eventList: typing.List[uint] = field(default_factory=lambda: []) @@ -27056,6 +27052,7 @@ class ModeTag(MatterIntEnum): kManual = 0x4000 kTimeOfUse = 0x4001 kSolarCharging = 0x4002 + kV2x = 0x4003 # kUnknownEnumValue intentionally not defined. This enum never goes # through DataModel::Decode, likely because it is a part of a derived # cluster. As a result having kUnknownEnumValue in this enum is error @@ -27163,38 +27160,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: uint = 0 - @dataclass - class StartUpMode(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000009D - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: typing.Union[None, Nullable, uint] = None - - @dataclass - class OnMode(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000009D - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: typing.Union[None, Nullable, uint] = None - @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -27302,8 +27267,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[WaterHeaterMode.Structs.ModeOptionStruct]), ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -27314,8 +27277,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: supportedModes: typing.List[WaterHeaterMode.Structs.ModeOptionStruct] = field(default_factory=lambda: []) currentMode: uint = 0 - startUpMode: typing.Union[None, Nullable, uint] = None - onMode: typing.Union[None, Nullable, uint] = None generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) eventList: typing.List[uint] = field(default_factory=lambda: []) @@ -27445,38 +27406,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: uint = 0 - @dataclass - class StartUpMode(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000009E - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: typing.Union[None, Nullable, uint] = None - - @dataclass - class OnMode(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000009E - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: typing.Union[None, Nullable, uint] = None - @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -27584,8 +27513,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: Fields=[ ClusterObjectFieldDescriptor(Label="supportedModes", Tag=0x00000000, Type=typing.List[DeviceEnergyManagementMode.Structs.ModeOptionStruct]), ClusterObjectFieldDescriptor(Label="currentMode", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="startUpMode", Tag=0x00000002, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="onMode", Tag=0x00000003, Type=typing.Union[None, Nullable, uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -27596,8 +27523,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: supportedModes: typing.List[DeviceEnergyManagementMode.Structs.ModeOptionStruct] = field(default_factory=lambda: []) currentMode: uint = 0 - startUpMode: typing.Union[None, Nullable, uint] = None - onMode: typing.Union[None, Nullable, uint] = None generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) eventList: typing.List[uint] = field(default_factory=lambda: []) @@ -27728,38 +27653,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: uint = 0 - @dataclass - class StartUpMode(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000009F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: typing.Union[None, Nullable, uint] = None - - @dataclass - class OnMode(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000009F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, uint]) - - value: typing.Union[None, Nullable, uint] = None - @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 31a1d57e3bc2c3..4f75da11d76b1a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -3354,12 +3354,6 @@ static BOOL AttributeIsSpecifiedInEnergyEVSEModeCluster(AttributeId aAttributeId case Attributes::CurrentMode::Id: { return YES; } - case Attributes::StartUpMode::Id: { - return YES; - } - case Attributes::OnMode::Id: { - return YES; - } case Attributes::GeneratedCommandList::Id: { return YES; } @@ -3393,12 +3387,6 @@ static BOOL AttributeIsSpecifiedInWaterHeaterModeCluster(AttributeId aAttributeI case Attributes::CurrentMode::Id: { return YES; } - case Attributes::StartUpMode::Id: { - return YES; - } - case Attributes::OnMode::Id: { - return YES; - } case Attributes::GeneratedCommandList::Id: { return YES; } @@ -3432,12 +3420,6 @@ static BOOL AttributeIsSpecifiedInDeviceEnergyManagementModeCluster(AttributeId case Attributes::CurrentMode::Id: { return YES; } - case Attributes::StartUpMode::Id: { - return YES; - } - case Attributes::OnMode::Id: { - return YES; - } case Attributes::GeneratedCommandList::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 5e6e0486606e6b..b735c0f56c1ea1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9799,36 +9799,6 @@ static id _Nullable DecodeAttributeValueForEnergyEVSEModeCluster(AttributeId aAt value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } default: { break; } @@ -9907,36 +9877,6 @@ static id _Nullable DecodeAttributeValueForWaterHeaterModeCluster(AttributeId aA value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } default: { break; } @@ -10015,36 +9955,6 @@ static id _Nullable DecodeAttributeValueForDeviceEnergyManagementModeCluster(Att value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } default: { break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index bba11808021618..eda0c7b5a06431 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7775,7 +7775,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command CancelRequest * - * Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command + * Allows a client to request cancellation of a previous adjustment request in a StartTimeAdjustRequest, ModifyForecastRequest or RequestConstraintBasedForecast command. */ - (void)cancelRequestWithParams:(MTRDeviceEnergyManagementClusterCancelRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)cancelRequestWithCompletion:(MTRStatusCompletion)completion @@ -7901,13 +7901,13 @@ MTR_PROVISIONALLY_AVAILABLE /** * Command EnableCharging * - * This command allows a client to enable the EVSE to charge an EV, + * This command allows a client to enable the EVSE to charge an EV, and to provide or update the maximum and minimum charge current. */ - (void)enableChargingWithParams:(MTREnergyEVSEClusterEnableChargingParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** * Command EnableDischarging * - * Upon receipt, this SHALL allow a client to enable the discharge of an EV, + * Upon receipt, this SHALL allow a client to enable the discharge of an EV, and to provide or update the maximum discharge current. */ - (void)enableDischargingWithParams:(MTREnergyEVSEClusterEnableDischargingParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** @@ -8318,7 +8318,6 @@ MTR_PROVISIONALLY_AVAILABLE * Command ChangeToMode * * This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - (void)changeToModeWithParams:(MTREnergyEVSEModeClusterChangeToModeParams *)params completion:(void (^)(MTREnergyEVSEModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; @@ -8334,22 +8333,6 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeStartUpModeWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - -- (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeOnModeWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -8415,7 +8398,6 @@ MTR_PROVISIONALLY_AVAILABLE * Command ChangeToMode * * This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - (void)changeToModeWithParams:(MTRWaterHeaterModeClusterChangeToModeParams *)params completion:(void (^)(MTRWaterHeaterModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; @@ -8431,22 +8413,6 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeStartUpModeWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - -- (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeOnModeWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -8512,7 +8478,6 @@ MTR_PROVISIONALLY_AVAILABLE * Command ChangeToMode * * This command is used to change device modes. - On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ - (void)changeToModeWithParams:(MTRDeviceEnergyManagementModeClusterChangeToModeParams *)params completion:(void (^)(MTRDeviceEnergyManagementModeClusterChangeToModeResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; @@ -8528,22 +8493,6 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeStartUpModeWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - -- (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeOnModeWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -18962,6 +18911,7 @@ typedef NS_ENUM(uint16_t, MTREnergyEVSEModeModeTag) { MTREnergyEVSEModeModeTagManual MTR_PROVISIONALLY_AVAILABLE = 0x4000, MTREnergyEVSEModeModeTagTimeOfUse MTR_PROVISIONALLY_AVAILABLE = 0x4001, MTREnergyEVSEModeModeTagSolarCharging MTR_PROVISIONALLY_AVAILABLE = 0x4002, + MTREnergyEVSEModeModeTagV2X MTR_PROVISIONALLY_AVAILABLE = 0x4003, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTREnergyEVSEModeFeature) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index cda854f0c80c91..6e2ea748a37766 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -54060,144 +54060,6 @@ + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheConta completion:completion]; } -- (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvseMode::Attributes::StartUpMode::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeStartUpModeWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = EnergyEvseMode::Attributes::StartUpMode::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeStartUpModeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = EnergyEvseMode::Attributes::StartUpMode::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvseMode::Attributes::StartUpMode::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvseMode::Attributes::OnMode::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeOnModeWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = EnergyEvseMode::Attributes::OnMode::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeOnModeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = EnergyEvseMode::Attributes::OnMode::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = EnergyEvseMode::Attributes::OnMode::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = EnergyEvseMode::Attributes::GeneratedCommandList::TypeInfo; @@ -54515,144 +54377,6 @@ + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheConta completion:completion]; } -- (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = WaterHeaterMode::Attributes::StartUpMode::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeStartUpModeWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = WaterHeaterMode::Attributes::StartUpMode::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeStartUpModeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = WaterHeaterMode::Attributes::StartUpMode::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = WaterHeaterMode::Attributes::StartUpMode::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = WaterHeaterMode::Attributes::OnMode::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeOnModeWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = WaterHeaterMode::Attributes::OnMode::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeOnModeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = WaterHeaterMode::Attributes::OnMode::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = WaterHeaterMode::Attributes::OnMode::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = WaterHeaterMode::Attributes::GeneratedCommandList::TypeInfo; @@ -54970,144 +54694,6 @@ + (void)readAttributeCurrentModeWithClusterStateCache:(MTRClusterStateCacheConta completion:completion]; } -- (void)readAttributeStartUpModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DeviceEnergyManagementMode::Attributes::StartUpMode::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeStartUpModeWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = DeviceEnergyManagementMode::Attributes::StartUpMode::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeStartUpModeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DeviceEnergyManagementMode::Attributes::StartUpMode::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeStartUpModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DeviceEnergyManagementMode::Attributes::StartUpMode::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - -- (void)readAttributeOnModeWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DeviceEnergyManagementMode::Attributes::OnMode::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion -{ - [self writeAttributeOnModeWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; -} -- (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - value = [value copy]; - - auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - chip::Optional timedWriteTimeout; - if (params != nil) { - if (params.timedWriteTimeout != nil){ - timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); - } - } - - ListFreer listFreer; - using TypeInfo = DeviceEnergyManagementMode::Attributes::OnMode::TypeInfo; - TypeInfo::Type cppValue; - if (value == nil) { - cppValue.SetNull(); - } else { - auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; - } - - chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); - return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)subscribeAttributeOnModeWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = DeviceEnergyManagementMode::Attributes::OnMode::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributeOnModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = DeviceEnergyManagementMode::Attributes::OnMode::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = DeviceEnergyManagementMode::Attributes::GeneratedCommandList::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 76d6ab35d3724a..6f9901c3c8dc9a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -2662,8 +2662,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { // Cluster EnergyEVSEMode attributes MTRAttributeIDTypeClusterEnergyEVSEModeAttributeSupportedModesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterEnergyEVSEModeAttributeCurrentModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterEnergyEVSEModeAttributeStartUpModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterEnergyEVSEModeAttributeOnModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRAttributeIDTypeClusterEnergyEVSEModeAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterEnergyEVSEModeAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterEnergyEVSEModeAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -2674,8 +2672,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { // Cluster WaterHeaterMode attributes MTRAttributeIDTypeClusterWaterHeaterModeAttributeSupportedModesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterWaterHeaterModeAttributeCurrentModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterWaterHeaterModeAttributeStartUpModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterWaterHeaterModeAttributeOnModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRAttributeIDTypeClusterWaterHeaterModeAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterWaterHeaterModeAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterWaterHeaterModeAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -2686,8 +2682,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { // Cluster DeviceEnergyManagementMode attributes MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeSupportedModesID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeCurrentModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeStartUpModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeOnModeID MTR_PROVISIONALLY_AVAILABLE = 0x00000003, MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 04f3350f752d8a..1d7ffd3925f51f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -4785,14 +4785,6 @@ result = @"CurrentMode"; break; - case MTRAttributeIDTypeClusterEnergyEVSEModeAttributeStartUpModeID: - result = @"StartUpMode"; - break; - - case MTRAttributeIDTypeClusterEnergyEVSEModeAttributeOnModeID: - result = @"OnMode"; - break; - case MTRAttributeIDTypeClusterEnergyEVSEModeAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; @@ -4836,14 +4828,6 @@ result = @"CurrentMode"; break; - case MTRAttributeIDTypeClusterWaterHeaterModeAttributeStartUpModeID: - result = @"StartUpMode"; - break; - - case MTRAttributeIDTypeClusterWaterHeaterModeAttributeOnModeID: - result = @"OnMode"; - break; - case MTRAttributeIDTypeClusterWaterHeaterModeAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; @@ -4887,14 +4871,6 @@ result = @"CurrentMode"; break; - case MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeStartUpModeID: - result = @"StartUpMode"; - break; - - case MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeOnModeID: - result = @"OnMode"; - break; - case MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 217fe6c026533f..6ee9d3d3943db0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3899,14 +3899,6 @@ MTR_PROVISIONALLY_AVAILABLE - (NSDictionary * _Nullable)readAttributeCurrentModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - -- (NSDictionary * _Nullable)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; @@ -3949,14 +3941,6 @@ MTR_PROVISIONALLY_AVAILABLE - (NSDictionary * _Nullable)readAttributeCurrentModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - -- (NSDictionary * _Nullable)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; @@ -3999,14 +3983,6 @@ MTR_PROVISIONALLY_AVAILABLE - (NSDictionary * _Nullable)readAttributeCurrentModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - -- (NSDictionary * _Nullable)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 53d9aecae90970..fbdc9bd48613a3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -10522,38 +10522,6 @@ - (void)changeToModeWithParams:(MTREnergyEVSEModeClusterChangeToModeParams *)par return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyEVSEModeID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEModeAttributeCurrentModeID) params:params]; } -- (NSDictionary * _Nullable)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyEVSEModeID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEModeAttributeStartUpModeID) params:params]; -} - -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeStartUpModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyEVSEModeID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEModeAttributeStartUpModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyEVSEModeID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEModeAttributeOnModeID) params:params]; -} - -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeOnModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyEVSEModeID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEModeAttributeOnModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeEnergyEVSEModeID) attributeID:@(MTRAttributeIDTypeClusterEnergyEVSEModeAttributeGeneratedCommandListID) params:params]; @@ -10625,38 +10593,6 @@ - (void)changeToModeWithParams:(MTRWaterHeaterModeClusterChangeToModeParams *)pa return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterModeID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterModeAttributeCurrentModeID) params:params]; } -- (NSDictionary * _Nullable)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterModeID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterModeAttributeStartUpModeID) params:params]; -} - -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeStartUpModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterModeID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterModeAttributeStartUpModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterModeID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterModeAttributeOnModeID) params:params]; -} - -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeOnModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterModeID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterModeAttributeOnModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeWaterHeaterModeID) attributeID:@(MTRAttributeIDTypeClusterWaterHeaterModeAttributeGeneratedCommandListID) params:params]; @@ -10728,38 +10664,6 @@ - (void)changeToModeWithParams:(MTRDeviceEnergyManagementModeClusterChangeToMode return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeDeviceEnergyManagementModeID) attributeID:@(MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeCurrentModeID) params:params]; } -- (NSDictionary * _Nullable)readAttributeStartUpModeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeDeviceEnergyManagementModeID) attributeID:@(MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeStartUpModeID) params:params]; -} - -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeStartUpModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeStartUpModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeDeviceEnergyManagementModeID) attributeID:@(MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeStartUpModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - -- (NSDictionary * _Nullable)readAttributeOnModeWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeDeviceEnergyManagementModeID) attributeID:@(MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeOnModeID) params:params]; -} - -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs -{ - [self writeAttributeOnModeWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; -} -- (void)writeAttributeOnModeWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params -{ - NSNumber * timedWriteTimeout = params.timedWriteTimeout; - - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeDeviceEnergyManagementModeID) attributeID:@(MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeOnModeID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; -} - - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeDeviceEnergyManagementModeID) attributeID:@(MTRAttributeIDTypeClusterDeviceEnergyManagementModeAttributeGeneratedCommandListID) params:params]; 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 2caf4f3764cac4..382c808a78cc62 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 @@ -16141,186 +16141,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) namespace EnergyEvseMode { namespace Attributes { -namespace StartUpMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace StartUpMode - -namespace OnMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::EnergyEvseMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::EnergyEvseMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) @@ -16374,31 +16194,28 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) namespace WaterHeaterMode { namespace Attributes { -namespace StartUpMode { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { - value.SetNonNull() = Traits::StorageToWorking(temp); + return Protocols::InteractionModel::Status::ConstraintError; } + *value = Traits::StorageToWorking(temp); return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } @@ -16406,387 +16223,30 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, Mark Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; } Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); + return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace StartUpMode +} // namespace ClusterRevision -namespace OnMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace OnMode - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::WaterHeaterMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::WaterHeaterMode::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace WaterHeaterMode +} // namespace Attributes +} // namespace WaterHeaterMode namespace DeviceEnergyManagementMode { namespace Attributes { -namespace StartUpMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace StartUpMode - -namespace OnMode { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (Traits::IsNullValue(temp)) - { - value.SetNull(); - } - else - { - value.SetNonNull() = Traits::StorageToWorking(temp); - } - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status SetNull(EndpointId endpoint) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType value; - Traits::SetNull(value); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); - return emberAfWriteAttribute(endpoint, Clusters::DeviceEnergyManagementMode::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty) -{ - if (value.IsNull()) - { - return SetNull(endpoint, markDirty); - } - - return Set(endpoint, value.Value(), markDirty); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) 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 50d01dbe713163..e0a965b732a743 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 @@ -2586,28 +2586,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar namespace EnergyEvseMode { namespace Attributes { -namespace StartUpMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace StartUpMode - -namespace OnMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); @@ -2620,28 +2598,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar namespace WaterHeaterMode { namespace Attributes { -namespace StartUpMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace StartUpMode - -namespace OnMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); @@ -2654,28 +2610,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar namespace DeviceEnergyManagementMode { namespace Attributes { -namespace StartUpMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace StartUpMode - -namespace OnMode { -Protocols::InteractionModel::Status Get(EndpointId endpoint, DataModel::Nullable & value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace OnMode - namespace ClusterRevision { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); 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 dd7986eaee6627..586eeb91aff695 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 @@ -3255,6 +3255,7 @@ enum class ModeTag : uint16_t kManual = 0x4000, kTimeOfUse = 0x4001, kSolarCharging = 0x4002, + kV2x = 0x4003, // kUnknownEnumValue intentionally not defined. This enum never goes // through DataModel::Decode, likely because it is a part of a derived // cluster. As a result having kUnknownEnumValue in this enum is error 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 c944864eec4cee..6884315a0737e0 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 @@ -18246,10 +18246,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, supportedModes); case Attributes::CurrentMode::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, currentMode); - case Attributes::StartUpMode::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, startUpMode); - case Attributes::OnMode::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, onMode); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -18359,10 +18355,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, supportedModes); case Attributes::CurrentMode::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, currentMode); - case Attributes::StartUpMode::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, startUpMode); - case Attributes::OnMode::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, onMode); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): @@ -18472,10 +18464,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, supportedModes); case Attributes::CurrentMode::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, currentMode); - case Attributes::StartUpMode::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, startUpMode); - case Attributes::OnMode::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, onMode); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, generatedCommandList); case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): 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 dd701f82100980..f2671adf0f2a03 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 @@ -24788,30 +24788,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace CurrentMode -namespace StartUpMode { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvseMode::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace StartUpMode -namespace OnMode { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvseMode::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace OnMode namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -24859,8 +24835,6 @@ struct TypeInfo Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); - Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; - Attributes::OnMode::TypeInfo::DecodableType onMode; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; @@ -24990,30 +24964,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace CurrentMode -namespace StartUpMode { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterMode::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace StartUpMode -namespace OnMode { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::WaterHeaterMode::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace OnMode namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -25061,8 +25011,6 @@ struct TypeInfo Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); - Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; - Attributes::OnMode::TypeInfo::DecodableType onMode; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; @@ -25192,30 +25140,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace CurrentMode -namespace StartUpMode { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagementMode::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::StartUpMode::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace StartUpMode -namespace OnMode { -struct TypeInfo -{ - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; - - static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagementMode::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::OnMode::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace OnMode namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -25263,8 +25187,6 @@ struct TypeInfo Attributes::SupportedModes::TypeInfo::DecodableType supportedModes; Attributes::CurrentMode::TypeInfo::DecodableType currentMode = static_cast(0); - Attributes::StartUpMode::TypeInfo::DecodableType startUpMode; - Attributes::OnMode::TypeInfo::DecodableType onMode; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; 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 d3cd9efcc673e1..030d38c2a5d779 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 @@ -4170,14 +4170,6 @@ namespace CurrentMode { static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode -namespace StartUpMode { -static constexpr AttributeId Id = 0x00000002; -} // namespace StartUpMode - -namespace OnMode { -static constexpr AttributeId Id = 0x00000003; -} // namespace OnMode - namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList @@ -4216,14 +4208,6 @@ namespace CurrentMode { static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode -namespace StartUpMode { -static constexpr AttributeId Id = 0x00000002; -} // namespace StartUpMode - -namespace OnMode { -static constexpr AttributeId Id = 0x00000003; -} // namespace OnMode - namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList @@ -4262,14 +4246,6 @@ namespace CurrentMode { static constexpr AttributeId Id = 0x00000001; } // namespace CurrentMode -namespace StartUpMode { -static constexpr AttributeId Id = 0x00000002; -} // namespace StartUpMode - -namespace OnMode { -static constexpr AttributeId Id = 0x00000003; -} // namespace OnMode - namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index ddb336fa7d3c01..244bc725ea5c8b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7829,8 +7829,6 @@ class EnergyEvseClearTargets : public ClusterCommand | Attributes: | | | * SupportedModes | 0x0000 | | * CurrentMode | 0x0001 | -| * StartUpMode | 0x0002 | -| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -7887,8 +7885,6 @@ class EnergyEvseModeChangeToMode : public ClusterCommand | Attributes: | | | * SupportedModes | 0x0000 | | * CurrentMode | 0x0001 | -| * StartUpMode | 0x0002 | -| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -7945,8 +7941,6 @@ class WaterHeaterModeChangeToMode : public ClusterCommand | Attributes: | | | * SupportedModes | 0x0000 | | * CurrentMode | 0x0001 | -| * StartUpMode | 0x0002 | -| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -22712,8 +22706,6 @@ void registerClusterEnergyEvseMode(Commands & commands, CredentialIssuerCommands make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::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, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22726,10 +22718,6 @@ void registerClusterEnergyEvseMode(Commands & commands, CredentialIssuerCommands Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "start-up-mode", 0, UINT8_MAX, Attributes::StartUpMode::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>>(Id, "on-mode", 0, UINT8_MAX, Attributes::OnMode::Id, - WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -22746,8 +22734,6 @@ void registerClusterEnergyEvseMode(Commands & commands, CredentialIssuerCommands make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::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, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22781,8 +22767,6 @@ void registerClusterWaterHeaterMode(Commands & commands, CredentialIssuerCommand make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::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, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22795,10 +22779,6 @@ void registerClusterWaterHeaterMode(Commands & commands, CredentialIssuerCommand Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "start-up-mode", 0, UINT8_MAX, Attributes::StartUpMode::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>>(Id, "on-mode", 0, UINT8_MAX, Attributes::OnMode::Id, - WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -22815,8 +22795,6 @@ void registerClusterWaterHeaterMode(Commands & commands, CredentialIssuerCommand make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::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, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22850,8 +22828,6 @@ void registerClusterDeviceEnergyManagementMode(Commands & commands, CredentialIs make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::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, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22864,10 +22840,6 @@ void registerClusterDeviceEnergyManagementMode(Commands & commands, CredentialIs Id, "supported-modes", Attributes::SupportedModes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "current-mode", 0, UINT8_MAX, Attributes::CurrentMode::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "start-up-mode", 0, UINT8_MAX, Attributes::StartUpMode::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>>(Id, "on-mode", 0, UINT8_MAX, Attributes::OnMode::Id, - WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -22884,8 +22856,6 @@ void registerClusterDeviceEnergyManagementMode(Commands & commands, CredentialIs make_unique(Id, credsIssuerConfig), // make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::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, "event-list", Attributes::EventList::Id, credsIssuerConfig), // 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 d49df9e342986f..afd4cc609368ef 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -15147,16 +15147,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case EnergyEvseMode::Attributes::StartUpMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartUpMode", 1, value); - } - case EnergyEvseMode::Attributes::OnMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnMode", 1, value); - } case EnergyEvseMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -15204,16 +15194,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case WaterHeaterMode::Attributes::StartUpMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartUpMode", 1, value); - } - case WaterHeaterMode::Attributes::OnMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnMode", 1, value); - } case WaterHeaterMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -15262,16 +15242,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CurrentMode", 1, value); } - case DeviceEnergyManagementMode::Attributes::StartUpMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("StartUpMode", 1, value); - } - case DeviceEnergyManagementMode::Attributes::OnMode::Id: { - chip::app::DataModel::Nullable value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("OnMode", 1, value); - } case DeviceEnergyManagementMode::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 5aa0a783f8bfac..faafa6df9dd627 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -2635,10 +2635,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "SupportedModes"; case chip::app::Clusters::EnergyEvseMode::Attributes::CurrentMode::Id: return "CurrentMode"; - case chip::app::Clusters::EnergyEvseMode::Attributes::StartUpMode::Id: - return "StartUpMode"; - case chip::app::Clusters::EnergyEvseMode::Attributes::OnMode::Id: - return "OnMode"; case chip::app::Clusters::EnergyEvseMode::Attributes::GeneratedCommandList::Id: return "GeneratedCommandList"; case chip::app::Clusters::EnergyEvseMode::Attributes::AcceptedCommandList::Id: @@ -2662,10 +2658,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "SupportedModes"; case chip::app::Clusters::WaterHeaterMode::Attributes::CurrentMode::Id: return "CurrentMode"; - case chip::app::Clusters::WaterHeaterMode::Attributes::StartUpMode::Id: - return "StartUpMode"; - case chip::app::Clusters::WaterHeaterMode::Attributes::OnMode::Id: - return "OnMode"; case chip::app::Clusters::WaterHeaterMode::Attributes::GeneratedCommandList::Id: return "GeneratedCommandList"; case chip::app::Clusters::WaterHeaterMode::Attributes::AcceptedCommandList::Id: @@ -2689,10 +2681,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "SupportedModes"; case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::CurrentMode::Id: return "CurrentMode"; - case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::StartUpMode::Id: - return "StartUpMode"; - case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::OnMode::Id: - return "OnMode"; case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::GeneratedCommandList::Id: return "GeneratedCommandList"; case chip::app::Clusters::DeviceEnergyManagementMode::Attributes::AcceptedCommandList::Id: 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 ac56d68687951d..cecd156144f022 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -88045,8 +88045,6 @@ class SubscribeAttributePowerTopologyClusterRevision : public SubscribeAttribute | Attributes: | | | * SupportedModes | 0x0000 | | * CurrentMode | 0x0001 | -| * StartUpMode | 0x0002 | -| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -88289,264 +88287,6 @@ class SubscribeAttributeEnergyEvseModeCurrentMode : public SubscribeAttribute { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Attribute StartUpMode - */ -class ReadEnergyEvseModeStartUpMode : public ReadAttribute { -public: - ReadEnergyEvseModeStartUpMode() - : ReadAttribute("start-up-mode") - { - } - - ~ReadEnergyEvseModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvseMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyEvseMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterEnergyEVSEMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSEMode.StartUpMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("EnergyEVSEMode StartUpMode read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class WriteEnergyEvseModeStartUpMode : public WriteAttribute { -public: - WriteEnergyEvseModeStartUpMode() - : WriteAttribute("start-up-mode") - { - AddArgument("attr-name", "start-up-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteEnergyEvseModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvseMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyEvseMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterEnergyEVSEMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = nil; - if (!mValue.IsNull()) { - value = [NSNumber numberWithUnsignedChar:mValue.Value()]; - } - - [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("EnergyEVSEMode StartUpMode write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class SubscribeAttributeEnergyEvseModeStartUpMode : public SubscribeAttribute { -public: - SubscribeAttributeEnergyEvseModeStartUpMode() - : SubscribeAttribute("start-up-mode") - { - } - - ~SubscribeAttributeEnergyEvseModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvseMode::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyEvseMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterEnergyEVSEMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeStartUpModeWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSEMode.StartUpMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - -/* - * Attribute OnMode - */ -class ReadEnergyEvseModeOnMode : public ReadAttribute { -public: - ReadEnergyEvseModeOnMode() - : ReadAttribute("on-mode") - { - } - - ~ReadEnergyEvseModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvseMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyEvseMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterEnergyEVSEMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSEMode.OnMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("EnergyEVSEMode OnMode read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class WriteEnergyEvseModeOnMode : public WriteAttribute { -public: - WriteEnergyEvseModeOnMode() - : WriteAttribute("on-mode") - { - AddArgument("attr-name", "on-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteEnergyEvseModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvseMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::EnergyEvseMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterEnergyEVSEMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = nil; - if (!mValue.IsNull()) { - value = [NSNumber numberWithUnsignedChar:mValue.Value()]; - } - - [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("EnergyEVSEMode OnMode write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class SubscribeAttributeEnergyEvseModeOnMode : public SubscribeAttribute { -public: - SubscribeAttributeEnergyEvseModeOnMode() - : SubscribeAttribute("on-mode") - { - } - - ~SubscribeAttributeEnergyEvseModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::EnergyEvseMode::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::EnergyEvseMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterEnergyEVSEMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeOnModeWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"EnergyEVSEMode.OnMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute GeneratedCommandList */ @@ -89066,8 +88806,6 @@ class SubscribeAttributeEnergyEvseModeClusterRevision : public SubscribeAttribut | Attributes: | | | * SupportedModes | 0x0000 | | * CurrentMode | 0x0001 | -| * StartUpMode | 0x0002 | -| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -89310,264 +89048,6 @@ class SubscribeAttributeWaterHeaterModeCurrentMode : public SubscribeAttribute { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Attribute StartUpMode - */ -class ReadWaterHeaterModeStartUpMode : public ReadAttribute { -public: - ReadWaterHeaterModeStartUpMode() - : ReadAttribute("start-up-mode") - { - } - - ~ReadWaterHeaterModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWaterHeaterMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WaterHeaterMode.StartUpMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("WaterHeaterMode StartUpMode read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class WriteWaterHeaterModeStartUpMode : public WriteAttribute { -public: - WriteWaterHeaterModeStartUpMode() - : WriteAttribute("start-up-mode") - { - AddArgument("attr-name", "start-up-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteWaterHeaterModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWaterHeaterMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = nil; - if (!mValue.IsNull()) { - value = [NSNumber numberWithUnsignedChar:mValue.Value()]; - } - - [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("WaterHeaterMode StartUpMode write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class SubscribeAttributeWaterHeaterModeStartUpMode : public SubscribeAttribute { -public: - SubscribeAttributeWaterHeaterModeStartUpMode() - : SubscribeAttribute("start-up-mode") - { - } - - ~SubscribeAttributeWaterHeaterModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterMode::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWaterHeaterMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeStartUpModeWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WaterHeaterMode.StartUpMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - -/* - * Attribute OnMode - */ -class ReadWaterHeaterModeOnMode : public ReadAttribute { -public: - ReadWaterHeaterModeOnMode() - : ReadAttribute("on-mode") - { - } - - ~ReadWaterHeaterModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWaterHeaterMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WaterHeaterMode.OnMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("WaterHeaterMode OnMode read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class WriteWaterHeaterModeOnMode : public WriteAttribute { -public: - WriteWaterHeaterModeOnMode() - : WriteAttribute("on-mode") - { - AddArgument("attr-name", "on-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteWaterHeaterModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::WaterHeaterMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWaterHeaterMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = nil; - if (!mValue.IsNull()) { - value = [NSNumber numberWithUnsignedChar:mValue.Value()]; - } - - [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("WaterHeaterMode OnMode write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class SubscribeAttributeWaterHeaterModeOnMode : public SubscribeAttribute { -public: - SubscribeAttributeWaterHeaterModeOnMode() - : SubscribeAttribute("on-mode") - { - } - - ~SubscribeAttributeWaterHeaterModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::WaterHeaterMode::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::WaterHeaterMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterWaterHeaterMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeOnModeWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"WaterHeaterMode.OnMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute GeneratedCommandList */ @@ -90087,8 +89567,6 @@ class SubscribeAttributeWaterHeaterModeClusterRevision : public SubscribeAttribu | Attributes: | | | * SupportedModes | 0x0000 | | * CurrentMode | 0x0001 | -| * StartUpMode | 0x0002 | -| * OnMode | 0x0003 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -90331,264 +89809,6 @@ class SubscribeAttributeDeviceEnergyManagementModeCurrentMode : public Subscribe #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Attribute StartUpMode - */ -class ReadDeviceEnergyManagementModeStartUpMode : public ReadAttribute { -public: - ReadDeviceEnergyManagementModeStartUpMode() - : ReadAttribute("start-up-mode") - { - } - - ~ReadDeviceEnergyManagementModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::DeviceEnergyManagementMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::DeviceEnergyManagementMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagementMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DeviceEnergyManagementMode.StartUpMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("DeviceEnergyManagementMode StartUpMode read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class WriteDeviceEnergyManagementModeStartUpMode : public WriteAttribute { -public: - WriteDeviceEnergyManagementModeStartUpMode() - : WriteAttribute("start-up-mode") - { - AddArgument("attr-name", "start-up-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDeviceEnergyManagementModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::DeviceEnergyManagementMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::DeviceEnergyManagementMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagementMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = nil; - if (!mValue.IsNull()) { - value = [NSNumber numberWithUnsignedChar:mValue.Value()]; - } - - [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("DeviceEnergyManagementMode StartUpMode write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class SubscribeAttributeDeviceEnergyManagementModeStartUpMode : public SubscribeAttribute { -public: - SubscribeAttributeDeviceEnergyManagementModeStartUpMode() - : SubscribeAttribute("start-up-mode") - { - } - - ~SubscribeAttributeDeviceEnergyManagementModeStartUpMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::DeviceEnergyManagementMode::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::DeviceEnergyManagementMode::Attributes::StartUpMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagementMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeStartUpModeWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DeviceEnergyManagementMode.StartUpMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - -/* - * Attribute OnMode - */ -class ReadDeviceEnergyManagementModeOnMode : public ReadAttribute { -public: - ReadDeviceEnergyManagementModeOnMode() - : ReadAttribute("on-mode") - { - } - - ~ReadDeviceEnergyManagementModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::DeviceEnergyManagementMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::DeviceEnergyManagementMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagementMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DeviceEnergyManagementMode.OnMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("DeviceEnergyManagementMode OnMode read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class WriteDeviceEnergyManagementModeOnMode : public WriteAttribute { -public: - WriteDeviceEnergyManagementModeOnMode() - : WriteAttribute("on-mode") - { - AddArgument("attr-name", "on-mode"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); - WriteAttribute::AddArguments(); - } - - ~WriteDeviceEnergyManagementModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::DeviceEnergyManagementMode::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::DeviceEnergyManagementMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagementMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRWriteParams alloc] init]; - params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = nil; - if (!mValue.IsNull()) { - value = [NSNumber numberWithUnsignedChar:mValue.Value()]; - } - - [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { - if (error != nil) { - LogNSError("DeviceEnergyManagementMode OnMode write Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } - -private: - chip::app::DataModel::Nullable mValue; -}; - -class SubscribeAttributeDeviceEnergyManagementModeOnMode : public SubscribeAttribute { -public: - SubscribeAttributeDeviceEnergyManagementModeOnMode() - : SubscribeAttribute("on-mode") - { - } - - ~SubscribeAttributeDeviceEnergyManagementModeOnMode() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::DeviceEnergyManagementMode::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::DeviceEnergyManagementMode::Attributes::OnMode::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - __auto_type * cluster = [[MTRBaseClusterDeviceEnergyManagementMode alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeOnModeWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"DeviceEnergyManagementMode.OnMode response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - /* * Attribute GeneratedCommandList */ @@ -191040,16 +190260,6 @@ void registerClusterEnergyEvseMode(Commands & commands) make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // @@ -191102,16 +190312,6 @@ void registerClusterWaterHeaterMode(Commands & commands) make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // @@ -191164,16 +190364,6 @@ void registerClusterDeviceEnergyManagementMode(Commands & commands) make_unique(), // make_unique(), // #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // From 6054fe155655d1d19b62ccd3276eff1a99b95180 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 21 Oct 2024 19:31:54 -0700 Subject: [PATCH 09/13] [Fabric-Sync] Integrate fabric bridge functionalities into fabric-sync (#36166) --- examples/fabric-sync/bridge/BUILD.gn | 12 +- .../BridgedAdministratorCommissioning.h | 58 +++ .../bridge/include/BridgedDevice.h | 92 +++++ .../BridgedDeviceBasicInformationImpl.h | 32 ++ .../bridge/include/BridgedDeviceManager.h | 136 +++++++ .../src/BridgedAdministratorCommissioning.cpp | 81 ++++ .../fabric-sync/bridge/src/BridgedDevice.cpp | 118 ++++++ .../src/BridgedDeviceBasicInformationImpl.cpp | 107 ++++++ .../bridge/src/BridgedDeviceManager.cpp | 345 ++++++++++++++++++ 9 files changed, 980 insertions(+), 1 deletion(-) create mode 100644 examples/fabric-sync/bridge/include/BridgedAdministratorCommissioning.h create mode 100644 examples/fabric-sync/bridge/include/BridgedDevice.h create mode 100644 examples/fabric-sync/bridge/include/BridgedDeviceBasicInformationImpl.h create mode 100644 examples/fabric-sync/bridge/include/BridgedDeviceManager.h create mode 100644 examples/fabric-sync/bridge/src/BridgedAdministratorCommissioning.cpp create mode 100644 examples/fabric-sync/bridge/src/BridgedDevice.cpp create mode 100644 examples/fabric-sync/bridge/src/BridgedDeviceBasicInformationImpl.cpp create mode 100644 examples/fabric-sync/bridge/src/BridgedDeviceManager.cpp diff --git a/examples/fabric-sync/bridge/BUILD.gn b/examples/fabric-sync/bridge/BUILD.gn index cdf3671b7d1cc5..310496bc54d06a 100644 --- a/examples/fabric-sync/bridge/BUILD.gn +++ b/examples/fabric-sync/bridge/BUILD.gn @@ -40,7 +40,17 @@ source_set("fabric-bridge-common") { source_set("fabric-bridge-lib") { public_configs = [ ":config" ] - sources = [ "include/CHIPProjectAppConfig.h" ] + sources = [ + "include/BridgedAdministratorCommissioning.h", + "include/BridgedDevice.h", + "include/BridgedDeviceBasicInformationImpl.h", + "include/BridgedDeviceManager.h", + "include/CHIPProjectAppConfig.h", + "src/BridgedAdministratorCommissioning.cpp", + "src/BridgedDevice.cpp", + "src/BridgedDeviceBasicInformationImpl.cpp", + "src/BridgedDeviceManager.cpp", + ] deps = [ "${chip_root}/examples/fabric-sync/bridge:fabric-bridge-common", diff --git a/examples/fabric-sync/bridge/include/BridgedAdministratorCommissioning.h b/examples/fabric-sync/bridge/include/BridgedAdministratorCommissioning.h new file mode 100644 index 00000000000000..06fd9026d44225 --- /dev/null +++ b/examples/fabric-sync/bridge/include/BridgedAdministratorCommissioning.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 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 + +/** + * @brief CADMIN cluster implementation for handling attribute interactions of bridged device endpoints. + * + * The current Administrator Commissioning Cluster server's zap generated code will automatically + * register an Attribute Access Interface for the root node endpoint implementation. In order to + * properly respond to a read attribute for bridged devices we are representing, we override the + * currently registered Attribute Interface such that we are first to receive any read attribute + * request on Administrator Commissioning Cluster, and if it is not an endpoint for a device we + * are a bridge for we redirect to the default cluster server implementation of Administrator + * Commissioning Cluster. + */ +class BridgedAdministratorCommissioning : public chip::app::AttributeAccessInterface +{ +public: + // Register for the AdministratorCommissioning cluster on all endpoints. + BridgedAdministratorCommissioning() : + AttributeAccessInterface(chip::NullOptional, chip::app::Clusters::AdministratorCommissioning::Id) + {} + + CHIP_ERROR Init(); + + CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & aPath, chip::app::AttributeValueEncoder & aEncoder) override; + + // We do not allow writing to CADMIN attributes of a bridged device endpoint. We simply redirect + // write requests to the original attribute interface. + CHIP_ERROR Write(const chip::app::ConcreteDataAttributePath & aPath, chip::app::AttributeValueDecoder & aDecoder) override + { + VerifyOrDie(mOriginalAttributeInterface); + return mOriginalAttributeInterface->Write(aPath, aDecoder); + } + +private: + // If mOriginalAttributeInterface is removed from here, the class description needs to be updated + // to reflect this change. + chip::app::AttributeAccessInterface * mOriginalAttributeInterface = nullptr; +}; diff --git a/examples/fabric-sync/bridge/include/BridgedDevice.h b/examples/fabric-sync/bridge/include/BridgedDevice.h new file mode 100644 index 00000000000000..d2c5a64b9ef4b7 --- /dev/null +++ b/examples/fabric-sync/bridge/include/BridgedDevice.h @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2024 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 + +class BridgedDevice +{ +public: + /// Defines all attributes that we keep track of for a bridged device + struct BridgedAttributes + { + std::string uniqueId; + std::string vendorName; + uint16_t vendorId = 0; + std::string productName; + uint16_t productId = 0; + std::string nodeLabel; + uint16_t hardwareVersion = 0; + std::string hardwareVersionString; + uint32_t softwareVersion = 0; + std::string softwareVersionString; + }; + + struct AdminCommissioningAttributes + { + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum commissioningWindowStatus = + chip::app::Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum::kWindowNotOpen; + std::optional openerFabricIndex = std::nullopt; + std::optional openerVendorId = std::nullopt; + }; + + BridgedDevice(chip::ScopedNodeId scopedNodeId); + virtual ~BridgedDevice() = default; + + [[nodiscard]] bool IsReachable() const { return mReachable; } + void SetReachable(bool reachable); + // Reachability attribute changed and requires marking attribute as dirty and sending + // event. + void ReachableChanged(bool reachable); + + void LogActiveChangeEvent(uint32_t promisedActiveDurationMs); + + [[nodiscard]] bool IsIcd() const { return mIsIcd; } + void SetIcd(bool icd) { mIsIcd = icd; } + + inline void SetEndpointId(chip::EndpointId id) { mEndpointId = id; }; + inline chip::EndpointId GetEndpointId() { return mEndpointId; }; + inline chip::ScopedNodeId GetScopedNodeId() { return mScopedNodeId; }; + inline void SetParentEndpointId(chip::EndpointId id) { mParentEndpointId = id; }; + inline chip::EndpointId GetParentEndpointId() { return mParentEndpointId; }; + + [[nodiscard]] const BridgedAttributes & GetBridgedAttributes() const { return mAttributes; } + void SetBridgedAttributes(const BridgedAttributes & value) { mAttributes = value; } + + void SetAdminCommissioningAttributes(const AdminCommissioningAttributes & aAdminCommissioningAttributes); + const AdminCommissioningAttributes & GetAdminCommissioningAttributes() const { return mAdminCommissioningAttributes; } + + /// Convenience method to set just the unique id of a bridged device as it + /// is one of the few attributes that is not always bulk-set + void SetUniqueId(const std::string & value) { mAttributes.uniqueId = value; } + +protected: + bool mReachable = false; + bool mIsIcd = false; + + chip::ScopedNodeId mScopedNodeId; + chip::EndpointId mEndpointId = 0; + chip::EndpointId mParentEndpointId = 0; + + BridgedAttributes mAttributes; + AdminCommissioningAttributes mAdminCommissioningAttributes; +}; diff --git a/examples/fabric-sync/bridge/include/BridgedDeviceBasicInformationImpl.h b/examples/fabric-sync/bridge/include/BridgedDeviceBasicInformationImpl.h new file mode 100644 index 00000000000000..23403438ab2be8 --- /dev/null +++ b/examples/fabric-sync/bridge/include/BridgedDeviceBasicInformationImpl.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 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 + +class BridgedDeviceBasicInformationImpl : public chip::app::AttributeAccessInterface +{ +public: + BridgedDeviceBasicInformationImpl() : + chip::app::AttributeAccessInterface(chip::NullOptional /* endpointId */, + chip::app::Clusters::BridgedDeviceBasicInformation::Id) + {} + + // AttributeAccessInterface implementation + CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & path, chip::app::AttributeValueEncoder & encoder) override; + CHIP_ERROR Write(const chip::app::ConcreteDataAttributePath & path, chip::app::AttributeValueDecoder & decoder) override; +}; diff --git a/examples/fabric-sync/bridge/include/BridgedDeviceManager.h b/examples/fabric-sync/bridge/include/BridgedDeviceManager.h new file mode 100644 index 00000000000000..127898fc5b2fab --- /dev/null +++ b/examples/fabric-sync/bridge/include/BridgedDeviceManager.h @@ -0,0 +1,136 @@ +/* + * + * Copyright (c) 2024 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 "BridgedDevice.h" + +#include + +class BridgedDeviceManager +{ +public: + BridgedDeviceManager() = default; + + /** + * @brief Initializes the BridgedDeviceManager. + * + * This function sets up the initial state of the BridgedDeviceManager, clearing + * any existing devices and setting the starting dynamic endpoint ID. + */ + void Init(); + + /** + * @brief Adds a device to a dynamic endpoint. + * + * This function attempts to add a device to a dynamic endpoint. It tries to find an available + * endpoint slot and retries the addition process up to a specified maximum number of times if + * the endpoint already exists. If the addition is successful, it returns the index of the + * dynamic endpoint; + * + * Ensures that the device has a unique id: + * - device MUST set its unique id if any BEFORE calling this method + * - if no unique id (i.e. empty string), a new unique id will be generated + * - Add will fail if the unique id is not unique + * + * @param dev A pointer to the device to be added. + * @param parentEndpointId The parent endpoint ID. Defaults to an invalid endpoint ID. + * @return int The index of the dynamic endpoint if successful, nullopt otherwise + */ + std::optional AddDeviceEndpoint(std::unique_ptr dev, + chip::EndpointId parentEndpointId = chip::kInvalidEndpointId); + + /** + * @brief Removes a device from a dynamic endpoint. + * + * This function attempts to remove a device from a dynamic endpoint by iterating through the + * available endpoints and checking if the device matches. If the device is found, it clears the + * dynamic endpoint, logs the removal, and returns the index of the removed endpoint. + * If the device is not found, it returns -1. + * + * @param dev A pointer to the device to be removed. + * @return int The index of the removed dynamic endpoint if successful, -1 otherwise. + */ + int RemoveDeviceEndpoint(BridgedDevice * dev); + + /** + * @brief Gets a device from its endpoint ID. + * + * This function iterates through the available devices and returns the device that matches the + * specified endpoint ID. If no device matches the endpoint ID, it returns nullptr. + * + * @param endpointId The endpoint ID of the device to be retrieved. + * @return BridgedDevice* A pointer to the device if found, nullptr otherwise. + */ + BridgedDevice * GetDevice(chip::EndpointId endpointId) const; + + /** + * @brief Gets a device from its ScopedNodeId. + * + * This function iterates through the available devices and returns the device that matches the + * specified ScopedNodeId. If no device matches the ScopedNodeId, it returns nullptr. + * + * @param scopedNodeId The ScopedNodeId of the device to be retrieved. + * @return BridgedDevice* A pointer to the device if found, nullptr otherwise. + */ + BridgedDevice * GetDeviceByScopedNodeId(chip::ScopedNodeId scopedNodeId) const; + + /** + * @brief Removes a device from a dynamic endpoint by its ScopedNodeId. + * + * This function attempts to remove a device and the associated dynamic endpoint by iterating through + * the available device and checking if the device matches the specified ScopedNodeId. If the device is + * found, it removes the dynamic endpoint. + * + * @param scopedNodeId The ScopedNodeId of the device to be removed. + * @return unsigned of the index of the removed dynamic endpoint if successful, nullopt otherwise. + */ + std::optional RemoveDeviceByScopedNodeId(chip::ScopedNodeId scopedNodeId); + + /** + * Finds the device with the given unique id (if any) + */ + BridgedDevice * GetDeviceByUniqueId(const std::string & id); + +private: + friend BridgedDeviceManager & BridgeDeviceMgr(); + + /** + * Creates a new unique ID that is not used by any other mDevice + */ + std::string GenerateUniqueId(); + + static BridgedDeviceManager sInstance; + + chip::EndpointId mCurrentEndpointId; + chip::EndpointId mFirstDynamicEndpointId; + std::unique_ptr mDevices[CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT + 1]; +}; + +/** + * Returns the public interface of the BridgedDeviceManager singleton object. + * + * Applications should use this to access features of the BridgedDeviceManager + * object. + */ +inline BridgedDeviceManager & BridgeDeviceMgr() +{ + return BridgedDeviceManager::sInstance; +} diff --git a/examples/fabric-sync/bridge/src/BridgedAdministratorCommissioning.cpp b/examples/fabric-sync/bridge/src/BridgedAdministratorCommissioning.cpp new file mode 100644 index 00000000000000..a0d87cbb3b81ef --- /dev/null +++ b/examples/fabric-sync/bridge/src/BridgedAdministratorCommissioning.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2024 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 "BridgedAdministratorCommissioning.h" + +#include "BridgedDevice.h" +#include "BridgedDeviceManager.h" +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::AdministratorCommissioning; + +CHIP_ERROR BridgedAdministratorCommissioning::Init() +{ + // We expect initialization after emberAfInit(). This allows us to unregister the existing + // AccessAttributeInterface for AdministratorCommissioning and register ourselves, ensuring we + // get the callback for reading attribute. If the read is not intended for a bridged device we will + // forward it to the original attribute interface that we are unregistering. + mOriginalAttributeInterface = AttributeAccessInterfaceRegistry::Instance().Get(kRootEndpointId, AdministratorCommissioning::Id); + VerifyOrReturnError(mOriginalAttributeInterface, CHIP_ERROR_INTERNAL); + AttributeAccessInterfaceRegistry::Instance().Unregister(mOriginalAttributeInterface); + VerifyOrDie(AttributeAccessInterfaceRegistry::Instance().Register(this)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BridgedAdministratorCommissioning::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + VerifyOrDie(aPath.mClusterId == Clusters::AdministratorCommissioning::Id); + EndpointId endpointId = aPath.mEndpointId; + BridgedDevice * device = BridgeDeviceMgr().GetDevice(endpointId); + + if (!device) + { + VerifyOrDie(mOriginalAttributeInterface); + return mOriginalAttributeInterface->Read(aPath, aEncoder); + } + auto attr = device->GetAdminCommissioningAttributes(); + + switch (aPath.mAttributeId) + { + case Attributes::WindowStatus::Id: { + return aEncoder.Encode(attr.commissioningWindowStatus); + } + case Attributes::AdminFabricIndex::Id: { + DataModel::Nullable encodeableFabricIndex = DataModel::NullNullable; + if (attr.openerFabricIndex.has_value()) + { + encodeableFabricIndex.SetNonNull(attr.openerFabricIndex.value()); + } + return aEncoder.Encode(encodeableFabricIndex); + } + case Attributes::AdminVendorId::Id: { + DataModel::Nullable encodeableVendorId = DataModel::NullNullable; + if (attr.openerVendorId.has_value()) + { + encodeableVendorId.SetNonNull(attr.openerVendorId.value()); + } + return aEncoder.Encode(encodeableVendorId); + } + default: + break; + } + + return CHIP_NO_ERROR; +} diff --git a/examples/fabric-sync/bridge/src/BridgedDevice.cpp b/examples/fabric-sync/bridge/src/BridgedDevice.cpp new file mode 100644 index 00000000000000..f462d1cce6efd5 --- /dev/null +++ b/examples/fabric-sync/bridge/src/BridgedDevice.cpp @@ -0,0 +1,118 @@ +/* + * + * Copyright (c) 2024 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 "BridgedDevice.h" + +#include + +#include +#include +#include + +using namespace chip; +using namespace chip::app::Clusters::Actions; + +BridgedDevice::BridgedDevice(ScopedNodeId scopedNodeId) +{ + mReachable = false; + mScopedNodeId = scopedNodeId; + mEndpointId = kInvalidEndpointId; +} + +void BridgedDevice::LogActiveChangeEvent(uint32_t promisedActiveDurationMs) +{ + EndpointId endpointId = mEndpointId; + + DeviceLayer::SystemLayer().ScheduleLambda([endpointId, promisedActiveDurationMs]() { + app::Clusters::BridgedDeviceBasicInformation::Events::ActiveChanged::Type event{}; + event.promisedActiveDuration = promisedActiveDurationMs; + EventNumber eventNumber = 0; + + CHIP_ERROR err = app::LogEvent(event, endpointId, eventNumber); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "LogEvent for ActiveChanged failed %s", err.AsString()); + } + }); +} + +void BridgedDevice::SetReachable(bool reachable) +{ + mReachable = reachable; + + if (reachable) + { + ChipLogProgress(NotSpecified, "BridgedDevice[%s]: ONLINE", mAttributes.uniqueId.c_str()); + } + else + { + ChipLogProgress(NotSpecified, "BridgedDevice[%s]: OFFLINE", mAttributes.uniqueId.c_str()); + } +} + +void BridgedDevice::ReachableChanged(bool reachable) +{ + EndpointId endpointId = mEndpointId; + bool reachableChanged = (mReachable != reachable); + if (reachableChanged) + { + SetReachable(reachable); + DeviceLayer::SystemLayer().ScheduleLambda([endpointId]() { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::BridgedDeviceBasicInformation::Id, + app::Clusters::BridgedDeviceBasicInformation::Attributes::Reachable::Id); + + app::Clusters::BridgedDeviceBasicInformation::Events::ReachableChanged::Type event{}; + EventNumber eventNumber = 0; + + CHIP_ERROR err = app::LogEvent(event, endpointId, eventNumber); + if (err != CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "LogEvent for ActiveChanged failed %s", err.AsString()); + } + }); + } +} + +void BridgedDevice::SetAdminCommissioningAttributes(const AdminCommissioningAttributes & aAdminCommissioningAttributes) +{ + EndpointId endpointId = mEndpointId; + bool windowChanged = + (aAdminCommissioningAttributes.commissioningWindowStatus != mAdminCommissioningAttributes.commissioningWindowStatus); + bool fabricIndexChanged = (aAdminCommissioningAttributes.openerFabricIndex != mAdminCommissioningAttributes.openerFabricIndex); + bool vendorChanged = (aAdminCommissioningAttributes.openerVendorId != mAdminCommissioningAttributes.openerVendorId); + + mAdminCommissioningAttributes = aAdminCommissioningAttributes; + + DeviceLayer::SystemLayer().ScheduleLambda([endpointId, windowChanged, fabricIndexChanged, vendorChanged]() { + if (windowChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::WindowStatus::Id); + } + if (fabricIndexChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id); + } + if (vendorChanged) + { + MatterReportingAttributeChangeCallback(endpointId, app::Clusters::AdministratorCommissioning::Id, + app::Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id); + } + }); +} diff --git a/examples/fabric-sync/bridge/src/BridgedDeviceBasicInformationImpl.cpp b/examples/fabric-sync/bridge/src/BridgedDeviceBasicInformationImpl.cpp new file mode 100644 index 00000000000000..7fa48a4a158ddd --- /dev/null +++ b/examples/fabric-sync/bridge/src/BridgedDeviceBasicInformationImpl.cpp @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2024 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 "BridgedDeviceBasicInformationImpl.h" + +#include "BridgedDeviceManager.h" + +#include +#include +#include + +#include + +static constexpr unsigned kBridgedDeviceBasicInformationClusterRevision = 4; + +using namespace ::chip; +using namespace ::chip::app; +using namespace ::chip::app::Clusters; + +CHIP_ERROR BridgedDeviceBasicInformationImpl::Read(const ConcreteReadAttributePath & path, AttributeValueEncoder & encoder) +{ + // Registration is done for the bridged device basic information only + VerifyOrDie(path.mClusterId == app::Clusters::BridgedDeviceBasicInformation::Id); + + BridgedDevice * dev = BridgeDeviceMgr().GetDevice(path.mEndpointId); + VerifyOrReturnError(dev != nullptr, CHIP_ERROR_NOT_FOUND); + + switch (path.mAttributeId) + { + case BasicInformation::Attributes::Reachable::Id: + encoder.Encode(dev->IsReachable()); + break; + case BasicInformation::Attributes::NodeLabel::Id: + encoder.Encode(CharSpan::fromCharString(dev->GetBridgedAttributes().nodeLabel.c_str())); + break; + case BasicInformation::Attributes::ClusterRevision::Id: + encoder.Encode(kBridgedDeviceBasicInformationClusterRevision); + break; + case BasicInformation::Attributes::FeatureMap::Id: { + BitMask features; + features.Set(Clusters::BridgedDeviceBasicInformation::Feature::kBridgedICDSupport, dev->IsIcd()); + encoder.Encode(features); + } + break; + case BasicInformation::Attributes::UniqueID::Id: + encoder.Encode(CharSpan::fromCharString(dev->GetBridgedAttributes().uniqueId.c_str())); + break; + case BasicInformation::Attributes::VendorName::Id: + encoder.Encode(CharSpan::fromCharString(dev->GetBridgedAttributes().vendorName.c_str())); + break; + case BasicInformation::Attributes::VendorID::Id: + encoder.Encode(dev->GetBridgedAttributes().vendorId); + break; + case BasicInformation::Attributes::ProductName::Id: + encoder.Encode(CharSpan::fromCharString(dev->GetBridgedAttributes().productName.c_str())); + break; + case BasicInformation::Attributes::ProductID::Id: + encoder.Encode(dev->GetBridgedAttributes().productId); + break; + case BasicInformation::Attributes::HardwareVersion::Id: + encoder.Encode(dev->GetBridgedAttributes().hardwareVersion); + break; + case BasicInformation::Attributes::HardwareVersionString::Id: + encoder.Encode(CharSpan::fromCharString(dev->GetBridgedAttributes().hardwareVersionString.c_str())); + break; + case BasicInformation::Attributes::SoftwareVersion::Id: + encoder.Encode(dev->GetBridgedAttributes().softwareVersion); + break; + case BasicInformation::Attributes::SoftwareVersionString::Id: + encoder.Encode(CharSpan::fromCharString(dev->GetBridgedAttributes().softwareVersionString.c_str())); + break; + default: + return CHIP_ERROR_INVALID_ARGUMENT; + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR BridgedDeviceBasicInformationImpl::Write(const ConcreteDataAttributePath & path, AttributeValueDecoder & decoder) +{ + VerifyOrDie(path.mClusterId == app::Clusters::BridgedDeviceBasicInformation::Id); + + BridgedDevice * dev = BridgeDeviceMgr().GetDevice(path.mEndpointId); + VerifyOrReturnError(dev != nullptr, CHIP_ERROR_NOT_FOUND); + + if (!dev->IsReachable()) + { + return CHIP_ERROR_NOT_CONNECTED; + } + + ChipLogProgress(NotSpecified, "Bridged device basic information attempt to write attribute: ep=%d", path.mAttributeId); + + // nothing writable right now ... + + return CHIP_ERROR_INVALID_ARGUMENT; +} diff --git a/examples/fabric-sync/bridge/src/BridgedDeviceManager.cpp b/examples/fabric-sync/bridge/src/BridgedDeviceManager.cpp new file mode 100644 index 00000000000000..0265f912027ca0 --- /dev/null +++ b/examples/fabric-sync/bridge/src/BridgedDeviceManager.cpp @@ -0,0 +1,345 @@ +/* + * + * Copyright (c) 2024 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 "BridgedDeviceManager.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::Credentials; +using namespace chip::Inet; +using namespace chip::Transport; +using namespace chip::DeviceLayer; +using namespace chip::app::Clusters; + +namespace { + +constexpr uint8_t kMaxRetries = 10; +constexpr int kNodeLabelSize = 32; +constexpr int kUniqueIdSize = 32; +constexpr int kVendorNameSize = 32; +constexpr int kProductNameSize = 32; +constexpr int kHardwareVersionSize = 64; +constexpr int kSoftwareVersionSize = 64; + +// Current ZCL implementation of Struct uses a max-size array of 254 bytes +constexpr int kDescriptorAttributeArraySize = 254; + +#define ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_REVISION (1u) + +// ENDPOINT DEFINITIONS: +// ================================================================================= +// +// Endpoint definitions will be reused across multiple endpoints for every instance of the +// endpoint type. +// There will be no intrinsic storage for the endpoint attributes declared here. +// Instead, all attributes will be treated as EXTERNAL, and therefore all reads +// or writes to the attributes must be handled within the emberAfExternalAttributeWriteCallback +// and emberAfExternalAttributeReadCallback functions declared herein. This fits +// the typical model of a bridge, since a bridge typically maintains its own +// state database representing the devices connected to it. + +// (taken from matter-devices.xml) +#define DEVICE_TYPE_BRIDGED_NODE 0x0013 + +// Device Version for dynamic endpoints: +#define DEVICE_VERSION_DEFAULT 1 + +// --------------------------------------------------------------------------- +// +// SYNCED DEVICE ENDPOINT: contains the following clusters: +// - Descriptor +// - Bridged Device Basic Information +// - Administrator Commissioning + +// clang-format off +// Declare Descriptor cluster attributes +DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(descriptorAttrs) + DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::DeviceTypeList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* device list */ + DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::ServerList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* server list */ + DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::ClientList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* client list */ + DECLARE_DYNAMIC_ATTRIBUTE(Descriptor::Attributes::PartsList::Id, ARRAY, kDescriptorAttributeArraySize, 0), /* parts list */ +DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); + +// Declare Bridged Device Basic Information cluster attributes +DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(bridgedDeviceBasicAttrs) + // The attributes below are MANDATORY in the Bridged Device Information Cluster + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::Reachable::Id, BOOLEAN, 1, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::UniqueID::Id, CHAR_STRING, kUniqueIdSize, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::FeatureMap::Id, BITMAP32, 4, 0), + + // The attributes below are OPTIONAL in the bridged device, however they are MANDATORY in the BasicInformation cluster + // so they can always be provided if desired + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::VendorName::Id, CHAR_STRING, kVendorNameSize, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::VendorID::Id, INT16U, 2, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::ProductName::Id, CHAR_STRING, kProductNameSize, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::ProductID::Id, INT16U, 2, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::NodeLabel::Id, CHAR_STRING, kNodeLabelSize, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::HardwareVersion::Id, INT16U, 2, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::HardwareVersionString::Id, CHAR_STRING, + kHardwareVersionSize, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::SoftwareVersion::Id, INT32U, 4, 0), + DECLARE_DYNAMIC_ATTRIBUTE(BridgedDeviceBasicInformation::Attributes::SoftwareVersionString::Id, CHAR_STRING, + kSoftwareVersionSize, 0), +DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); + +// Declare Ecosystem Information cluster attributes +DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(ecosystemInformationBasicAttrs) + DECLARE_DYNAMIC_ATTRIBUTE(EcosystemInformation::Attributes::DeviceDirectory::Id, ARRAY, kDescriptorAttributeArraySize, 0), + DECLARE_DYNAMIC_ATTRIBUTE(EcosystemInformation::Attributes::LocationDirectory::Id, ARRAY, kDescriptorAttributeArraySize, 0), + DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); + +// Declare Administrator Commissioning cluster attributes +DECLARE_DYNAMIC_ATTRIBUTE_LIST_BEGIN(AdministratorCommissioningAttrs) + DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::WindowStatus::Id, ENUM8, 1, 0), + DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::AdminFabricIndex::Id, FABRIC_IDX, 1, 0), + DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::AdminVendorId::Id, VENDOR_ID, 2, 0), + DECLARE_DYNAMIC_ATTRIBUTE(AdministratorCommissioning::Attributes::ClusterRevision::Id, INT16U, ZCL_ADMINISTRATOR_COMMISSIONING_CLUSTER_REVISION, 0), +DECLARE_DYNAMIC_ATTRIBUTE_LIST_END(); +// clang-format on + +constexpr CommandId bridgedDeviceBasicInformationCommands[] = { + app::Clusters::BridgedDeviceBasicInformation::Commands::KeepActive::Id, + kInvalidCommandId, +}; + +constexpr CommandId administratorCommissioningCommands[] = { + app::Clusters::AdministratorCommissioning::Commands::OpenCommissioningWindow::Id, + app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Id, + app::Clusters::AdministratorCommissioning::Commands::RevokeCommissioning::Id, + kInvalidCommandId, +}; + +// clang-format off +// Declare Cluster List for Bridged Node endpoint +DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedNodeClusters) + DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasicInformation::Id, bridgedDeviceBasicAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(EcosystemInformation::Id, ecosystemInformationBasicAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(AdministratorCommissioning::Id, AdministratorCommissioningAttrs, ZAP_CLUSTER_MASK(SERVER), + administratorCommissioningCommands, nullptr) +DECLARE_DYNAMIC_CLUSTER_LIST_END; + +DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(icdBridgedNodeClusters) + DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, ZAP_CLUSTER_MASK(SERVER), nullptr, nullptr), + DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasicInformation::Id, bridgedDeviceBasicAttrs, ZAP_CLUSTER_MASK(SERVER), + bridgedDeviceBasicInformationCommands, nullptr), + DECLARE_DYNAMIC_CLUSTER(AdministratorCommissioning::Id, AdministratorCommissioningAttrs, ZAP_CLUSTER_MASK(SERVER), + administratorCommissioningCommands, nullptr) +DECLARE_DYNAMIC_CLUSTER_LIST_END; +// clang-format on + +// Declare Bridged Node endpoint +DECLARE_DYNAMIC_ENDPOINT(sBridgedNodeEndpoint, bridgedNodeClusters); +DECLARE_DYNAMIC_ENDPOINT(sIcdBridgedNodeEndpoint, icdBridgedNodeClusters); + +// TODO: this is a single version array, however we may have many +// different clusters that are independent. +DataVersion sBridgedNodeDataVersions[ArraySize(bridgedNodeClusters)]; + +const EmberAfDeviceType sBridgedDeviceTypes[] = { { DEVICE_TYPE_BRIDGED_NODE, DEVICE_VERSION_DEFAULT } }; + +} // namespace + +// Define the static member +BridgedDeviceManager BridgedDeviceManager::sInstance; + +void BridgedDeviceManager::Init() +{ + mFirstDynamicEndpointId = static_cast( + static_cast(emberAfEndpointFromIndex(static_cast(emberAfFixedEndpointCount() - 1))) + 1); + mCurrentEndpointId = mFirstDynamicEndpointId; +} + +std::optional BridgedDeviceManager::AddDeviceEndpoint(std::unique_ptr dev, + chip::EndpointId parentEndpointId) +{ + EmberAfEndpointType * ep = dev->IsIcd() ? &sIcdBridgedNodeEndpoint : &sBridgedNodeEndpoint; + + const chip::Span & deviceTypeList = Span(sBridgedDeviceTypes); + + // TODO: this shares data version among different clusters, which seems incorrect + const chip::Span & dataVersionStorage = Span(sBridgedNodeDataVersions); + + if (dev->GetBridgedAttributes().uniqueId.empty()) + { + dev->SetUniqueId(GenerateUniqueId()); + } + else if (GetDeviceByUniqueId(dev->GetBridgedAttributes().uniqueId) != nullptr) + { + ChipLogProgress(NotSpecified, "A device with unique id '%s' already exists", dev->GetBridgedAttributes().uniqueId.c_str()); + return std::nullopt; + } + + for (unsigned index = 0; index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; index++) + { + if (mDevices[index]) + { + continue; + } + + for (int retryCount = 0; retryCount < kMaxRetries; retryCount++) + { + DeviceLayer::StackLock lock; + dev->SetEndpointId(mCurrentEndpointId); + dev->SetParentEndpointId(parentEndpointId); + CHIP_ERROR err = + emberAfSetDynamicEndpoint(index, mCurrentEndpointId, ep, dataVersionStorage, deviceTypeList, parentEndpointId); + if (err == CHIP_NO_ERROR) + { + ChipLogProgress(NotSpecified, "Added device with Id=[%d:0x" ChipLogFormatX64 "] to dynamic endpoint %d (index=%d)", + dev->GetScopedNodeId().GetFabricIndex(), ChipLogValueX64(dev->GetScopedNodeId().GetNodeId()), + mCurrentEndpointId, index); + mDevices[index] = std::move(dev); + return index; + } + if (err != CHIP_ERROR_ENDPOINT_EXISTS) + { + return std::nullopt; // Return error as endpoint addition failed due to an error other than endpoint already exists + } + // Increment the endpoint ID and handle wrap condition + if (++mCurrentEndpointId < mFirstDynamicEndpointId) + { + mCurrentEndpointId = mFirstDynamicEndpointId; + } + } + ChipLogError(NotSpecified, "Failed to add dynamic endpoint after %d retries", kMaxRetries); + return std::nullopt; // Return error as all retries are exhausted + } + + ChipLogProgress(NotSpecified, "Failed to add dynamic endpoint: No endpoints available!"); + return std::nullopt; +} + +int BridgedDeviceManager::RemoveDeviceEndpoint(BridgedDevice * dev) +{ + uint8_t index = 0; + while (index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) + { + if (mDevices[index].get() == dev) + { + DeviceLayer::StackLock lock; + // Silence complaints about unused ep when progress logging + // disabled. + [[maybe_unused]] EndpointId ep = emberAfClearDynamicEndpoint(index); + mDevices[index] = nullptr; + ChipLogProgress(NotSpecified, "Removed device %s from dynamic endpoint %d (index=%d)", + dev->GetBridgedAttributes().uniqueId.c_str(), ep, index); + return index; + } + index++; + } + return -1; +} + +BridgedDevice * BridgedDeviceManager::GetDevice(chip::EndpointId endpointId) const +{ + for (uint8_t index = 0; index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; ++index) + { + if (mDevices[index] && mDevices[index]->GetEndpointId() == endpointId) + { + return mDevices[index].get(); + } + } + return nullptr; +} + +std::string BridgedDeviceManager::GenerateUniqueId() +{ + char rand_buffer[kUniqueIdSize + 1]; + memset(rand_buffer, 0, sizeof(rand_buffer)); + + static const char kRandCharChoices[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + while (true) + { + /// for nice viewing, prefix the generated value + memcpy(rand_buffer, "GEN-", 4); + for (unsigned idx = 4; idx < kUniqueIdSize; idx++) + { + rand_buffer[idx] = kRandCharChoices[Crypto::GetRandU8() % (sizeof(kRandCharChoices) - 1)]; + } + + // we know zero-terminated due to the memset + std::string uniqueIdChoice = rand_buffer; + + if (!GetDeviceByUniqueId(uniqueIdChoice)) + { + return uniqueIdChoice; + } + } +} + +BridgedDevice * BridgedDeviceManager::GetDeviceByUniqueId(const std::string & id) +{ + for (uint8_t index = 0; index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; ++index) + { + if (mDevices[index] && mDevices[index]->GetBridgedAttributes().uniqueId == id) + { + return mDevices[index].get(); + } + } + return nullptr; +} + +BridgedDevice * BridgedDeviceManager::GetDeviceByScopedNodeId(chip::ScopedNodeId scopedNodeId) const +{ + for (uint8_t index = 0; index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; ++index) + { + if (mDevices[index] && mDevices[index]->GetScopedNodeId() == scopedNodeId) + { + return mDevices[index].get(); + } + } + return nullptr; +} + +std::optional BridgedDeviceManager::RemoveDeviceByScopedNodeId(chip::ScopedNodeId scopedNodeId) +{ + for (unsigned index = 0; index < CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT; ++index) + { + if (mDevices[index] && mDevices[index]->GetScopedNodeId() == scopedNodeId) + { + DeviceLayer::StackLock lock; + EndpointId ep = emberAfClearDynamicEndpoint(index); + mDevices[index] = nullptr; + ChipLogProgress(NotSpecified, "Removed device with Id=[%d:0x" ChipLogFormatX64 "] from dynamic endpoint %d (index=%d)", + scopedNodeId.GetFabricIndex(), ChipLogValueX64(scopedNodeId.GetNodeId()), ep, index); + return index; + } + } + return std::nullopt; +} From 1eaa4b94e43c5da54fb340250515e3249ca85753 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 21 Oct 2024 19:37:13 -0700 Subject: [PATCH 10/13] Removed config flags inherited from tv-app (#36180) --- .../bridge/include/CHIPProjectAppConfig.h | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/examples/fabric-sync/bridge/include/CHIPProjectAppConfig.h b/examples/fabric-sync/bridge/include/CHIPProjectAppConfig.h index b2a999da741088..b1a711658d3b91 100644 --- a/examples/fabric-sync/bridge/include/CHIPProjectAppConfig.h +++ b/examples/fabric-sync/bridge/include/CHIPProjectAppConfig.h @@ -30,49 +30,18 @@ // FabricSync needs to be commissioners and likely want to be discoverable #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 1 -// FabricSync can handle the memory impact of supporting a larger list -#define CHIP_DEVICE_CONFIG_UDC_MAX_TARGET_APPS 10 - // FabricSync will often enable this feature #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_PASSCODE 1 // FabricSync needs to be both commissioners and commissionees #define CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE 1 -// See issue 23625. -#define CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE 1 - -// FabricSync that are not commissionees, -// or that don't automatically enter commissioning mode should set this to 0 -#define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART 1 - -// FabricSync do not typically need this - enable for debugging -// #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 1 - -// Enable extended discovery, set timeout to 24 hours -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 -#define CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS (24 * 60 * 60) - -// Advertise TV device type in DNS-SD -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 - -#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 35 // 0x0023 = 35 = Video Player - -// Include device name in discovery for casting use case -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 1 -#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test TV" - // Enable app platform #define CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED 1 // overrides CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT in CHIPProjectConfig #define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 16 -// For casting, we need to allow more ACL entries, and more complex entries -#define CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_TARGETS_PER_ENTRY 20 -#define CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_SUBJECTS_PER_ENTRY 20 -#define CHIP_CONFIG_EXAMPLE_ACCESS_CONTROL_MAX_ENTRIES_PER_FABRIC 20 - // Allows app options (ports) to be configured on launch of app #define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 From 8d44e77535ed70f50a44efcbf7c5f5c999f9f34f Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Mon, 21 Oct 2024 22:38:05 -0400 Subject: [PATCH 11/13] OpenDeviceCommissioningWindow verifies fabric index is what we expect (#36179) * OpenDeviceCommissioningWindow verifies fabric index is what we expect * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../device_manager/DeviceManager.cpp | 16 +++++++++++----- .../fabric-admin/device_manager/DeviceManager.h | 4 ++-- examples/fabric-admin/rpc/RpcServer.cpp | 11 +++++------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 0d7d656a4e685e..e52027c8f533f1 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -117,14 +117,19 @@ void DeviceManager::RemoveSyncedDevice(NodeId nodeId) ChipLogValueX64(device->GetNodeId()), device->GetEndpointId()); } -void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, +void DeviceManager::OpenDeviceCommissioningWindow(ScopedNodeId scopedNodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, uint16_t discriminator, const ByteSpan & salt, const ByteSpan & verifier) { - ChipLogProgress(NotSpecified, "Opening commissioning window for Node ID: " ChipLogFormatX64, ChipLogValueX64(nodeId)); + // PairingManager isn't currently capable of OpenCommissioningWindow on a device of a fabric that it doesn't have + // the controller for. Currently no implementation need this functionality, but should they need it they will hit + // the verify or die below and it will be the responsiblity of whoever requires that functionality to implement. + VerifyOrDie(PairingManager::Instance().CurrentCommissioner().GetFabricIndex() == scopedNodeId.GetFabricIndex()); + ChipLogProgress(NotSpecified, "Opening commissioning window for Node ID: " ChipLogFormatX64, + ChipLogValueX64(scopedNodeId.GetNodeId())); // Open the commissioning window of a device within its own fabric. - CHIP_ERROR err = PairingManager::Instance().OpenCommissioningWindow(nodeId, kRootEndpointId, commissioningTimeoutSec, - iterations, discriminator, salt, verifier); + CHIP_ERROR err = PairingManager::Instance().OpenCommissioningWindow( + scopedNodeId.GetNodeId(), kRootEndpointId, commissioningTimeoutSec, iterations, discriminator, salt, verifier); if (err != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Failed to open commissioning window: %s", ErrorStr(err)); @@ -412,7 +417,8 @@ void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data) ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier size: %lu", value.PAKEPasscodeVerifier.size()); ChipLogProgress(NotSpecified, " salt size: %lu", value.salt.size()); - OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.iterations, value.commissioningTimeout, value.discriminator, + ScopedNodeId scopedNodeId(mLocalBridgeNodeId, PairingManager::Instance().CurrentCommissioner().GetFabricIndex()); + OpenDeviceCommissioningWindow(scopedNodeId, value.iterations, value.commissioningTimeout, value.discriminator, ByteSpan(value.salt.data(), value.salt.size()), ByteSpan(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size())); } diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index d405bd358d5fdb..6adc8f243e6b1a 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -91,7 +91,7 @@ class DeviceManager : public PairingDelegate * * This function initiates the process to open the commissioning window for a device identified by the given node ID. * - * @param nodeId The ID of the node that should open the commissioning window. + * @param scopedNodeId The scoped node ID of the device that should open the commissioning window. * @param iterations The number of PBKDF (Password-Based Key Derivation Function) iterations to use * for deriving the PAKE (Password Authenticated Key Exchange) verifier. * @param commissioningTimeoutSec The time in seconds before the commissioning window closes. This value determines @@ -102,7 +102,7 @@ class DeviceManager : public PairingDelegate * @param verifier The PAKE verifier used to authenticate the commissioning process. * */ - void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, + void OpenDeviceCommissioningWindow(chip::ScopedNodeId scopedNodeId, uint32_t iterations, uint16_t commissioningTimeoutSec, uint16_t discriminator, const chip::ByteSpan & salt, const chip::ByteSpan & verifier); /** diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index 8613d06c6f3d9f..e10bb64cdc050f 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -98,20 +98,19 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate chip_rpc_OperationStatus & response) override { VerifyOrReturnValue(request.has_id, pw::Status::InvalidArgument()); - // TODO(#35875): OpenDeviceCommissioningWindow uses the same controller every time and doesn't currently accept - // FabricIndex. For now we are dropping fabric index from the scoped node id. - NodeId nodeId = request.id.node_id; + ScopedNodeId scopedNodeId(request.id.node_id, request.id.fabric_index); uint32_t iterations = request.iterations; uint16_t discriminator = request.discriminator; uint16_t commissioningTimeoutSec = static_cast(request.commissioning_timeout); // Log the request details for debugging ChipLogProgress(NotSpecified, - "Received OpenCommissioningWindow request: NodeId 0x%lx, Timeout: %u, Iterations: %u, Discriminator: %u", - static_cast(nodeId), commissioningTimeoutSec, iterations, discriminator); + "Received OpenCommissioningWindow request: NodeId " ChipLogFormatX64 + ", Timeout: %u, Iterations: %u, Discriminator: %u", + ChipLogValueX64(scopedNodeId.GetNodeId()), commissioningTimeoutSec, iterations, discriminator); // Open the device commissioning window using raw binary data for salt and verifier - DeviceMgr().OpenDeviceCommissioningWindow(nodeId, iterations, commissioningTimeoutSec, discriminator, + DeviceMgr().OpenDeviceCommissioningWindow(scopedNodeId, iterations, commissioningTimeoutSec, discriminator, ByteSpan(request.salt.bytes, request.salt.size), ByteSpan(request.verifier.bytes, request.verifier.size)); From 44db0f660e20ed996add613b2a7ffb4f63955316 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Mon, 21 Oct 2024 22:38:19 -0400 Subject: [PATCH 12/13] Call DeviceReachableChanged when subscription fails (#36175) * Call DeviceReachableChanged when subscription fails * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../device_manager/DeviceSubscription.cpp | 21 +++++++++++++++++- .../device_manager/DeviceSynchronization.cpp | 6 ++++- examples/fabric-admin/rpc/RpcClient.cpp | 22 +++++++++++++++++++ examples/fabric-admin/rpc/RpcClient.h | 11 ++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/examples/fabric-admin/device_manager/DeviceSubscription.cpp b/examples/fabric-admin/device_manager/DeviceSubscription.cpp index 0da2bdddd4fbf5..434d349e8c5113 100644 --- a/examples/fabric-admin/device_manager/DeviceSubscription.cpp +++ b/examples/fabric-admin/device_manager/DeviceSubscription.cpp @@ -125,6 +125,16 @@ void DeviceSubscription::OnDone(ReadClient * apReadClient) void DeviceSubscription::OnError(CHIP_ERROR error) { +#if defined(PW_RPC_ENABLED) + if (error == CHIP_ERROR_TIMEOUT && mState == State::SubscriptionStarted) + { + chip_rpc_ReachabilityChanged reachabilityChanged; + reachabilityChanged.has_id = true; + reachabilityChanged.id = mCurrentAdministratorCommissioningAttributes.id; + reachabilityChanged.reachability = false; + DeviceReachableChanged(reachabilityChanged); + } +#endif ChipLogProgress(NotSpecified, "Error subscribing: %" CHIP_ERROR_FORMAT, error.Format()); } @@ -198,7 +208,16 @@ void DeviceSubscription::OnDeviceConnectionFailure(const ScopedNodeId & peerId, { VerifyOrDie(mState == State::Connecting || mState == State::Stopping); ChipLogError(NotSpecified, "DeviceSubscription failed to connect to " ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); - // TODO(#35333) Figure out how we should recover if we fail to connect and mState == State::Connecting. +#if defined(PW_RPC_ENABLED) + if (mState == State::Connecting) + { + chip_rpc_ReachabilityChanged reachabilityChanged; + reachabilityChanged.has_id = true; + reachabilityChanged.id = mCurrentAdministratorCommissioningAttributes.id; + reachabilityChanged.reachability = false; + DeviceReachableChanged(reachabilityChanged); + } +#endif // After calling mOnDoneCallback we are indicating that `this` is deleted and we shouldn't do anything else with // DeviceSubscription. diff --git a/examples/fabric-admin/device_manager/DeviceSynchronization.cpp b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp index 6c2284018e0d19..1e8728ee59b567 100644 --- a/examples/fabric-admin/device_manager/DeviceSynchronization.cpp +++ b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp @@ -277,12 +277,16 @@ void DeviceSynchronizer::SynchronizationCompleteAddDevice() if (!mCurrentDeviceData.is_icd) { VerifyOrDie(mController); - // TODO(#35333) Figure out how we should recover in this circumstance. ScopedNodeId scopedNodeId(mNodeId, mController->GetFabricIndex()); CHIP_ERROR err = DeviceSubscriptionManager::Instance().StartSubscription(*mController, scopedNodeId); if (err != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Failed start subscription to NodeId:" ChipLogFormatX64, ChipLogValueX64(mNodeId)); + chip_rpc_ReachabilityChanged reachabilityChanged; + reachabilityChanged.has_id = true; + reachabilityChanged.id = mCurrentDeviceData.id; + reachabilityChanged.reachability = false; + DeviceReachableChanged(reachabilityChanged); } } #endif diff --git a/examples/fabric-admin/rpc/RpcClient.cpp b/examples/fabric-admin/rpc/RpcClient.cpp index e33dd0472e6fe2..9964dc6767b67e 100644 --- a/examples/fabric-admin/rpc/RpcClient.cpp +++ b/examples/fabric-admin/rpc/RpcClient.cpp @@ -205,3 +205,25 @@ CHIP_ERROR AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommis return WaitForResponse(call); } + +CHIP_ERROR DeviceReachableChanged(const chip_rpc_ReachabilityChanged & data) +{ + ChipLogProgress(NotSpecified, "DeviceReachableChanged"); + // TODO(#35333): When there is some sort of device manager in fabric-admin that handles all the devices we + // are currently connected to (and not just device on the remote bridge), we should notify that manager + // so that it can properly handle any sort of reconnection logic. This can either be done here when + // `data.reachability == false`, or more control can be given wherever DeviceReachableChanged is currently + // called + + // The RPC call is kept alive until it completes. When a response is received, it will be logged by the handler + // function and the call will complete. + auto call = fabricBridgeClient.DeviceReachableChanged(data, RpcCompletedWithEmptyResponse); + + if (!call.active()) + { + // The RPC call was not sent. This could occur due to, for example, an invalid channel ID. Handle if necessary. + return CHIP_ERROR_INTERNAL; + } + + return WaitForResponse(call); +} diff --git a/examples/fabric-admin/rpc/RpcClient.h b/examples/fabric-admin/rpc/RpcClient.h index da6a82115a3cd2..a4cefe8bd8e076 100644 --- a/examples/fabric-admin/rpc/RpcClient.h +++ b/examples/fabric-admin/rpc/RpcClient.h @@ -88,3 +88,14 @@ CHIP_ERROR ActiveChanged(chip::ScopedNodeId scopedNodeId, uint32_t promisedActiv * - CHIP_ERROR_INTERNAL: An internal error occurred while activating the RPC call. */ CHIP_ERROR AdminCommissioningAttributeChanged(const chip_rpc_AdministratorCommissioningChanged & data); + +/** + * @brief Notify that reachachability of the bridged device has changed + * + * @param data information regarding change in reachability of the bridged device. + * @return CHIP_ERROR An error code indicating the success or failure of the operation. + * - CHIP_NO_ERROR: The RPC command was successfully processed. + * - CHIP_ERROR_BUSY: Another operation is currently in progress. + * - CHIP_ERROR_INTERNAL: An internal error occurred while activating the RPC call. + */ +CHIP_ERROR DeviceReachableChanged(const chip_rpc_ReachabilityChanged & data); From 4269ff5c6157ded0ae3d2d4e82ca9a94782a46d6 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 21 Oct 2024 23:40:25 -0700 Subject: [PATCH 13/13] [Fabric-Bridge] Update Readme.txt to exclude incorrect path info (#36184) --- examples/fabric-bridge-app/linux/README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/examples/fabric-bridge-app/linux/README.md b/examples/fabric-bridge-app/linux/README.md index 27a01d9ffec60a..ede6ce26399062 100644 --- a/examples/fabric-bridge-app/linux/README.md +++ b/examples/fabric-bridge-app/linux/README.md @@ -130,13 +130,6 @@ defined: scp ./fabric-bridge-app ubuntu@xxx.xxx.xxx.xxx:/home/ubuntu ``` -- To delete generated executable, libraries and object files use: - - ```sh - cd ~/connectedhomeip/examples/fabric-bridge-app/linux - rm -rf out/ - ``` - ## Running the Complete Example on Ubuntu - Building