From 91d1a28e7a2b1c69c606fbcac03304c4a6b85dd7 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Wed, 31 Jul 2024 01:55:50 -0700 Subject: [PATCH 01/40] Add test scripts for testing Presets attributes and commands for Thermostat cluster (#34614) * Add test scripts for testing Presets attributes and commands for Thermostat cluster * Fixes * Fix Test_TC_TSTAT_4_2.yaml to parse correctly. * Run zap regen with latest zap version * Restyled by prettier-yaml * Editorial fixes * Restyle * Add support to all clusters app to support Thermostat presets attributes and commands * Addressed review comments --------- Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io --- .../all-clusters-app.matter | 11 +- .../all-clusters-common/all-clusters-app.zap | 116 +- examples/all-clusters-app/linux/BUILD.gn | 2 + .../all-clusters-app/linux/main-common.cpp | 11 + .../thermostat-common/thermostat.matter | 1 + .../thermostat-common/thermostat.zap | 16 + src/app/tests/suites/certification/PICS.yaml | 57 + .../certification/Test_TC_TSTAT_1_1.yaml | 32 + .../certification/Test_TC_TSTAT_4_1.yaml | 113 + .../certification/Test_TC_TSTAT_4_2.yaml | 2228 +++++++++++++++++ .../tests/suites/certification/ci-pics-values | 15 + 11 files changed, 2599 insertions(+), 3 deletions(-) create mode 100644 src/app/tests/suites/certification/Test_TC_TSTAT_4_1.yaml create mode 100644 src/app/tests/suites/certification/Test_TC_TSTAT_4_2.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 c0c22fc0df0191..3dd2b0f99fb439 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 @@ -8813,14 +8813,23 @@ endpoint 1 { ram attribute minSetpointDeadBand default = 0x19; ram attribute controlSequenceOfOperation default = 0x04; ram attribute systemMode default = 0x01; + callback attribute presetTypes; + ram attribute numberOfPresets default = 0; + ram attribute activePresetHandle; + callback attribute presets; + ram attribute presetsSchedulesEditable; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0x0023; + ram attribute featureMap default = 0x0123; ram attribute clusterRevision default = 6; handle command SetpointRaiseLower; + handle command SetActivePresetRequest; + handle command StartPresetsSchedulesEditRequest; + handle command CancelPresetsSchedulesEditRequest; + handle command CommitPresetsSchedulesRequest; } server cluster FanControl { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 31b6a05057dc74..a052433002d237 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -16393,6 +16393,38 @@ "source": "client", "isIncoming": 1, "isEnabled": 1 + }, + { + "name": "SetActivePresetRequest", + "code": 6, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "StartPresetsSchedulesEditRequest", + "code": 7, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CancelPresetsSchedulesEditRequest", + "code": 8, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CommitPresetsSchedulesRequest", + "code": 9, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 } ], "attributes": [ @@ -16636,6 +16668,86 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "PresetTypes", + "code": 72, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPresets", + "code": 74, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActivePresetHandle", + "code": 78, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Presets", + "code": 80, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PresetsSchedulesEditable", + "code": 82, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -16710,7 +16822,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0023", + "defaultValue": "0x0123", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -26554,4 +26666,4 @@ "parentEndpointIdentifier": null } ] -} +} \ No newline at end of file diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index e8671e701a7227..c7c5fb0f14ecd3 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -75,6 +75,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/device-energy-management-mode.cpp", "${chip_root}/examples/energy-management-app/energy-management-common/src/energy-evse-mode.cpp", + "${chip_root}/examples/thermostat/linux/thermostat-delegate-impl.cpp", "AllClustersCommandDelegate.cpp", "AllClustersCommandDelegate.h", "AppOptions.cpp", @@ -98,6 +99,7 @@ source_set("chip-all-clusters-common") { include_dirs = [ "${chip_root}/examples/all-clusters-app/all-clusters-common/include", "${chip_root}/examples/energy-management-app/energy-management-common/include", + "${chip_root}/examples/thermostat/linux/include", ] if (chip_enable_pw_rpc) { diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index bc547d5416377c..edddc6a8a7d62e 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -37,6 +37,7 @@ #include "rvc-modes.h" #include "rvc-operational-state-delegate-impl.h" #include "tcc-mode.h" +#include "thermostat-delegate-impl.h" #include "water-heater-mode.h" #include #include @@ -46,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -323,3 +325,12 @@ void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint) DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider); } + +using namespace chip::app::Clusters::Thermostat; +void emberAfThermostatClusterInitCallback(EndpointId endpoint) +{ + // Register the delegate for the Thermostat + auto & delegate = ThermostatDelegate::GetInstance(); + + SetDefaultDelegate(endpoint, &delegate); +} diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 3552c9b8ce25f0..dc26361d6dd600 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -2561,6 +2561,7 @@ endpoint 1 { ram attribute absMaxHeatSetpointLimit default = 3000; ram attribute absMinCoolSetpointLimit default = 1600; ram attribute absMaxCoolSetpointLimit default = 3200; + ram attribute localTemperatureCalibration default = 0x00; persist attribute occupiedCoolingSetpoint default = 0x0A28; persist attribute occupiedHeatingSetpoint default = 0x07D0; ram attribute minHeatSetpointLimit default = 700; diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 483b79d7d434f5..e907730ee80696 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -4774,6 +4774,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "LocalTemperatureCalibration", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "OccupiedCoolingSetpoint", "code": 17, diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index af0aa5895fd426..169d5684673b9d 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -6422,6 +6422,21 @@ PICS: - label: "Does the device implement the ACCapacityFormat attribute?" id: TSTAT.S.A0047 + - label: "Does the device implement the PresetTypes attribute?" + id: TSTAT.S.A0048 + + - label: "Does the device implement the NumberOfPresets attribute?" + id: TSTAT.S.A004a + + - label: "Does the device implement the ActivePresetHandle attribute?" + id: TSTAT.S.A004e + + - label: "Does the device implement the Presets attribute?" + id: TSTAT.S.A0050 + + - label: "Does the device implement the PresetsSchedulesEditable attribute?" + id: TSTAT.S.A0052 + # # server / commandsReceived # @@ -6445,6 +6460,26 @@ PICS: "Does the device implement receiving the GetRelayStatusLog command?" id: TSTAT.S.C04.Rsp + - label: + "Does the device implement receiving the SetActivePresetRequest + command?" + id: TSTAT.S.C06.Rsp + + - label: + "Does the device implement receiving the + StartPresetsSchedulesEditRequest command?" + id: TSTAT.S.C07.Rsp + + - label: + "Does the device implement receiving the + CancelPresetsSchedulesEditRequest command?" + id: TSTAT.S.C08.Rsp + + - label: + "Does the device implement receiving the CommitPresetsSchedulesRequest + command?" + id: TSTAT.S.C09.Rsp + # # server / commandsGenerated # @@ -6482,6 +6517,9 @@ PICS: - label: "Supports a local temperature not exposed" id: TSTAT.S.F06 + - label: "Supports setpoint presets" + id: TSTAT.S.F08 + # # server / manually # @@ -6523,6 +6561,25 @@ PICS: - label: "Does the device implement sending the GetRelayStatusLog command?" id: TSTAT.C.C04.Tx + - label: + "Does the device implement sending the SetActivePresetRequest command?" + id: TSTAT.C.C06.Tx + + - label: + "Does the device implement sending the + StartPresetsSchedulesEditRequest command?" + id: TSTAT.C.C07.Tx + + - label: + "Does the device implement sending the + CancelPresetsSchedulesEditRequest command?" + id: TSTAT.C.C08.Tx + + - label: + "Does the device implement sending the CommitPresetsSchedulesRequest + command?" + id: TSTAT.C.C09.Tx + # # client / manually # diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml index b2bf2a111ebffd..40a65d7952d608 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_1_1.yaml @@ -129,6 +129,17 @@ tests: type: bitmap32 hasMasksSet: [0x40] + - label: + "Step 3i: Given TSTAT.S.F08(PRES ensure featuremap has the correct bit + set" + PICS: TSTAT.S.F08 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x100] + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." PICS: PICS_EVENT_LIST_ENABLED command: "readAttribute" @@ -555,6 +566,17 @@ tests: type: list contains: [30] + - label: + "Step 4j: TH reads the Feature dependent(TSTAT.S.F08(PRES) attribute + in AttributeList" + PICS: TSTAT.S.F08 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [72, 74, 78, 80, 82] + - label: "Step 5: TH reads EventList attribute from the DUT." PICS: PICS_EVENT_LIST_ENABLED command: "readAttribute" @@ -593,6 +615,16 @@ tests: constraints: type: list contains: [4] + - label: + "Step 6d: TH reads Feature dependent(TSTAT.S.F08(PRES)) commands in + AcceptedCommandList" + PICS: TSTAT.S.F08 + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + constraints: + type: list + contains: [6, 7, 8, 9] - label: "Step 7a: TH reads from the DUT the GeneratedCommandList attribute." diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_4_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_4_1.yaml new file mode 100644 index 00000000000000..9785c8b1bda0c1 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_4_1.yaml @@ -0,0 +1,113 @@ +# 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: 42.4.1. [TC-TSTAT-4.1] Preset attributes with server as DUT + +PICS: + - TSTAT.S + +config: + nodeId: 0x12344321 + cluster: "Thermostat" + endpoint: 1 + +tests: + - label: "Step 1: Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Saving value for comparision in step 2 read PresetTypes attribute" + PICS: TSTAT.S.A0048 + command: "readAttribute" + attribute: "PresetTypes" + response: + saveAs: PresetTypesValue + + - label: + "Saving value for comparision in step 3 read NumberOfPresets attribute" + PICS: TSTAT.S.A004a + command: "readAttribute" + attribute: "NumberOfPresets" + response: + saveAs: NumberOfPresetsValue + + - label: + "Saving value for comparision in step 4 read ActivePresetHandleValue + attribute" + PICS: TSTAT.S.A004e + command: "readAttribute" + attribute: "ActivePresetHandle" + response: + saveAs: ActivePresetHandleValue + + - label: "Saving value for comparision in step 5 read Presets attribute" + PICS: TSTAT.S.A0050 + command: "readAttribute" + attribute: "Presets" + response: + saveAs: PresetsValue + + - label: + "Saving value for comparision in step 6 read PresetsSchedulesEditable + attribute" + PICS: TSTAT.S.A0052 + command: "readAttribute" + attribute: "PresetsSchedulesEditable" + response: + saveAs: PresetsSchedulesEditableValue + + - label: "Step 2: TH reads the PresetTypes attribute from the DUT" + PICS: TSTAT.S.F08 & TSTAT.S.A0048 + command: "readAttribute" + attribute: "PresetTypes" + response: + constraints: + type: list + + - label: "Step 3: TH reads the NumberOfPresets attribute from the DUT" + PICS: TSTAT.S.F08 & TSTAT.S.A004a + command: "readAttribute" + attribute: "NumberOfPresets" + response: + constraints: + type: int8u + + - label: "Step 4: TH reads the ActivePresetHandle attribute from the DUT" + PICS: TSTAT.S.F08 & TSTAT.S.A004e + command: "readAttribute" + attribute: "ActivePresetHandle" + response: + constraints: + type: octstr + + - label: "Step 5: TH reads the Presets attribute from the DUT" + PICS: TSTAT.S.F08 & TSTAT.S.A0050 + command: "readAttribute" + attribute: "Presets" + response: + constraints: + type: list + + - label: + "Step 6: TH reads the PresetsSchedulesEditable attribute from the DUT" + PICS: TSTAT.S.F08 & TSTAT.S.A0052 + command: "readAttribute" + attribute: "PresetsSchedulesEditable" + response: + constraints: + type: boolean diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml new file mode 100644 index 00000000000000..b813eafd402606 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml @@ -0,0 +1,2228 @@ +# 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: 42.4.2. [TC-TSTAT-4.2] Preset Test Cases with server as DUT + +PICS: + - TSTAT.S + +config: + nodeId: 0x12344321 + cluster: "Thermostat" + endpoint: 1 + +tests: + - label: "Step 1: Commission DUT to TH" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Step 2: Test Harness writes to the Presets attribute without calling + the StartPresetsSchedulesEditRequest" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #2 Test Harness Client attempts to write Presets and gets an INVALID_IN_STATE error since the client didn't send a request to edit the presets by calling StartPresetsSchedulesEditRequest command. + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": null, "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a INVALID_IN_STATE (0xCB) + + [1722285385.263] [53729:5380292] [DMG] WriteClient moving to [AwaitingDe] + [1722285385.263] [53729:5380292] [TOO] Response Failure: IM Error 0x000005CB: General error: 0xcb (INVALID_IN_STATE) + [1722285385.263] [53729:5380292] [EM] <<< [E:42658i S:21691 M:14088666 (Ack:20978215)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722285385.263] [53729:5380292] [EM] Flushed pending ack for MessageCounter:20978215 on exchange 42658i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 3a: Test Harness writes to the Presets attribute after calling + the StartPresetsSchedulesEditRequest command" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #3a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 3b: Test Harness writes to the Presets attribute adding 3 + presets for Sleep, Wake and GoingToSleep" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #3b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": null, "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": null, "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": null, "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286250.503] [54321:5397545] [DMG] WriteClient moving to [ResponseRe] + [1722286250.503] [54321:5397545] [DMG] WriteResponseMessage = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] AttributeStatusIBs = + [1722286250.503] [54321:5397545] [DMG] [ + [1722286250.503] [54321:5397545] [DMG] AttributeStatusIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] AttributePathIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] Endpoint = 0x1, + [1722286250.503] [54321:5397545] [DMG] Cluster = 0x201, + [1722286250.503] [54321:5397545] [DMG] Attribute = 0x0000_0050, + [1722286250.503] [54321:5397545] [DMG] } + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] StatusIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] status = 0x00 (SUCCESS), + [1722286250.503] [54321:5397545] [DMG] }, + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] }, + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] AttributeStatusIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] AttributePathIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] Endpoint = 0x1, + [1722286250.503] [54321:5397545] [DMG] Cluster = 0x201, + [1722286250.503] [54321:5397545] [DMG] Attribute = 0x0000_0050, + [1722286250.503] [54321:5397545] [DMG] ListIndex = Null, + [1722286250.503] [54321:5397545] [DMG] } + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] StatusIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] status = 0x00 (SUCCESS), + [1722286250.503] [54321:5397545] [DMG] }, + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] }, + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] AttributeStatusIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] AttributePathIB = + [1722286250.503] [54321:5397545] [DMG] { + [1722286250.503] [54321:5397545] [DMG] Endpoint = 0x1, + [1722286250.503] [54321:5397545] [DMG] Cluster = 0x201, + [1722286250.503] [54321:5397545] [DMG] Attribute = 0x0000_0050, + [1722286250.503] [54321:5397545] [DMG] ListIndex = Null, + [1722286250.503] [54321:5397545] [DMG] } + [1722286250.503] [54321:5397545] [DMG] + [1722286250.503] [54321:5397545] [DMG] StatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] AttributeStatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] AttributePathIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] Endpoint = 0x1, + [1722286250.504] [54321:5397545] [DMG] Cluster = 0x201, + [1722286250.504] [54321:5397545] [DMG] Attribute = 0x0000_0050, + [1722286250.504] [54321:5397545] [DMG] ListIndex = Null, + [1722286250.504] [54321:5397545] [DMG] } + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] StatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] AttributeStatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] AttributePathIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] Endpoint = 0x1, + [1722286250.504] [54321:5397545] [DMG] Cluster = 0x201, + [1722286250.504] [54321:5397545] [DMG] Attribute = 0x0000_0050, + [1722286250.504] [54321:5397545] [DMG] ListIndex = Null, + [1722286250.504] [54321:5397545] [DMG] } + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] StatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] AttributeStatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] AttributePathIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] Endpoint = 0x1, + [1722286250.504] [54321:5397545] [DMG] Cluster = 0x201, + [1722286250.504] [54321:5397545] [DMG] Attribute = 0x0000_0050, + [1722286250.504] [54321:5397545] [DMG] ListIndex = Null, + [1722286250.504] [54321:5397545] [DMG] } + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] StatusIB = + [1722286250.504] [54321:5397545] [DMG] { + [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] }, + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] ], + [1722286250.504] [54321:5397545] [DMG] + [1722286250.504] [54321:5397545] [DMG] InteractionModelRevision = 11 + [1722286250.504] [54321:5397545] [DMG] } + [1722286250.504] [54321:5397545] [DMG] WriteClient moving to [AwaitingDe] + [1722286250.504] [54321:5397545] [EM] <<< [E:14426i S:42250 M:116961408 (Ack:156984778)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286250.504] [54321:5397545] [EM] Flushed pending ack for MessageCounter:156984778 on exchange 14426i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 3c: Test Harness reads the Presets attribute without calling + the CommitPresetsSchedulesRequest command" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #3c Test Harness Client reads Presets attribute but the new additions are not committed since the client didn't call the CommitPresetsSchedulesRequest command + + ./chip-tool thermostat read presets 0x12344321 1 + On TH(chip-tool) verify that DUT successfully read Presets (but without the new changes) + [1722286701.424] [54699:5406692] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0050 DataVersion: 3807987049 + [1722286701.425] [54699:5406692] [TOO] Presets: 2 entries + [1722286701.425] [54699:5406692] [TOO] [1]: { + [1722286701.425] [54699:5406692] [TOO] PresetHandle: 01 + [1722286701.425] [54699:5406692] [TOO] PresetScenario: 1 + [1722286701.425] [54699:5406692] [TOO] CoolingSetpoint: 2500 + [1722286701.425] [54699:5406692] [TOO] HeatingSetpoint: 2100 + [1722286701.426] [54699:5406692] [TOO] BuiltIn: TRUE + [1722286701.426] [54699:5406692] [TOO] } + [1722286701.426] [54699:5406692] [TOO] [2]: { + [1722286701.426] [54699:5406692] [TOO] PresetHandle: 02 + [1722286701.426] [54699:5406692] [TOO] PresetScenario: 2 + [1722286701.426] [54699:5406692] [TOO] CoolingSetpoint: 2600 + [1722286701.426] [54699:5406692] [TOO] HeatingSetpoint: 2000 + [1722286701.426] [54699:5406692] [TOO] BuiltIn: TRUE + [1722286701.426] [54699:5406692] [TOO] } + [1722286701.426] [54699:5406692] [EM] <<< [E:49759i S:37002 M:67372150 (Ack:254131025)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 3d: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #3d Test Harness Client calls CommitPresetsSchedulesRequest command + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722287841.505] [55282:5425045] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x0 + [1722287841.505] [55282:5425045] [DMG] ICR moving to [AwaitingDe] + [1722287841.505] [55282:5425045] [EM] <<< [E:46441i S:57071 M:61366563 (Ack:138534230)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 3e: Test Harness reads the Presets attribute after calling the + CommitPresetsSchedulesRequest command" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #3e Test Harness Client reads Presets attribute and can see the added Presets. + + ./chip-tool thermostat read presets 0x12344321 1 + On TH(chip-tool) verify that DUT successfully read Presets (with the new changes) + [1722288101.757] [55446:5430009] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0050 DataVersion: 3807987055 + [1722288101.757] [55446:5430009] [TOO] Presets: 5 entries + [1722288101.758] [55446:5430009] [TOO] [1]: { + [1722288101.759] [55446:5430009] [TOO] PresetHandle: 01 + [1722288101.759] [55446:5430009] [TOO] PresetScenario: 1 + [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2500 + [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2600 + [1722288101.759] [55446:5430009] [TOO] BuiltIn: TRUE + [1722288101.759] [55446:5430009] [TOO] } + [1722288101.759] [55446:5430009] [TOO] [2]: { + [1722288101.759] [55446:5430009] [TOO] PresetHandle: 02 + [1722288101.759] [55446:5430009] [TOO] PresetScenario: 2 + [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2600 + [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2500 + [1722288101.759] [55446:5430009] [TOO] BuiltIn: TRUE + [1722288101.759] [55446:5430009] [TOO] } + [1722288101.759] [55446:5430009] [TOO] [3]: { + [1722288101.759] [55446:5430009] [TOO] PresetHandle: 03 + [1722288101.759] [55446:5430009] [TOO] PresetScenario: 3 + [1722288101.759] [55446:5430009] [TOO] Name: Sleep + [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2500 + [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2600 + [1722288101.759] [55446:5430009] [TOO] BuiltIn: FALSE + [1722288101.759] [55446:5430009] [TOO] } + [1722288101.759] [55446:5430009] [TOO] [4]: { + [1722288101.759] [55446:5430009] [TOO] PresetHandle: 04 + [1722288101.759] [55446:5430009] [TOO] PresetScenario: 4 + [1722288101.759] [55446:5430009] [TOO] Name: Wake + [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2200 + [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2900 + [1722288101.759] [55446:5430009] [TOO] BuiltIn: FALSE + [1722288101.759] [55446:5430009] [TOO] } + [1722288101.759] [55446:5430009] [TOO] [5]: { + [1722288101.759] [55446:5430009] [TOO] PresetHandle: 06 + [1722288101.759] [55446:5430009] [TOO] PresetScenario: 6 + [1722288101.759] [55446:5430009] [TOO] Name: GoingToSleep + [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2100 + [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2500 + [1722288101.759] [55446:5430009] [TOO] BuiltIn: FALSE + [1722288101.759] [55446:5430009] [TOO] } + [1722288101.759] [55446:5430009] [EM] <<< [E:64397i S:21821 M:262922240 (Ack:37271345)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722288101.760] [55446:5430009] [EM] Flushed pending ack for MessageCounter:37271345 on exchange 64397i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 4a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #4a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 4b: Test Harness writes to the Presets attribute with a + built-in preset having preset handle hex:01 removed" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #4b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722288460.741] [55752:5437815] [DMG] WriteClient moving to [ResponseRe] + [1722288460.741] [55752:5437815] [DMG] WriteResponseMessage = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] AttributeStatusIBs = + [1722288460.741] [55752:5437815] [DMG] [ + [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] AttributePathIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] Endpoint = 0x1, + [1722288460.741] [55752:5437815] [DMG] Cluster = 0x201, + [1722288460.741] [55752:5437815] [DMG] Attribute = 0x0000_0050, + [1722288460.741] [55752:5437815] [DMG] } + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] StatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] status = 0x00 (SUCCESS), + [1722288460.741] [55752:5437815] [DMG] }, + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] }, + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] AttributePathIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] Endpoint = 0x1, + [1722288460.741] [55752:5437815] [DMG] Cluster = 0x201, + [1722288460.741] [55752:5437815] [DMG] Attribute = 0x0000_0050, + [1722288460.741] [55752:5437815] [DMG] ListIndex = Null, + [1722288460.741] [55752:5437815] [DMG] } + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] StatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] status = 0x00 (SUCCESS), + [1722288460.741] [55752:5437815] [DMG] }, + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] }, + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] AttributePathIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] Endpoint = 0x1, + [1722288460.741] [55752:5437815] [DMG] Cluster = 0x201, + [1722288460.741] [55752:5437815] [DMG] Attribute = 0x0000_0050, + [1722288460.741] [55752:5437815] [DMG] ListIndex = Null, + [1722288460.741] [55752:5437815] [DMG] } + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] StatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] status = 0x00 (SUCCESS), + [1722288460.741] [55752:5437815] [DMG] }, + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] }, + [1722288460.741] [55752:5437815] [DMG] + [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.741] [55752:5437815] [DMG] AttributePathIB = + [1722288460.741] [55752:5437815] [DMG] { + [1722288460.742] [55752:5437815] [DMG] Endpoint = 0x1, + [1722288460.742] [55752:5437815] [DMG] Cluster = 0x201, + [1722288460.742] [55752:5437815] [DMG] Attribute = 0x0000_0050, + [1722288460.742] [55752:5437815] [DMG] ListIndex = Null, + [1722288460.742] [55752:5437815] [DMG] } + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] StatusIB = + [1722288460.742] [55752:5437815] [DMG] { + [1722288460.742] [55752:5437815] [DMG] status = 0x00 (SUCCESS), + [1722288460.742] [55752:5437815] [DMG] }, + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] }, + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] AttributeStatusIB = + [1722288460.742] [55752:5437815] [DMG] { + [1722288460.742] [55752:5437815] [DMG] AttributePathIB = + [1722288460.742] [55752:5437815] [DMG] { + [1722288460.742] [55752:5437815] [DMG] Endpoint = 0x1, + [1722288460.742] [55752:5437815] [DMG] Cluster = 0x201, + [1722288460.742] [55752:5437815] [DMG] Attribute = 0x0000_0050, + [1722288460.742] [55752:5437815] [DMG] ListIndex = Null, + [1722288460.742] [55752:5437815] [DMG] } + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] StatusIB = + [1722288460.742] [55752:5437815] [DMG] { + [1722288460.742] [55752:5437815] [DMG] status = 0x00 (SUCCESS), + [1722288460.742] [55752:5437815] [DMG] }, + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] }, + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] ], + [1722288460.742] [55752:5437815] [DMG] + [1722288460.742] [55752:5437815] [DMG] InteractionModelRevision = 11 + [1722288460.742] [55752:5437815] [DMG] } + [1722288460.742] [55752:5437815] [DMG] WriteClient moving to [AwaitingDe] + [1722288460.742] [55752:5437815] [EM] <<< [E:10991i S:19292 M:9249657 (Ack:153811994)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 4c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #4c Test Harness Client calls CommitPresetsSchedulesRequest command and gets UNSUPPORTED_ACCESS since a built-in preset was attempted to be removed. + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error + [1722288464.392] [55754:5437857] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e + [1722288464.392] [55754:5437857] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) + [1722288464.392] [55754:5437857] [DMG] ICR moving to [AwaitingDe] + [1722288464.392] [55754:5437857] [EM] <<< [E:45905i S:14600 M:175519796 (Ack:248690311)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 5a: Test Harness calls the SetActivePresetRequest command to + set the active preset handle" + PICS: TSTAT.S.F08 && TSTAT.S.C06.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #5a Test Harness Client calls SetActivePresetRequest command to set the active preset handle + + ./chip-tool thermostat set-active-preset-request "hex:03" 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722292538.299] [58873:5523668] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_004E DataVersion: 3470253931 + [1722292538.300] [58873:5523668] [TOO] ActivePresetHandle: 03 + [1722292538.300] [58873:5523668] [EM] <<< [E:63772i S:58620 M:79797990 (Ack:248773669)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 5b: Test Harness reads the ActivePresetHandle attribute" + PICS: TSTAT.S.F08 && TSTAT.S.A004e + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #5b Test Harness Client reads ActivePresetHandle attribute + + ./chip-tool thermostat read active-preset-handle 0x12344321 1 + On TH(chip-tool) verify that DUT successfully read ActivePresetHandle + [1722299898.382] [62999:5632512] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_004E DataVersion: 3098962545 + [1722299898.382] [62999:5632512] [TOO] ActivePresetHandle: 03 + [1722299898.382] [62999:5632512] [EM] <<< [E:27648i S:55804 M:2686999 (Ack:191947351)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 5c: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #5b Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 5d: Test Harness writes to the Presets attribute without the + preset with handle hex:03 matching the ActivePresetHandle attribute + removed" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #5c Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets ./out/debug/chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 5e: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #5e Test Harness Client calls CommitPresetsSchedulesRequest command ans gets INVALID_IN_STATE since the preset with its handle matching the active preset handle was attempted to be removed. + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an INVALID_IN_STATE (0xCB) error + [1722293312.795] [59386:5538858] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0xcb + [1722293312.795] [59386:5538858] [TOO] Error: IM Error 0x000005CB: General error: 0xcb (INVALID_IN_STATE) + [1722293312.795] [59386:5538858] [DMG] ICR moving to [AwaitingDe] + [1722293312.795] [59386:5538858] [EM] <<< [E:4647i S:21966 M:58651952 (Ack:80870764)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 6a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #6a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 6b: Test Harness writes to the Presets attribute with a + built-in preset having preset handle hex:01 modified to be not + built-in." + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #6b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 6c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #6c Test Harness Client calls CommitPresetsSchedulesRequest command gets UNSUPPORTED_ACCESS since a built-in preset was attempted to be modified to a non built-in preset + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error + [1722289468.881] [56642:5458641] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e + [1722289468.881] [56642:5458641] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) + [1722289468.881] [56642:5458641] [DMG] ICR moving to [AwaitingDe] + [1722289468.881] [56642:5458641] [EM] <<< [E:20464i S:35105 M:91065475 (Ack:114933900)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 7a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #6a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 7b: Test Harness writes to the Presets attribute with a new + preset having builtIn set to true" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #7b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": null, "name": "Vacation", "presetScenario": 5, "coolingSetpoint": 2900, "heatingSetpoint": 2000, "builtIn": true }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 7c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #6c Test Harness Client calls CommitPresetsSchedulesRequest command and gets CONSTRAINT_ERROR since a new preset was attempted to be added as a built-in preset. + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an CONSTRAINT_ERROR (0x87) error + [1722289998.305] [56996:5468872] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x87 + [1722289998.305] [56996:5468872] [TOO] Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) + [1722289998.305] [56996:5468872] [DMG] ICR moving to [AwaitingDe] + [1722289998.305] [56996:5468872] [EM] <<< [E:44500i S:62829 M:76436393 (Ack:145233702)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 8a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #8a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 8b: Test Harness writes to the Presets attribute with a preset + having preset handle hex:08 that doesn't exist in the Presets + attribute" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #8b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:08", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 8c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #8c Test Harness Client calls CommitPresetsSchedulesRequest command gets NOT_FOUND since an existing preset was attempted to be added with a preset handle that doesn't exist in the Presets attribute + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an NOT_FOUND (0x8B) error + [1722290436.980] [57434:5479429] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x8b + [1722290436.980] [57434:5479429] [TOO] Error: IM Error 0x0000058B: General error: 0x8b (NOT_FOUND) + [1722290436.980] [57434:5479429] [DMG] ICR moving to [AwaitingDe] + [1722290436.980] [57434:5479429] [EM] <<< [E:54210i S:10110 M:158287615 (Ack:73923062)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 9a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #9a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 9b: Test Harness writes to the Presets attribute" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #8b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 9c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #8c Test Harness Client calls CommitPresetsSchedulesRequest command gets CONSTRAINT_ERROR since preset with preset handle hex:03 is duplicated + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends a CONSTRAINT_ERROR (0x87) error + [1722302289.994] [63677:5670818] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x87 + [1722302289.994] [63677:5670818] [TOO] Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) + [1722302289.994] [63677:5670818] [DMG] ICR moving to [AwaitingDe] + [1722302289.994] [63677:5670818] [EM] <<< [E:25209i S:7768 M:264197735 (Ack:106550461)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 10a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #10a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 10b: Test Harness writes to the Presets attribute wherein a + built-in preset is modified to a non built-in preset" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #10b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 10c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #10c Test Harness Client calls CommitPresetsSchedulesRequest command gets UNSUPPORTED_ACCESS since built-in preset with handle hex:01 was attempted to be modified to a not built-in preset + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error + [1722289468.881] [56642:5458641] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e + [1722289468.881] [56642:5458641] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) + [1722289468.881] [56642:5458641] [DMG] ICR moving to [AwaitingDe] + [1722289468.881] [56642:5458641] [EM] <<< [E:20464i S:35105 M:91065475 (Ack:114933900)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 11a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #11a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 11b: Test Harness writes to the Presets attribute wherein a non + built-in preset is modified to a built-in preset" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #11b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 11c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #11c Test Harness Client calls CommitPresetsSchedulesRequest command gets UNSUPPORTED_ACCESS since non built-in preset with handle hex:03 was attempted to be modified to be built-in + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error + [1722297542.066] [60654:5591651] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e + [1722297542.066] [60654:5591651] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) + [1722297542.066] [60654:5591651] [DMG] ICR moving to [AwaitingDe] + [1722297542.066] [60654:5591651] [EM] <<< [E:11999i S:35595 M:148057801 (Ack:14642826)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 12a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #12a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 12b: Test Harness writes to the Presets attribute with a preset + that doesn't support names in the PresetTypeFeatures bitmap but has a + name" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #11b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "name": "Occupied", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 12c: Test Harness calls the CommitPresetsSchedulesRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #11c Test Harness Client calls CommitPresetsSchedulesRequest command gets CONSTRAINT_ERROR since we attempted to add a name to a preset with handle hex:01 that doesn't support names. + + ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends an CONSTRAINT_ERROR (0x87) error + [1722298150.233] [60910:5602100] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x87 + [1722298150.233] [60910:5602100] [TOO] Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) + [1722298150.233] [60910:5602100] [DMG] ICR moving to [AwaitingDe] + [1722298150.233] [60910:5602100] [EM] <<< [E:44287i S:42687 M:5072557 (Ack:66989213)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + #TODO: Add tests for the total number of Presets exceeds the NumberOfPresets supported. Also Add tests for adding presets with preset scenario not present in PresetTypes. + + - label: + "Step 13a: Test Harness calls the StartPresetsSchedulesEditRequest + command to edit presets" + PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #13a Test Harness Client calls StartPresetsSchedulesEditRequest command + + ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 + [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] + [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 13b: Test Harness writes to the Presets attribute but calls + CancelPresetsSchedulesEditRequest command to cancel the edit request" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #13b Test Harness Client attempts to write Presets and gets SUCCESS + + ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": null, "name": "Vacation", "presetScenario": 5, "coolingSetpoint": 2900, "heatingSetpoint": 2000, "builtIn": false }, {"presetHandle": "06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 3000, "heatingSetpoint": 1900, "builtIn": false }]' 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] + [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = + [1722289461.376] [56636:5458560] [DMG] [ + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.376] [56636:5458560] [DMG] } + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] StatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] }, + [1722289461.376] [56636:5458560] [DMG] + [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] AttributePathIB = + [1722289461.376] [56636:5458560] [DMG] { + [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] AttributePathIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, + [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, + [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, + [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] StatusIB = + [1722289461.377] [56636:5458560] [DMG] { + [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] }, + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] ], + [1722289461.377] [56636:5458560] [DMG] + [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 + [1722289461.377] [56636:5458560] [DMG] } + [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] + [1722286250.504] [54321:5397545] [EM] <<< [E:14426i S:42250 M:116961408 (Ack:156984778)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + [1722286250.504] [54321:5397545] [EM] Flushed pending ack for MessageCounter:156984778 on exchange 14426i + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 13c: Test Harness calls the CancelPresetsSchedulesEditRequest + command" + PICS: TSTAT.S.F08 && TSTAT.S.C08.Rsp + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #13c Test Harness Client calls CancelPresetsSchedulesEditRequest command + + ./chip-tool thermostat cancel-presets-schedules-edit-request 0x12344321 1 + On TH(chip-tool) verify that DUT sends a success response + [1722287841.505] [55282:5425045] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x0 + [1722287841.505] [55282:5425045] [DMG] ICR moving to [AwaitingDe] + [1722287841.505] [55282:5425045] [EM] <<< [E:46441i S:57071 M:61366563 (Ack:138534230)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: + "Step 13d: Test Harness reads the Presets attribute after calling the + CancelPresetsSchedulesEditRequest command" + PICS: TSTAT.S.F08 && TSTAT.S.A0050 + verification: | + Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. + + #3c Test Harness Client reads Presets attribute + + ./chip-tool thermostat read presets 0x12344321 1 + On TH(chip-tool) verify that DUT successfully read Presets (but without the Vacation preset added) + [1722299465.497] [62905:5625656] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0050 DataVersion: 3098962545 + [1722299465.497] [62905:5625656] [TOO] Presets: 5 entries + [1722299465.498] [62905:5625656] [TOO] [1]: { + [1722299465.498] [62905:5625656] [TOO] PresetHandle: 01 + [1722299465.498] [62905:5625656] [TOO] PresetScenario: 1 + [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2500 + [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2600 + [1722299465.498] [62905:5625656] [TOO] BuiltIn: TRUE + [1722299465.498] [62905:5625656] [TOO] } + [1722299465.498] [62905:5625656] [TOO] [2]: { + [1722299465.498] [62905:5625656] [TOO] PresetHandle: 02 + [1722299465.498] [62905:5625656] [TOO] PresetScenario: 2 + [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2600 + [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2500 + [1722299465.498] [62905:5625656] [TOO] BuiltIn: TRUE + [1722299465.498] [62905:5625656] [TOO] } + [1722299465.498] [62905:5625656] [TOO] [3]: { + [1722299465.498] [62905:5625656] [TOO] PresetHandle: 03 + [1722299465.498] [62905:5625656] [TOO] PresetScenario: 3 + [1722299465.498] [62905:5625656] [TOO] Name: Sleep + [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2500 + [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2600 + [1722299465.498] [62905:5625656] [TOO] BuiltIn: FALSE + [1722299465.498] [62905:5625656] [TOO] } + [1722299465.498] [62905:5625656] [TOO] [4]: { + [1722299465.498] [62905:5625656] [TOO] PresetHandle: 04 + [1722299465.498] [62905:5625656] [TOO] PresetScenario: 4 + [1722299465.498] [62905:5625656] [TOO] Name: Wake + [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2200 + [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2900 + [1722299465.498] [62905:5625656] [TOO] BuiltIn: FALSE + [1722299465.498] [62905:5625656] [TOO] } + [1722299465.498] [62905:5625656] [TOO] [5]: { + [1722299465.498] [62905:5625656] [TOO] PresetHandle: 06 + [1722299465.498] [62905:5625656] [TOO] PresetScenario: 6 + [1722299465.498] [62905:5625656] [TOO] Name: Vacationleep + [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2100 + [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2500 + [1722299465.498] [62905:5625656] [TOO] BuiltIn: FALSE + [1722299465.498] [62905:5625656] [TOO] } + [1722299465.498] [62905:5625656] [EM] <<< [E:53084i S:11903 M:249395534 (Ack:245071987)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 152544521f1453..82254aa6c0cd4e 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1916,6 +1916,7 @@ TSTAT.S.F03=0 TSTAT.S.F04=0 TSTAT.S.F05=1 TSTAT.S.F06=0 +TSTAT.S.F08=1 TSTAT.S.A0000=1 TSTAT.S.A0001=0 @@ -1967,6 +1968,12 @@ TSTAT.S.A0044=0 TSTAT.S.A0045=0 TSTAT.S.A0046=0 TSTAT.S.A0047=0 +TSTAT.S.A0048=1 +TSTAT.S.A004a=1 +TSTAT.S.A004e=1 +TSTAT.S.A0050=1 +TSTAT.S.A0052=1 + TSTAT.S.M.MinSetpointDeadBandWritable=1 TSTAT.S.M.HVACSystemTypeConfigurationWritable=0 @@ -1976,6 +1983,10 @@ TSTAT.S.C01.Rsp=0 TSTAT.S.C02.Rsp=0 TSTAT.S.C03.Rsp=0 TSTAT.S.C04.Rsp=0 +TSTAT.S.C06.Rsp=1 +TSTAT.S.C07.Rsp=1 +TSTAT.S.C08.Rsp=1 +TSTAT.S.C09.Rsp=1 # Client TSTAT.C=0 @@ -1990,6 +2001,10 @@ TSTAT.C.C02.Tx=0 TSTAT.C.C03.Tx=0 TSTAT.S.C00.Tx=0 TSTAT.S.C01.Tx=0 +TSTAT.C.C06.Tx=1 +TSTAT.C.C07.Tx=1 +TSTAT.C.C08.Tx=1 +TSTAT.C.C09.Tx=1 # Client Commands TSTAT.C.C00.Tx=1 From d5f3db374294f98d6d11d58bb009be74e3fabc93 Mon Sep 17 00:00:00 2001 From: raju-apple <84206864+raju-apple@users.noreply.github.com> Date: Wed, 31 Jul 2024 02:21:05 -0700 Subject: [PATCH 02/40] =?UTF-8?q?Modifying=20the=20existing=20DD=20YAMLs?= =?UTF-8?q?=20to=20also=20include=20the=20steps=20for=20WiFi-PAF=E2=80=A6?= =?UTF-8?q?=20(#34651)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modifying the exising DD YAMLs to also include the steps for WiFi-PAF feature * Restyle Modifying the existing DD YAMLs to also include the steps for WiFi-PAF… (#34654) * Restyled by whitespace * Restyled by prettier-yaml --------- Co-authored-by: Restyled.io --------- Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com> Co-authored-by: Restyled.io --- src/app/tests/suites/certification/PICS.yaml | 3 ++ .../suites/certification/Test_TC_DD_2_2.yaml | 23 ++++++++ .../suites/certification/Test_TC_DD_3_11.yaml | 40 ++++++++++++++ .../suites/certification/Test_TC_DD_3_12.yaml | 48 +++++++++++++++++ .../suites/certification/Test_TC_DD_3_13.yaml | 53 +++++++++++++++++++ .../suites/certification/Test_TC_DD_3_14.yaml | 29 ++++++++++ .../tests/suites/certification/ci-pics-values | 1 + 7 files changed, 197 insertions(+) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 169d5684673b9d..836e71e3964e40 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -140,6 +140,9 @@ PICS: - label: "Does the commissioner support Discovery Capability over SoftAP?" id: MCORE.DD.DISCOVERY_SOFTAP + - label: "Does the commissioner support Discovery Capability over Wifi-PAF?" + id: MCORE.DD.DISCOVERY_PAF + - label: "Does the DUT support Standard Commissioning Flow?" id: MCORE.DD.STANDARD_COMM_FLOW diff --git a/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml index f0a2403b36506e..925ac72f7012ad 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_2_2.yaml @@ -181,6 +181,29 @@ tests: SoftAP commissioning not currently supported on TH=all-clusters-app disabled: true + - label: + "Step 3c: TH is configured with the default channel to be Channel 6 in + 2.4GHz. If TH has a 5GHz Wi-Fi radio, TH is configured with an + additional channel list that includes Channel 44 and the operating + channel Wi-Fi network the DUT is on if it is operating in non-ETSI + regulatory domains and includes Channel 149 if it is operating in ETSI + regulatory domains." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + TH must start sending Wi-Fi PAF Publish Frames on the default channel and the channel list. + 2.4g - $sudo ./chip-all-clusters-app --wifi --wifipaf freq_list=2437 + 5g - FCC - $sudo ./chip-all-clusters-app --wifi --wifipaf freq_list=5220 + 5g ETSI - $sudo ./chip-all-clusters-app --wifi --wifipaf freq_list=5745 + disabled: true + + - label: "Step 3d: DUT starts Wi-Fi PAF scan in its commissioning channel" + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + DUT must find TH and provide onboarding data to for validation. Pass Criteria: DUT is able to report the Onboarding payload as set on TH + + $ sudo ./chip-tool pairing wifipaf-wifi 1 n_m_2g nxp12345 20202021 3840 + disabled: true + - label: "Step 4a: DUT scans using Wi-Fi in background" PICS: MCORE.DD.DISCOVERY_SOFTAP verification: | diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_11.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_11.yaml index fe6c2f5ce75911..0d4a13790f4f62 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_3_11.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_3_11.yaml @@ -171,6 +171,46 @@ tests: [1651105530.973215][27371:27371] CHIP:DIS: Updating services using commissioning mode 0 disabled: true + - label: "Step 2d: Scan the QR code from the previous step using the DUT." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + 1. User has a QR code to pass into DUT + + # ./chip-all-clusters-app --wifi --wifipaf --custom-flow 0 --capabilities 8 + [1719392550.248867][1563:1563] CHIP:SVR: SetupQRCode: [MT:-24J0M3810KA0648G00] + [1719392550.248883][1563:1563] CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + [1719392550.248892][1563:1563] CHIP:SVR: https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J0M3810KA0648G00 + [1719392550.248911][1563:1563] CHIP:SVR: Manual pairing code: [34970112332] + disabled: true + + - label: "Step 2e: Verify the QR code has been scanned successfully." + PICS: MCORE.DD.SCAN_QR_CODE + verification: | + 1. Verify the QR code has been scanned successfully. + + $ sudo ./chip-tool payload parse-setup-payload MT:-24J0M3810KA0648G00 + [1719392883.120482][28468:28468] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs + [1719392883.120687][28468:28468] CHIP:SPL: Parsing base38Representation: MT:-24J0M3810KA0648G00 + [1719392883.120839][28468:28468] CHIP:SPL: Version: 0 + [1719392883.120859][28468:28468] CHIP:SPL: VendorID: 65521 + [1719392883.120874][28468:28468] CHIP:SPL: ProductID: 32769 + [1719392883.120890][28468:28468] CHIP:SPL: Custom flow: 0 (STANDARD) + [1719392883.120910][28468:28468] CHIP:SPL: Discovery Bitmask: 0x08 (Wi-Fi PAF) + [1719392883.120928][28468:28468] CHIP:SPL: Long discriminator: 3840 (0xf00) + [1719392883.120944][28468:28468] CHIP:SPL: Passcode: 20202021 + disabled: true + + - label: + "Step 2f: Using the DUT, parse the TH’s QR code and follow any steps + needed for the Commissioner/Commissionee to complete the commissioning + process using Wi-Fi PAF" + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + 1. DUT parses QR code and DUT commissions TH to the Matter network + + $ sudo ./chip-tool pairing code-wifi 1 n_m_2g nxp12345 MT:-24J0M3810KA0648G00 + disabled: true + - label: "Step 3a: Standard Commissioning Flow: Use a Commissionee with a QR code that has the Custom Flow field set to 0 and supports SoftAP for diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_12.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_12.yaml index 3efb89b8e1db67..6dd289efd377aa 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_3_12.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_3_12.yaml @@ -169,6 +169,54 @@ tests: [1657234324847] [31475:16824564] CHIP: [TOO] Device commissioning completed with success disabled: true + - label: + "Step 2e: User-Intent Commissioning Flow: Use a Commissionee with a QR + code that has the Custom Flow field set to 1 and supports Wi-Fi PAF + for its Discovery Capability. " + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + User has a QR code to pass into DUT. + # ./chip-all-clusters-app --wifi --wifipaf --custom-flow 1 --capabilities 8 + [1719393010.693198][1592:1592] CHIP:SVR: SetupQRCode: [MT:-24J0IJ910KA0648G00] + [1719393010.693213][1592:1592] CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + [1719393010.693222][1592:1592] CHIP:SVR: https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J0IJ910KA0648G00 + [1719393010.693246][1592:1592] CHIP:SVR: Manual pairing code: [749701123365521327694] + disabled: true + + - label: "Step 2f: Scan the QR code from the previous step using the DUT." + PICS: MCORE.DD.SCAN_QR_CODE + verification: | + Verify the QR code has been scanned successfully. + disabled: true + + - label: "Step 2g: DUT parses QR code." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + Verify DUT has parsed the QR code. Verify TH has not been commissioned to the Matter network. + $ sudo ./chip-tool payload parse-setup-payload MT:-24J0IJ910KA0648G00 + [1719393067.811966][28514:28514] CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs + [1719393067.812195][28514:28514] CHIP:DL: writing settings to file (/tmp/chip_tool_kvs-PRUpuW) + [1719393067.812351][28514:28514] CHIP:DL: renamed tmp file to file (/tmp/chip_tool_kvs) + [1719393067.812455][28514:28514] CHIP:SPL: Parsing base38Representation: MT:-24J0IJ910KA0648G00 + [1719393067.812626][28514:28514] CHIP:SPL: Version: 0 + [1719393067.812647][28514:28514] CHIP:SPL: VendorID: 65521 + [1719393067.812664][28514:28514] CHIP:SPL: ProductID: 32769 + [1719393067.812679][28514:28514] CHIP:SPL: Custom flow: 1 (USER ACTION REQUIRED) + [1719393067.812698][28514:28514] CHIP:SPL: Discovery Bitmask: 0x08 (Wi-Fi PAF) + [1719393067.812714][28514:28514] CHIP:SPL: Long discriminator: 3840 (0xf00) + [1719393067.812729][28514:28514] CHIP:SPL: Passcode: 20202021 + disabled: true + + - label: + "Step 2h: User should follow any TH-specific steps for putting the TH + Commissionee device into commissioning mode and to complete the + commissioning process using Wi-Fi PAF." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + DUT commissions TH to the Matter network. + $ sudo ./chip-tool pairing code-wifi 1 n_m_2g nxp12345 MT:-24J0IJ910KA0648G00 + disabled: true + - label: "Step 3a: User-Intent Commissioning Flow: Use a Commissionee with a QR code that has the Custom Flow field set to 1 and supports SoftAP for diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_13.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_13.yaml index e9defbde177b5e..b55f04244aa6be 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_3_13.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_3_13.yaml @@ -182,6 +182,59 @@ tests: [1657235198856] [31506:16834043] CHIP: [TOO] Device commissioning completed with success disabled: true + - label: + "Step 2e: Custom Commissioning Flow: Use a Commissionee with a QR code + that has the Custom Flow field set to 2 and supports Wi-Fi PAF for its + Discovery Capability. Commissionee is NOT in commissioning mode. + Ensure the Version bit string follows the current Matter spec. + documentation." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + 1. User has a QR code to pass into DUT. + # ./chip-all-clusters-app --wifi --wifipaf --custom-flow 2 --capabilities 8 + [1719393349.405047][1623:1623] CHIP:SVR: SetupQRCode: [MT:-24J0EZA10KA0648G00] + [1719393349.405062][1623:1623] CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + [1719393349.405071][1623:1623] CHIP:SVR: https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J0EZA10KA0648G00 + [1719393349.405095][1623:1623] CHIP:SVR: Manual pairing code: [749701123365521327694] + disabled: true + + - label: "Step 2f: Scan the QR code from the previous step using the DUT." + PICS: MCORE.DD.SCAN_QR_CODE + verification: | + 1. Verify the QR code has been scanned successfully. + disabled: true + + - label: "Step 2g: DUT parses QR code." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + 1. Verify DUT has parsed the QR code. Verify TH has not been commissioned to the Matter network. + $ sudo ./chip-tool payload parse-setup-payload MT:-24J0EZA10KA0648G00 + CHIP:DL: ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs + CHIP:DL: writing settings to file (/tmp/chip_tool_kvs-UQIGvf) + CHIP:DL: renamed tmp file to file (/tmp/chip_tool_kvs) + CHIP:SPL: Parsing base38Representation: MT:-24J0EZA10KA0648G00 + CHIP:SPL: Version: 0 + CHIP:SPL: VendorID: 65521 + CHIP:SPL: ProductID: 32769 + CHIP:SPL: Custom flow: 2 (CUSTOM) + CHIP:SPL: Discovery Bitmask: 0x08 (Wi-Fi PAF) + CHIP:SPL: Long discriminator: 3840 (0xf00) + CHIP:SPL: Passcode: 20202021 + + disabled: true + + - label: + "Step 2h: User should follow any TH-specific steps, unless the DUT has + alternative means to guide the user to successful commissioning, for + putting the TH Commissionee into commissioning mode, for triggering + the DUT Commissioner for commissioning, and for completing the + commissioning process using BLE." + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + 1. DUT commissions TH to the Matter network. + $ sudo ./chip-tool pairing code-wifi 1 n_m_2g nxp12345 MT:-24J0EZA10KA0648G00 + disabled: true + - label: "Step 3a: Custom Commissioning Flow: Use a Commissionee with a QR code that has the Custom Flow field set to 2 and supports SoftAP for its diff --git a/src/app/tests/suites/certification/Test_TC_DD_3_14.yaml b/src/app/tests/suites/certification/Test_TC_DD_3_14.yaml index fb72ab66d1bd7d..c269e0c66d4485 100644 --- a/src/app/tests/suites/certification/Test_TC_DD_3_14.yaml +++ b/src/app/tests/suites/certification/Test_TC_DD_3_14.yaml @@ -212,6 +212,35 @@ tests: Run command failure: ../../third_party/connectedhomeip/src/controller/SetUpCodePairer.cpp:50: CHIP Error 0x0000002F: Invalid argument disabled: true + - label: + "Step 4c: Using the QR code from Step 1, ensure the TH’s Discovery + Capability bit string is NOT set to Wi-Fi PAF for discovery (i.e. set + to OnNetwork discovery capability)" + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + User has a QR code generated to pass into DUT. Using the example provided above, the payload would be "MT:-24J029Q00KA0648G00". + $ ./out/all-clusters-app/chip-all-clusters-app --version 0 --vendor-id 0xFFF1 --product-id 0x8001 --custom-flow 2 --capabilities 4 --discriminator 3840 --passcode 20202021 + [1657235470.970680][371041:371041] CHIP:DL: Device Configuration: + [1657235470.970772][371041:371041] CHIP:DL: Serial Number: (not set) + [1657235470.970811][371041:371041] CHIP:DL: Vendor Id: 65521 (0xFFF1) + [1657235470.970845][371041:371041] CHIP:DL: Product Id: 32769 (0x8001) + [1657235470.970892][371041:371041] CHIP:DL: Hardware Version: 0 + [1657235470.970929][371041:371041] CHIP:DL: Setup Pin Code (0 for UNKNOWN/ERROR): 20202021 + [1657235470.970984][371041:371041] CHIP:DL: Setup Discriminator (0xFFFF for UNKNOWN/ERROR): 3840 (0xF00) + [1657235470.971031][371041:371041] CHIP:DL: Manufacturing Date: (not set) + [1657235470.971095][371041:371041] CHIP:DL: Device Type: 65535 (0xFFFF) + [1657235470.971147][371041:371041] CHIP:-: ==== Onboarding payload for Standard Commissioning Flow ==== + [1657235470.971199][371041:371041] CHIP:SVR: SetupQRCode: [MT:-24J029Q00KA0648G00] + [1657235470.971258][371041:371041] CHIP:SVR: Copy/paste the below URL in a browser to see the QR Code: + [1657235470.971293][371041:371041] CHIP:SVR: https://dhrishi.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J029Q00KA0648G00" + disabled: true + + - label: "Step 4d: Scan/read the QR code of the TH device using the DUT" + PICS: MCORE.DD.DISCOVERY_PAF + verification: | + If TH Commissionee’s Discovery Capabilities do not support Wi-Fi PAF, ensure that the DUT commissions the TH onto the Matter network over a capability that is NOT BLE. In this example, over OnNetwork. + disabled: true + - label: "Step 5a: Prefix: Using the QR code from Step 1, generate a new QR code but substituting out the current Prefix with an invalid Prefix diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 82254aa6c0cd4e..fe5ffcdab753b1 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1093,6 +1093,7 @@ BIND.C=0 # Device Discovery MCORE.DD.DISCOVERY_SOFTAP=0 +MCORE.DD.DISCOVERY_PAF=0 MCORE.DD.CHIP_DEV=1 MCORE.DD.DEV_LOCK=1 MCORE.DD.DEV_BARRIER=1 From f45fdb8a937faba68f29375bc5823e8b72cfe15b Mon Sep 17 00:00:00 2001 From: Martin Girardot <165289184+Martin-NXP@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:23:28 +0200 Subject: [PATCH 03/40] [NXP][scripts] Switch RW61X to use common NXP builder and workflow (#34510) * [NXP][scripts] Switch RW61X to use common NXP builder Signed-off-by: Martin Girardot * Restyled by autopep8 * Restyled by isort --------- Signed-off-by: Martin Girardot Co-authored-by: Restyled.io --- .github/workflows/examples-nxp.yaml | 64 +++++++++ .github/workflows/examples-rw61x.yaml | 96 ------------- scripts/build/BUILD.gn | 1 - scripts/build/build/targets.py | 27 +--- scripts/build/builders/nxp.py | 103 ++++++++++++-- scripts/build/builders/rw61x.py | 129 ------------------ .../build/testdata/all_targets_linux_x64.txt | 3 +- 7 files changed, 161 insertions(+), 262 deletions(-) delete mode 100644 .github/workflows/examples-rw61x.yaml delete mode 100644 scripts/build/builders/rw61x.py diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index d3ea4af06df3dc..747813d6aa1037 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -96,7 +96,71 @@ jobs: if: ${{ !env.ACT }} with: platform-name: K32W + rw61x: + name: RW61X + env: + BUILD_TYPE: gn_rw61x + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-rw61x:66 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: nxp + extra-submodule-parameters: --recursive + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build RW61X all clusters example app + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-freertos-all-clusters-wifi \ + --target nxp-rw61x-freertos-all-clusters-thread \ + --target nxp-rw61x-freertos-all-clusters-thread-wifi \ + build \ + --copy-artifacts-to out/artifacts \ + " + + - name: Build RW61X thermostat example app + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-freertos-thermostat-wifi \ + --target nxp-rw61x-freertos-thermostat-thread \ + --target nxp-rw61x-freertos-thermostat-thread-wifi \ + build \ + --copy-artifacts-to out/artifacts \ + " + + - name: Build RW61X laundry-washer example app + run: | + scripts/run_in_build_env.sh "\ + ./scripts/build/build_examples.py \ + --target nxp-rw61x-freertos-laundry-washer-wifi \ + --target nxp-rw61x-freertos-laundry-washer-thread \ + --target nxp-rw61x-freertos-laundry-washer-thread-wifi \ + build \ + --copy-artifacts-to out/artifacts \ + " + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: RW61X zephyr: name: ZEPHYR_RW61X diff --git a/.github/workflows/examples-rw61x.yaml b/.github/workflows/examples-rw61x.yaml deleted file mode 100644 index 8766a9b1958e10..00000000000000 --- a/.github/workflows/examples-rw61x.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright (c) 2023 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: Build example - RW61X - -on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true - -env: - CHIP_NO_LOG_TIMESTAMPS: true - -jobs: - rw61x: - name: RW61X - - env: - BUILD_TYPE: gn_rw61x - - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' - - container: - image: ghcr.io/project-chip/chip-build-rw61x:66 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: nxp - extra-submodule-parameters: --recursive - - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} - - - name: Build RW61X all clusters example app - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target rw61x-all-clusters-app-wifi \ - --target rw61x-all-clusters-app-thread \ - --target rw61x-all-clusters-app-thread-wifi \ - build \ - --copy-artifacts-to out/artifacts \ - " - - - name: Build RW61X thermostat example app - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target rw61x-thermostat-wifi \ - --target rw61x-thermostat-thread \ - --target rw61x-thermostat-thread-wifi \ - build \ - --copy-artifacts-to out/artifacts \ - " - - - name: Build RW61X laundry-washer example app - run: | - scripts/run_in_build_env.sh "\ - ./scripts/build/build_examples.py \ - --target rw61x-laundry-washer-wifi \ - --target rw61x-laundry-washer-thread \ - --target rw61x-laundry-washer-thread-wifi \ - build \ - --copy-artifacts-to out/artifacts \ - " - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: RW61X diff --git a/scripts/build/BUILD.gn b/scripts/build/BUILD.gn index dd3ed2de3e7efa..36b8209285576e 100644 --- a/scripts/build/BUILD.gn +++ b/scripts/build/BUILD.gn @@ -59,7 +59,6 @@ pw_python_package("build_examples") { "builders/nxp.py", "builders/openiotsdk.py", "builders/qpg.py", - "builders/rw61x.py", "builders/telink.py", "builders/tizen.py", "runner/__init__.py", diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 2c5f84ca30ad37..433d98911f2f1f 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -31,7 +31,6 @@ from builders.nxp import NxpApp, NxpBoard, NxpBuilder, NxpOsUsed from builders.openiotsdk import OpenIotSdkApp, OpenIotSdkBuilder, OpenIotSdkCryptoBackend from builders.qpg import QpgApp, QpgBoard, QpgBuilder -from builders.rw61x import RW61XApp, RW61XBuilder from builders.stm32 import stm32App, stm32Board, stm32Builder from builders.telink import TelinkApp, TelinkBoard, TelinkBuilder from builders.ti import TIApp, TIBoard, TIBuilder @@ -506,7 +505,7 @@ def BuildNxpTarget(): # OS target.AppendFixedTargets([ TargetPart('zephyr', os_env=NxpOsUsed.ZEPHYR).OnlyIfRe('rw61x'), - TargetPart('freertos', os_env=NxpOsUsed.FREERTOS).ExceptIfRe('rw61x'), + TargetPart('freertos', os_env=NxpOsUsed.FREERTOS), ]) # apps @@ -526,6 +525,10 @@ def BuildNxpTarget(): target.AppendModifier(name="dac-conversion", convert_dac_pk=True).OnlyIfRe('factory').ExceptIfRe('(k32w0|rw61x)') target.AppendModifier(name="rotating-id", enable_rotating_id=True).ExceptIfRe('rw61x') target.AppendModifier(name="sw-v2", has_sw_version_2=True) + target.AppendModifier(name="ota", enable_ota=True).ExceptIfRe('zephyr') + target.AppendModifier(name="wifi", enable_wifi=True).OnlyIfRe('rw61x') + target.AppendModifier(name="thread", enable_thread=True).ExceptIfRe('zephyr') + target.AppendModifier(name="matter-shell", enable_shell=True).ExceptIfRe('k32w0|k32w1') return target @@ -720,25 +723,6 @@ def BuildMW320Target(): return target -def BuildRW61XTarget(): - target = BuildTarget('rw61x', RW61XBuilder) - - # apps - target.AppendFixedTargets([ - TargetPart('all-clusters-app', app=RW61XApp.ALL_CLUSTERS, release=True), - TargetPart('thermostat', app=RW61XApp.THERMOSTAT, release=True), - TargetPart('laundry-washer', app=RW61XApp.LAUNDRY_WASHER, release=True), - ]) - - target.AppendModifier(name="ota", enable_ota=True) - target.AppendModifier(name="wifi", enable_wifi=True) - target.AppendModifier(name="thread", enable_thread=True) - target.AppendModifier(name="factory-data", enable_factory_data=True) - target.AppendModifier(name="matter-shell", enable_shell=True) - - return target - - def BuildGenioTarget(): target = BuildTarget('genio', GenioBuilder) target.AppendFixedTargets([TargetPart('lighting-app', app=GenioApp.LIGHT)]) @@ -820,7 +804,6 @@ def BuildOpenIotSdkTargets(): BuildHostTestRunnerTarget(), BuildIMXTarget(), BuildInfineonTarget(), - BuildRW61XTarget(), BuildNxpTarget(), BuildMbedTarget(), BuildMW320Target(), diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index 74f40eaa0a36aa..b72015f0afc677 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import importlib.util import logging import os from enum import Enum, auto @@ -38,23 +39,29 @@ class NxpBoard(Enum): K32W1 = auto() RW61X = auto() - def Name(self): + def Name(self, os_env): if self == NxpBoard.K32W0: return 'k32w0x' elif self == NxpBoard.K32W1: return 'k32w1' elif self == NxpBoard.RW61X: - return 'rd_rw612_bga' + if os_env == NxpOsUsed.ZEPHYR: + return 'rd_rw612_bga' + else: + return 'rw61x' else: raise Exception('Unknown board type: %r' % self) - def FolderName(self): + def FolderName(self, os_env): if self == NxpBoard.K32W0: return 'k32w/k32w0' elif self == NxpBoard.K32W1: return 'k32w/k32w1' elif self == NxpBoard.RW61X: - return 'zephyr' + if os_env == NxpOsUsed.ZEPHYR: + return 'zephyr' + else: + return 'rt/rw61x' else: raise Exception('Unknown board type: %r' % self) @@ -94,8 +101,8 @@ def NameSuffix(self): else: raise Exception('Unknown app type: %r' % self) - def BuildRoot(self, root, board): - return os.path.join(root, 'examples', self.ExampleName(), 'nxp', board.FolderName()) + def BuildRoot(self, root, board, os_env): + return os.path.join(root, 'examples', self.ExampleName(), 'nxp', board.FolderName(os_env)) class NxpBuilder(GnBuilder): @@ -113,9 +120,16 @@ def __init__(self, use_fro32k: bool = False, enable_lit: bool = False, enable_rotating_id: bool = False, - has_sw_version_2: bool = False): + has_sw_version_2: bool = False, + disable_ble: bool = False, + enable_thread: bool = False, + enable_wifi: bool = False, + disable_ipv4: bool = False, + enable_shell: bool = False, + enable_ota: bool = False, + is_sdk_package: bool = True): super(NxpBuilder, self).__init__( - root=app.BuildRoot(root, board), + root=app.BuildRoot(root, board, os_env), runner=runner) self.code_root = root self.app = app @@ -129,6 +143,13 @@ def __init__(self, self.enable_lit = enable_lit self.enable_rotating_id = enable_rotating_id self.has_sw_version_2 = has_sw_version_2 + self.disable_ipv4 = disable_ipv4 + self.disable_ble = disable_ble + self.enable_thread = enable_thread + self.enable_wifi = enable_wifi + self.enable_ota = enable_ota + self.enable_shell = enable_shell + self.is_sdk_package = is_sdk_package def GnBuildArgs(self): args = [] @@ -159,6 +180,30 @@ def GnBuildArgs(self): if self.has_sw_version_2: args.append('nxp_software_version=2') + if self.enable_ota: + # OTA is enabled by default on kw32 + if self.board == NxpBoard.RW61X: + args.append('chip_enable_ota_requestor=true no_mcuboot=false') + + if self.enable_wifi: + args.append('chip_enable_wifi=true') + + if self.disable_ble: + args.append('chip_enable_ble=false') + + if self.enable_shell: + args.append('chip_enable_matter_cli=true') + + if self.enable_thread: + # thread is enabled by default on kw32 + if self.board == NxpBoard.RW61X: + args.append('chip_enable_openthread=true chip_inet_config_enable_ipv4=false') + if self.enable_wifi: + args.append('openthread_root=\\"//third_party/connectedhomeip/third_party/openthread/ot-nxp/openthread-br\\"') + + if self.is_sdk_package: + args.append('is_sdk_package=true') + return args def WestBuildArgs(self): @@ -186,16 +231,50 @@ def generate(self): cmd += ''' west build -p --cmake-only -b {board_name} -d {out_folder} {example_folder} {build_args} '''.format( - board_name=self.board.Name(), + board_name=self.board.Name(self.os_env), out_folder=self.output_dir, - example_folder=self.app.BuildRoot(self.code_root, self.board), + example_folder=self.app.BuildRoot(self.code_root, self.board, self.os_env), build_args=build_args).strip() self._Execute(['bash', '-c', cmd], title='Generating ' + self.identifier) else: - super(NxpBuilder, self).generate() + cmd = '' + # will be used with next sdk version to get sdk path + if 'NXP_UPDATE_SDK_SCRIPT_DOCKER' in os.environ: + # Dynamic import of a python file to get platforms sdk path + spec = importlib.util.spec_from_file_location("None", os.environ['NXP_UPDATE_SDK_SCRIPT_DOCKER']) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + + for p in module.ALL_PLATFORM_SDK: + if p.sdk_name == 'k32w0': + cmd += 'export NXP_K32W0_SDK_ROOT="' + str(p.sdk_storage_location_abspath) + '" \n ' + elif p.sdk_name == 'common': + cmd += 'export NXP_SDK_ROOT="' + str(p.sdk_storage_location_abspath) + '" \n ' + cmd += 'gn gen --check --fail-on-unused-args --export-compile-commands --root=%s' % self.root + + extra_args = [] + + if self.options.pw_command_launcher: + extra_args.append('pw_command_launcher="%s"' % self.options.pw_command_launcher) + + if self.options.enable_link_map_file: + extra_args.append('chip_generate_link_map_file=true') + + if self.options.pregen_dir: + extra_args.append('chip_code_pre_generated_directory="%s"' % self.options.pregen_dir) + + extra_args.extend(self.GnBuildArgs() or []) + if extra_args: + cmd += ' --args="%s' % ' '.join(extra_args) + '" ' + + cmd += self.output_dir + + title = 'Generating ' + self.identifier + + self._Execute(['bash', '-c', cmd], title=title) def build_outputs(self): - name = 'chip-%s-%s' % (self.board.Name(), self.app.NameSuffix()) + name = 'chip-%s-%s' % (self.board.Name(self.os_env), self.app.NameSuffix()) if self.os_env == NxpOsUsed.ZEPHYR: yield BuilderOutput( os.path.join(self.output_dir, 'zephyr', 'zephyr.elf'), diff --git a/scripts/build/builders/rw61x.py b/scripts/build/builders/rw61x.py deleted file mode 100644 index 47a6d27b51aaba..00000000000000 --- a/scripts/build/builders/rw61x.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright (c) 2023 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -from enum import Enum, auto - -from .builder import BuilderOutput -from .gn import GnBuilder - - -class RW61XApp(Enum): - ALL_CLUSTERS = auto() - THERMOSTAT = auto() - LAUNDRY_WASHER = auto() - - def ExampleName(self): - if self == RW61XApp.ALL_CLUSTERS: - return 'all-clusters-app' - elif self == RW61XApp.THERMOSTAT: - return 'thermostat' - elif self == RW61XApp.LAUNDRY_WASHER: - return 'laundry-washer-app' - else: - raise Exception('Unknown app type: %r' % self) - - def NameSuffix(self): - if self == RW61XApp.ALL_CLUSTERS: - return '-'.join(['chip', 'rw61x', 'all-cluster-example']) - if self == RW61XApp.THERMOSTAT: - return '-'.join(['chip', 'rw61x', 'thermostat-example']) - if self == RW61XApp.LAUNDRY_WASHER: - return '-'.join(['chip', 'rw61x', 'laundry-washer-example']) - else: - raise Exception('Unknown app type: %r' % self) - - def BuildRoot(self, root): - return os.path.join(root, 'examples', self.ExampleName(), 'nxp', 'rt/rw61x') - - -class RW61XBuilder(GnBuilder): - - def __init__(self, - root, - runner, - app: RW61XApp = RW61XApp.ALL_CLUSTERS, - release: bool = False, - disable_ble: bool = False, - enable_thread: bool = False, - enable_wifi: bool = False, - disable_ipv4: bool = False, - enable_shell: bool = False, - enable_ota: bool = False, - enable_factory_data: bool = False, - is_sdk_package: bool = True, - a2_board_revision: bool = False): - super(RW61XBuilder, self).__init__( - root=app.BuildRoot(root), - runner=runner) - self.app = app - self.release = release - self.disable_ipv4 = disable_ipv4 - self.disable_ble = disable_ble - self.enable_thread = enable_thread - self.enable_wifi = enable_wifi - self.enable_ota = enable_ota - self.enable_factory_data = enable_factory_data - self.enable_shell = enable_shell - self.is_sdk_package = is_sdk_package - self.a2_board_revision = a2_board_revision - - def GnBuildArgs(self): - args = [] - - if self.release: - args.append('is_debug=false') - - if self.enable_ota: - args.append('chip_enable_ota_requestor=true no_mcuboot=false') - - if self.disable_ipv4: - args.append('chip_inet_config_enable_ipv4=false') - - if self.disable_ble: - args.append('chip_enable_ble=false') - - if self.enable_wifi: - args.append('chip_enable_wifi=true') - - if self.enable_thread: - args.append('chip_enable_openthread=true chip_inet_config_enable_ipv4=false') - if self.enable_wifi: - args.append('openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-nxp/openthread-br\"') - - if self.enable_factory_data: - args.append('chip_with_factory_data=1') - - if self.a2_board_revision: - args.append('board_version=\"A2\"') - - if self.enable_shell: - args.append('chip_enable_matter_cli=true') - - if self.is_sdk_package: - args.append('is_sdk_package=true') - - return args - - def generate(self): - super(RW61XBuilder, self).generate() - - def build_outputs(self): - yield BuilderOutput( - os.path.join(self.output_dir, self.app.NameSuffix()), - f'{self.app.NameSuffix()}.elf') - if self.options.enable_link_map_file: - yield BuilderOutput( - os.path.join(self.output_dir, f'{self.app.NameSuffix()}.map'), - f'{self.app.NameSuffix()}.map') diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index d391093a153fcf..5242b85c038a22 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -13,8 +13,7 @@ linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,therm 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] -rw61x-{all-clusters-app,thermostat,laundry-washer}[-ota][-wifi][-thread][-factory-data][-matter-shell] -nxp-{k32w0,k32w1,rw61x}-{zephyr,freertos}-{lighting,contact-sensor,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2] +nxp-{k32w0,k32w1,rw61x}-{zephyr,freertos}-{lighting,contact-sensor,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-thread][-matter-shell] mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug] mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] From 5d1f1d6bd9aa211b5ce42a977f4a4424475556ee Mon Sep 17 00:00:00 2001 From: Chris Letnick Date: Wed, 31 Jul 2024 06:08:19 -0700 Subject: [PATCH 04/40] Initial Test Script for TC_MCORE_FS_1_1 (#34634) * Initial Test Script for FS Top-Level * Resolve linter issues. * Update TC_MCORE_FS_1_1 to be testable * Restyled by autopep8 * Address PR comments * Restyled by isort --------- Co-authored-by: Terence Hampson Co-authored-by: Restyled.io --- src/python_testing/TC_MCORE_FS_1_1.py | 144 ++++++++++++++++ .../test_testing/test_TC_MCORE_FS_1_1.py | 162 ++++++++++++++++++ 2 files changed, 306 insertions(+) create mode 100755 src/python_testing/TC_MCORE_FS_1_1.py create mode 100644 src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py new file mode 100755 index 00000000000000..629dae67fc6d3e --- /dev/null +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -0,0 +1,144 @@ +# +# 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. +# + +# This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: + +import logging +import os +import random +import signal +import subprocess +import time +import uuid + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_MCORE_FS_1_1(MatterBaseTest): + + @async_test_body + async def setup_class(self): + super().setup_class() + # TODO: confirm whether we can open processes like this on the TH + app = self.matter_test_config.user_params.get("th_server_app_path", None) + if not app: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + + self.kvs = f'kvs_{str(uuid.uuid4())}' + self.port = 5543 + discriminator = random.randint(0, 4095) + passcode = 20202021 + app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs}' + cmd = f'{app} {app_args}' + # TODO: Determine if we want these logs cooked or pushed to somewhere else + logging.info("Starting application to acts mock a server portion of TH_FSA") + self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + logging.info("Started application to acts mock a server portion of TH_FSA") + time.sleep(3) + + logging.info("Commissioning from separate fabric") + # Create a second controller on a new fabric to communicate to the server + new_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() + new_fabric_admin = new_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=2) + paa_path = str(self.matter_test_config.paa_trust_store_path) + self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) + self.server_nodeid = 1111 + await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + logging.info("Commissioning TH_SERVER complete") + + def teardown_class(self): + logging.warning("Stopping app with SIGTERM") + self.app_process.send_signal(signal.SIGTERM.value) + self.app_process.wait() + + os.remove(self.kvs) + super().teardown_class() + + def steps_TC_MCORE_FS_1_1(self) -> list[TestStep]: + steps = [TestStep(1, "Enable Fabric Synchronization on DUT_FSA using the manufacturer specified mechanism.", is_commissioning=True), + TestStep(2, "Commission DUT_FSA onto TH_FSA fabric."), + TestStep(3, "Reverse Commision Commission TH_FSAs onto DUT_FSA fabric."), + TestStep("3a", "TH_FSA sends RequestCommissioningApproval"), + TestStep("3b", "TH_FSA sends CommissionNode"), + TestStep("3c", "DUT_FSA commissions TH_FSA")] + return steps + + @async_test_body + async def test_TC_MCORE_FS_1_1(self): + self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') + # TODO this value should either be determined or passed in from command line + dut_commissioning_control_endpoint = 0 + self.step(1) + self.step(2) + self.step(3) + th_fsa_server_fabrics = await self.read_single_attribute_check_success(cluster=Clusters.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.Fabrics, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0) + th_fsa_server_vid = await self.read_single_attribute_check_success(cluster=Clusters.BasicInformation, attribute=Clusters.BasicInformation.Attributes.VendorID, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0) + th_fsa_server_pid = await self.read_single_attribute_check_success(cluster=Clusters.BasicInformation, attribute=Clusters.BasicInformation.Attributes.ProductID, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0) + + event_path = [(dut_commissioning_control_endpoint, Clusters.CommissionerControl.Events.CommissioningRequestResult, 1)] + events = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path) + + self.step("3a") + good_request_id = 0x1234567812345678 + cmd = Clusters.CommissionerControl.Commands.RequestCommissioningApproval( + requestId=good_request_id, vendorId=th_fsa_server_vid, productId=th_fsa_server_pid, label="Test Ecosystem") + await self.send_single_cmd(cmd, endpoint=dut_commissioning_control_endpoint) + + if not self.is_ci: + self.wait_for_use_input("Approve Commissioning approval request on DUT using manufacturer specified mechanism") + + if not events: + new_event = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path) + else: + event_nums = [e.Header.EventNumber for e in events] + new_event = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=event_path, eventNumberFilter=max(event_nums)+1) + + asserts.assert_equal(len(new_event), 1, "Unexpected event list len") + asserts.assert_equal(new_event[0].Data.statusCode, 0, "Unexpected status code") + asserts.assert_equal(new_event[0].Data.clientNodeId, + self.matter_test_config.controller_node_id, "Unexpected client node id") + asserts.assert_equal(new_event[0].Data.requestId, good_request_id, "Unexpected request ID") + + self.step("3b") + cmd = Clusters.CommissionerControl.Commands.CommissionNode(requestId=good_request_id, responseTimeoutSeconds=30) + resp = await self.send_single_cmd(cmd, endpoint=dut_commissioning_control_endpoint) + asserts.assert_equal(type(resp), Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow, + "Incorrect response type") + + # min commissioning timeout is 3*60 seconds, so use that even though the command said 30. + cmd = Clusters.AdministratorCommissioning.Commands.OpenCommissioningWindow(commissioningTimeout=3*60, + PAKEPasscodeVerifier=resp.PAKEPasscodeVerifier, + discriminator=resp.discriminator, + iterations=resp.iterations, salt=resp.salt) + await self.send_single_cmd(cmd, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0, timedRequestTimeoutMs=5000) + + self.step("3c") + if not self.is_ci: + time.sleep(30) + + th_fsa_server_fabrics_new = await self.read_single_attribute_check_success(cluster=Clusters.OperationalCredentials, attribute=Clusters.OperationalCredentials.Attributes.Fabrics, dev_ctrl=self.TH_server_controller, node_id=self.server_nodeid, endpoint=0) + # TODO: this should be mocked too. + if not self.is_ci: + asserts.assert_equal(len(th_fsa_server_fabrics) + 1, len(th_fsa_server_fabrics_new), + "Unexpected number of fabrics on TH_SERVER") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py new file mode 100644 index 00000000000000..ec91db72551523 --- /dev/null +++ b/src/python_testing/test_testing/test_TC_MCORE_FS_1_1.py @@ -0,0 +1,162 @@ +#!/usr/bin/env -S python3 -B +# +# 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. +# + +import base64 +import os +import pathlib +import sys +import typing + +import chip.clusters as Clusters +import click +from chip import ChipDeviceCtrl +from chip.clusters import Attribute +from chip.interaction_model import InteractionModelError, Status +from MockTestRunner import AsyncMock, MockTestRunner + +try: + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit +except ImportError: + sys.path.append(os.path.abspath( + os.path.join(os.path.dirname(__file__), '..'))) + from matter_testing_support import MatterTestConfig, get_default_paa_trust_store, run_tests_no_exit + +invoke_call_count = 0 +event_call_count = 0 + + +def dynamic_invoke_return(*args, **argv): + ''' Returns the response to a mocked SendCommand call. + ''' + global invoke_call_count + invoke_call_count += 1 + + # passcode 20202024 + reverse_open = Clusters.CommissionerControl.Commands.ReverseOpenCommissioningWindow(commissioningTimeout=30, + PAKEPasscodeVerifier=b"+w1qZQR05Zn0bc2LDyNaDAhsrhDS5iRHPTN10+EmNx8E2OpIPC4SjWRDQVOgqcbnXdYMlpiZ168xLBqn1fx9659gGK/7f9Yc6GxpoJH8kwAUYAYyLGsYeEBt1kL6kpXjgA==", + discriminator=2222, iterations=10000, salt=base64.b64encode(bytes('SaltyMcSalterson', 'utf-8'))) + + print(f'invoke call {invoke_call_count}') + if invoke_call_count == 1: # Commission node with no prior request, return failure - step 5 + return None + elif invoke_call_count == 2: # Commission node over pase - return unsupported access - step 7 + return reverse_open + else: + raise InteractionModelError(Status.Failure) + + +def dynamic_event_return(*args, **argv): + ''' Returns the response to a mocked ReadEvent call. + ''' + global event_call_count + event_call_count += 1 + + if event_call_count == 1: # reading events, start empty - no events + return [] + elif event_call_count == 2: # read event with filter - expect empty + header = Attribute.EventHeader(EndpointId=0, ClusterId=Clusters.CommissionerControl.id, + EventId=Clusters.CommissionerControl.Events.CommissioningRequestResult.event_id, EventNumber=1) + data = Clusters.CommissionerControl.Events.CommissioningRequestResult( + requestId=0x1234567812345678, clientNodeId=112233, statusCode=0) + result = Attribute.EventReadResult(Header=header, Status=Status.Success, Data=data) + return [result] + else: + raise InteractionModelError(Status.Failure) + + +def wildcard() -> Attribute.AsyncReadTransaction.ReadResponse: + ''' Returns the response to a wildcard read. + For this test, we just need descriptors and a few attributes + Tree + EP1 (Aggregator): Descriptor + - EP2 (Bridged Node): Descriptor, Bridged Device Basic Information, Ecosystem Information + ''' + cc = Clusters.CommissionerControl + ei = Clusters.EcosystemInformation + desc = Clusters.Descriptor + bdbi = Clusters.BridgedDeviceBasicInformation + + # EP1 is aggregator device type with a commissioner control cluster + # children - EP2 type bridged node endpoint, ecosystem information, bridged device basic information. Should also have and admin commissioning, but I don't need it for this test. + desc_ep1 = {desc.Attributes.PartsList: [2], desc.Attributes.ServerList: [ + cc.id], desc.Attributes.DeviceTypeList: [desc.Structs.DeviceTypeStruct(deviceType=0x000E, revision=2)]} + desc_ep2 = {desc.Attributes.ServerList: [bdbi.id, ei.id], desc.Attributes.DeviceTypeList: [ + desc.Structs.DeviceTypeStruct(deviceType=0x0013, revision=3)]} + + # I'm not filling anything in here, because I don't care. I just care that the cluster exists. + ei_attrs = {ei.Attributes.AttributeList: [ei.Attributes.DeviceDirectory.attribute_id, + ei.Attributes.LocationDirectory.attribute_id], ei.Attributes.DeviceDirectory: [], ei.Attributes.LocationDirectory: []} + + # This cluster just needs to exist, so I'm just going to throw on the mandatory items for now. + bdbi_attrs = {bdbi.Attributes.AttributeList: [bdbi.Attributes.Reachable.attribute_id, + bdbi.Attributes.UniqueID.attribute_id], bdbi.Attributes.Reachable: True, bdbi.Attributes.UniqueID: 'something'} + + cc_attrs = {cc.Attributes.AttributeList: [cc.Attributes.SupportedDeviceCategories], cc.Attributes.AcceptedCommandList: [cc.Commands.RequestCommissioningApproval, cc.Commands.CommissionNode], + cc.Attributes.GeneratedCommandList: [cc.Commands.RequestCommissioningApproval], cc.Attributes.SupportedDeviceCategories: 1} + + resp = Attribute.AsyncReadTransaction.ReadResponse({}, [], {}) + resp.attributes = {1: {desc: desc_ep1, cc: cc_attrs}, 2: {desc: desc_ep2, ei: ei_attrs, bdbi: bdbi_attrs}} + return resp + + +class MyMock(MockTestRunner): + def run_test_with_mock(self, dynamic_invoke_return: typing.Callable, dynamic_event_return: typing.Callable, read_cache: Attribute.AsyncReadTransaction.ReadResponse, hooks=None): + ''' Run the test using the Mocked versions of Read, SendCommand, OpenCommissioningWindow, FindOrEstablishPASESession and ReadEvent + dynamic_invoke_return: Callable function that returns the result of a SendCommand call + Function should return one of + - command response for commands with responses + - None for commands with success results + - raise InteractionModelError for error results + dynamic_event_return: Callable function that returns the result of a ReadEvent call + Function should return one of + - list of EventReadResult for successful reads + - raise InteractionModelError for error results + read_cache : Response to a Read call. For this test, this will be the wildcard read of all teh attributes + hooks : Test harness hook object if desired. + ''' + self.default_controller.Read = AsyncMock(return_value=read_cache) + self.default_controller.SendCommand = AsyncMock(return_value=None, side_effect=dynamic_invoke_return) + # It doesn't actually matter what we return here because I'm going to catch the next pase session connection anyway + params = ChipDeviceCtrl.CommissioningParameters(setupPinCode=0, setupManualCode='', setupQRCode='') + self.default_controller.OpenCommissioningWindow = AsyncMock(return_value=params) + self.default_controller.FindOrEstablishPASESession = AsyncMock(return_value=None) + self.default_controller.ReadEvent = AsyncMock(return_value=[], side_effect=dynamic_event_return) + + return run_tests_no_exit(self.test_class, self.config, hooks, self.default_controller, self.stack) + + +@click.command() +@click.argument('th_server_app', type=click.Path(exists=True)) +def main(th_server_app: str): + root = os.path.abspath(os.path.join(pathlib.Path(__file__).resolve().parent, '..', '..', '..')) + print(f'root = {root}') + paa_path = get_default_paa_trust_store(root) + print(f'paa = {paa_path}') + + pics = {"PICS_SDK_CI_ONLY": True} + test_runner = MyMock('TC_MCORE_FS_1_1', 'TC_MCORE_FS_1_1', 'test_TC_MCORE_FS_1_1', 1, paa_trust_store_path=paa_path, pics=pics) + config = MatterTestConfig() + config.user_params = {'th_server_app_path': th_server_app} + test_runner.set_test_config(config) + + test_runner.run_test_with_mock(dynamic_invoke_return, dynamic_event_return, wildcard()) + test_runner.Shutdown() + + +if __name__ == "__main__": + sys.exit(main()) From 7b2adc68c9daae4541d06c16f4d3213b3bbc2bbe Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 31 Jul 2024 09:59:43 -0400 Subject: [PATCH 05/40] API renames: `chip::app::InteractionModel::*` becomes `chip::app::DataModel` and renamed `DataModel` to `Provider` (#34520) * Massive file name renames. No namespace renames yet * Restyle * Fix missed rename * more renames * Set of renames * Some final renames. Unit tests compile and pass * Restyle * Also rename the IME data model setter/getter * member renames * Slight rename * Restyle * Fix lint --------- Co-authored-by: Andrei Litvin --- .github/workflows/lint.yml | 4 +- src/BUILD.gn | 6 +- .../AttributePathExpandIterator-Checked.cpp | 2 +- src/app/AttributePathExpandIterator-Checked.h | 3 +- .../AttributePathExpandIterator-DataModel.cpp | 22 +-- .../AttributePathExpandIterator-DataModel.h | 9 +- src/app/AttributePathExpandIterator-Ember.cpp | 2 +- src/app/AttributePathExpandIterator-Ember.h | 4 +- src/app/BUILD.gn | 12 +- src/app/InteractionModelEngine.cpp | 18 +-- src/app/InteractionModelEngine.h | 10 +- src/app/ReadHandler.cpp | 6 +- src/app/ReadHandler.h | 4 +- ...bscriptionResumptionSessionEstablisher.cpp | 4 +- src/app/chip_data_model.cmake | 2 +- src/app/chip_data_model.gni | 2 +- .../BUILD.gn | 8 +- .../CodegenDataModelProvider.cpp} | 134 +++++++++--------- .../CodegenDataModelProvider.h} | 30 ++-- .../CodegenDataModelProvider_Read.cpp} | 8 +- .../CodegenDataModelProvider_Write.cpp} | 19 ++- .../EmberMetadata.cpp | 2 +- .../EmberMetadata.h | 0 .../Instance.cpp | 8 +- .../Instance.h | 4 +- .../model.cmake | 8 +- .../model.gni | 18 +-- .../tests/AttributeReportIBEncodeDecode.cpp | 0 .../tests/AttributeReportIBEncodeDecode.h | 0 .../tests/BUILD.gn | 4 +- .../tests/EmberInvokeOverride.cpp | 0 .../tests/EmberInvokeOverride.h | 0 .../tests/EmberReadWriteOverride.cpp | 0 .../tests/EmberReadWriteOverride.h | 0 .../InteractionModelTemporaryOverrides.cpp | 0 .../tests/TestCodegenModelViaMocks.cpp | 134 +++++++++--------- .../ActionContext.h | 4 +- .../BUILD.gn | 6 +- .../Context.h | 12 +- .../EventsGenerator.h | 4 +- .../MetadataTypes.cpp | 6 +- .../MetadataTypes.h | 8 +- .../OperationTypes.h | 4 +- .../Provider.h} | 14 +- .../ProviderChangeListener.h} | 8 +- .../tests/BUILD.gn | 2 +- .../tests/TestEventEmitting.cpp | 4 +- src/app/reporting/Engine.cpp | 2 +- src/app/reporting/Read-Checked.cpp | 2 +- src/app/reporting/Read-Checked.h | 4 +- src/app/reporting/Read-DataModel.cpp | 10 +- src/app/reporting/Read-DataModel.h | 4 +- src/app/reporting/Read-Ember.cpp | 2 +- src/app/reporting/Read-Ember.h | 4 +- src/app/tests/BUILD.gn | 2 +- src/app/tests/TestAclAttribute.cpp | 6 +- .../tests/TestAttributePathExpandIterator.cpp | 16 +-- src/app/tests/TestInteractionModelEngine.cpp | 22 +-- src/app/tests/TestReadInteraction.cpp | 24 ++-- src/app/tests/TestReportScheduler.cpp | 20 +-- src/app/tests/TestReportingEngine.cpp | 10 +- src/app/tests/test-interaction-model-api.cpp | 30 ++-- src/app/tests/test-interaction-model-api.h | 28 ++-- src/app/util/mock/BUILD.gn | 2 +- src/controller/tests/data_model/BUILD.gn | 2 +- .../tests/data_model/DataModelFixtures.cpp | 30 ++-- .../tests/data_model/DataModelFixtures.h | 28 ++-- src/controller/tests/data_model/TestRead.cpp | 12 +- 68 files changed, 407 insertions(+), 412 deletions(-) rename src/app/{codegen-data-model => codegen-data-model-provider}/BUILD.gn (92%) rename src/app/{codegen-data-model/CodegenDataModel.cpp => codegen-data-model-provider/CodegenDataModelProvider.cpp} (70%) rename src/app/{codegen-data-model/CodegenDataModel.h => codegen-data-model-provider/CodegenDataModelProvider.h} (75%) rename src/app/{codegen-data-model/CodegenDataModel_Read.cpp => codegen-data-model-provider/CodegenDataModelProvider_Read.cpp} (97%) rename src/app/{codegen-data-model/CodegenDataModel_Write.cpp => codegen-data-model-provider/CodegenDataModelProvider_Write.cpp} (96%) rename src/app/{codegen-data-model => codegen-data-model-provider}/EmberMetadata.cpp (98%) rename src/app/{codegen-data-model => codegen-data-model-provider}/EmberMetadata.h (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/Instance.cpp (76%) rename src/app/{codegen-data-model => codegen-data-model-provider}/Instance.h (87%) rename src/app/{codegen-data-model => codegen-data-model-provider}/model.cmake (81%) rename src/app/{codegen-data-model => codegen-data-model-provider}/model.gni (66%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/AttributeReportIBEncodeDecode.cpp (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/AttributeReportIBEncodeDecode.h (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/BUILD.gn (94%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/EmberInvokeOverride.cpp (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/EmberInvokeOverride.h (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/EmberReadWriteOverride.cpp (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/EmberReadWriteOverride.h (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/InteractionModelTemporaryOverrides.cpp (100%) rename src/app/{codegen-data-model => codegen-data-model-provider}/tests/TestCodegenModelViaMocks.cpp (96%) rename src/app/{data-model-interface => data-model-provider}/ActionContext.h (95%) rename src/app/{data-model-interface => data-model-provider}/BUILD.gn (93%) rename src/app/{data-model-interface => data-model-provider}/Context.h (80%) rename src/app/{data-model-interface => data-model-provider}/EventsGenerator.h (98%) rename src/app/{data-model-interface => data-model-provider}/MetadataTypes.cpp (92%) rename src/app/{data-model-interface => data-model-provider}/MetadataTypes.h (97%) rename src/app/{data-model-interface => data-model-provider}/OperationTypes.h (98%) rename src/app/{data-model-interface/DataModel.h => data-model-provider/Provider.h} (94%) rename src/app/{data-model-interface/DataModelChangeListener.h => data-model-provider/ProviderChangeListener.h} (90%) rename src/app/{data-model-interface => data-model-provider}/tests/BUILD.gn (94%) rename src/app/{data-model-interface => data-model-provider}/tests/TestEventEmitting.cpp (98%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 98dd81edceca88..6694decc421372 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -290,8 +290,8 @@ jobs: git grep -I -n 'emberAfWriteAttribute' -- './*' \ ':(exclude).github/workflows/lint.yml' \ ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' \ - ':(exclude)src/app/codegen-data-model/CodegenDataModel_Write.cpp' \ - ':(exclude)src/app/codegen-data-model/tests/EmberReadWriteOverride.cpp' \ + ':(exclude)src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp' \ + ':(exclude)src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp' \ ':(exclude)src/app/util/attribute-table.cpp' \ ':(exclude)src/app/util/attribute-table.h' \ ':(exclude)src/app/util/ember-compatibility-functions.cpp' \ diff --git a/src/BUILD.gn b/src/BUILD.gn index c162a61f0620fa..e70025151c852b 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -52,7 +52,7 @@ if (chip_build_tests) { tests = [ "${chip_root}/src/app/data-model/tests", "${chip_root}/src/app/cluster-building-blocks/tests", - "${chip_root}/src/app/data-model-interface/tests", + "${chip_root}/src/app/data-model-provider/tests", "${chip_root}/src/access/tests", "${chip_root}/src/crypto/tests", "${chip_root}/src/inet/tests", @@ -87,11 +87,11 @@ if (chip_build_tests) { # are split, we can re-visit this (and likely many others) # # In particular: - # "app/codegen-data-model/tests" contains symbols for ember mocks which + # "app/codegen-data-model-provider/tests" contains symbols for ember mocks which # are used by other tests tests += [ - "${chip_root}/src/app/codegen-data-model/tests", + "${chip_root}/src/app/codegen-data-model-provider/tests", "${chip_root}/src/setup_payload/tests", "${chip_root}/src/transport/raw/tests", ] diff --git a/src/app/AttributePathExpandIterator-Checked.cpp b/src/app/AttributePathExpandIterator-Checked.cpp index 3d0d660edcf1eb..119eb29d5b22f4 100644 --- a/src/app/AttributePathExpandIterator-Checked.cpp +++ b/src/app/AttributePathExpandIterator-Checked.cpp @@ -20,7 +20,7 @@ namespace chip { namespace app { -AttributePathExpandIteratorChecked::AttributePathExpandIteratorChecked(InteractionModel::DataModel * dataModel, +AttributePathExpandIteratorChecked::AttributePathExpandIteratorChecked(DataModel::Provider * dataModel, SingleLinkedListNode * attributePath) : mDataModelIterator(dataModel, attributePath), mEmberIterator(dataModel, attributePath) diff --git a/src/app/AttributePathExpandIterator-Checked.h b/src/app/AttributePathExpandIterator-Checked.h index e1611b3288ee18..efbe99ef6faade 100644 --- a/src/app/AttributePathExpandIterator-Checked.h +++ b/src/app/AttributePathExpandIterator-Checked.h @@ -26,8 +26,7 @@ namespace app { class AttributePathExpandIteratorChecked { public: - AttributePathExpandIteratorChecked(InteractionModel::DataModel * dataModel, - SingleLinkedListNode * attributePath); + AttributePathExpandIteratorChecked(DataModel::Provider * dataModel, SingleLinkedListNode * attributePath); bool Next(); bool Get(ConcreteAttributePath & aPath); diff --git a/src/app/AttributePathExpandIterator-DataModel.cpp b/src/app/AttributePathExpandIterator-DataModel.cpp index 92af8b50ca6730..01facee22ebe43 100644 --- a/src/app/AttributePathExpandIterator-DataModel.cpp +++ b/src/app/AttributePathExpandIterator-DataModel.cpp @@ -18,14 +18,14 @@ #include #include -using namespace chip::app::InteractionModel; +using namespace chip::app::DataModel; namespace chip { namespace app { AttributePathExpandIteratorDataModel::AttributePathExpandIteratorDataModel( - InteractionModel::DataModel * dataModel, SingleLinkedListNode * attributePath) : - mDataModel(dataModel), + DataModel::Provider * provider, SingleLinkedListNode * attributePath) : + mDataModelProvider(provider), mpAttributePath(attributePath), mOutputPath(kInvalidEndpointId, kInvalidClusterId, kInvalidAttributeId) { @@ -52,7 +52,7 @@ bool AttributePathExpandIteratorDataModel::IsValidAttributeId(AttributeId attrib } const ConcreteAttributePath attributePath(mOutputPath.mEndpointId, mOutputPath.mClusterId, attributeId); - return mDataModel->GetAttributeInfo(attributePath).has_value(); + return mDataModelProvider->GetAttributeInfo(attributePath).has_value(); } std::optional AttributePathExpandIteratorDataModel::NextAttributeId() @@ -61,7 +61,7 @@ std::optional AttributePathExpandIteratorDataModel::NextAttributeId { if (mpAttributePath->mValue.HasWildcardAttributeId()) { - AttributeEntry entry = mDataModel->FirstAttribute(mOutputPath); + AttributeEntry entry = mDataModelProvider->FirstAttribute(mOutputPath); return entry.IsValid() // ? entry.path.mAttributeId // : Clusters::Globals::Attributes::GeneratedCommandList::Id; // @@ -99,7 +99,7 @@ std::optional AttributePathExpandIteratorDataModel::NextAttributeId return std::nullopt; } - AttributeEntry entry = mDataModel->NextAttribute(mOutputPath); + AttributeEntry entry = mDataModelProvider->NextAttribute(mOutputPath); if (entry.IsValid()) { return entry.path.mAttributeId; @@ -117,13 +117,13 @@ std::optional AttributePathExpandIteratorDataModel::NextClusterId() { if (mpAttributePath->mValue.HasWildcardClusterId()) { - ClusterEntry entry = mDataModel->FirstCluster(mOutputPath.mEndpointId); + ClusterEntry entry = mDataModelProvider->FirstCluster(mOutputPath.mEndpointId); return entry.IsValid() ? std::make_optional(entry.path.mClusterId) : std::nullopt; } // only return a cluster if it is valid const ConcreteClusterPath clusterPath(mOutputPath.mEndpointId, mpAttributePath->mValue.mClusterId); - if (!mDataModel->GetClusterInfo(clusterPath).has_value()) + if (!mDataModelProvider->GetClusterInfo(clusterPath).has_value()) { return std::nullopt; } @@ -133,7 +133,7 @@ std::optional AttributePathExpandIteratorDataModel::NextClusterId() VerifyOrReturnValue(mpAttributePath->mValue.HasWildcardClusterId(), std::nullopt); - ClusterEntry entry = mDataModel->NextCluster(mOutputPath); + ClusterEntry entry = mDataModelProvider->NextCluster(mOutputPath); return entry.IsValid() ? std::make_optional(entry.path.mClusterId) : std::nullopt; } @@ -143,7 +143,7 @@ std::optional AttributePathExpandIteratorDataModel::NextEndpointId() { if (mpAttributePath->mValue.HasWildcardEndpointId()) { - EndpointId id = mDataModel->FirstEndpoint(); + EndpointId id = mDataModelProvider->FirstEndpoint(); return (id != kInvalidEndpointId) ? std::make_optional(id) : std::nullopt; } @@ -152,7 +152,7 @@ std::optional AttributePathExpandIteratorDataModel::NextEndpointId() VerifyOrReturnValue(mpAttributePath->mValue.HasWildcardEndpointId(), std::nullopt); - EndpointId id = mDataModel->NextEndpoint(mOutputPath.mEndpointId); + EndpointId id = mDataModelProvider->NextEndpoint(mOutputPath.mEndpointId); return (id != kInvalidEndpointId) ? std::make_optional(id) : std::nullopt; } diff --git a/src/app/AttributePathExpandIterator-DataModel.h b/src/app/AttributePathExpandIterator-DataModel.h index 546151c7dd2806..c8baca768b4602 100644 --- a/src/app/AttributePathExpandIterator-DataModel.h +++ b/src/app/AttributePathExpandIterator-DataModel.h @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace chip { @@ -53,8 +53,7 @@ namespace app { class AttributePathExpandIteratorDataModel { public: - AttributePathExpandIteratorDataModel(InteractionModel::DataModel * dataModel, - SingleLinkedListNode * attributePath); + AttributePathExpandIteratorDataModel(DataModel::Provider * provider, SingleLinkedListNode * attributePath); /** * Proceed the iterator to the next attribute path in the given cluster info. @@ -85,11 +84,11 @@ class AttributePathExpandIteratorDataModel /** Start iterating over the given `paths` */ inline void ResetTo(SingleLinkedListNode * paths) { - *this = AttributePathExpandIteratorDataModel(mDataModel, paths); + *this = AttributePathExpandIteratorDataModel(mDataModelProvider, paths); } private: - InteractionModel::DataModel * mDataModel; + DataModel::Provider * mDataModelProvider; SingleLinkedListNode * mpAttributePath; ConcreteAttributePath mOutputPath; diff --git a/src/app/AttributePathExpandIterator-Ember.cpp b/src/app/AttributePathExpandIterator-Ember.cpp index abaa621cb736ca..1149f0c7026918 100644 --- a/src/app/AttributePathExpandIterator-Ember.cpp +++ b/src/app/AttributePathExpandIterator-Ember.cpp @@ -53,7 +53,7 @@ extern bool emberAfEndpointIndexIsEnabled(uint16_t index); namespace chip { namespace app { -AttributePathExpandIteratorEmber::AttributePathExpandIteratorEmber(InteractionModel::DataModel *, +AttributePathExpandIteratorEmber::AttributePathExpandIteratorEmber(DataModel::Provider *, SingleLinkedListNode * aAttributePath) : mpAttributePath(aAttributePath) { diff --git a/src/app/AttributePathExpandIterator-Ember.h b/src/app/AttributePathExpandIterator-Ember.h index ef359fc21b60fa..c7c112d689064b 100644 --- a/src/app/AttributePathExpandIterator-Ember.h +++ b/src/app/AttributePathExpandIterator-Ember.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ namespace app { class AttributePathExpandIteratorEmber { public: - AttributePathExpandIteratorEmber(InteractionModel::DataModel *, // datamodel is NOT used by this class + AttributePathExpandIteratorEmber(DataModel::Provider *, // datamodel is NOT used by this class SingleLinkedListNode * aAttributePath); /** diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index 8e6ca6dadc569b..53dd3876c12410 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -234,8 +234,8 @@ static_library("interaction-model") { ":paths", ":subscription-info-provider", "${chip_root}/src/app/MessageDef", - "${chip_root}/src/app/codegen-data-model:instance-header", - "${chip_root}/src/app/data-model-interface", + "${chip_root}/src/app/codegen-data-model-provider:instance-header", + "${chip_root}/src/app/data-model-provider", "${chip_root}/src/app/icd/server:icd-server-config", "${chip_root}/src/app/icd/server:manager", "${chip_root}/src/app/icd/server:observer", @@ -265,13 +265,13 @@ static_library("interaction-model") { "reporting/Read-Ember.cpp", "reporting/Read-Ember.h", ] - public_deps += [ "${chip_root}/src/app/data-model-interface" ] + public_deps += [ "${chip_root}/src/app/data-model-provider" ] } else { # enabled sources += [ "reporting/Read-DataModel.cpp", "reporting/Read-DataModel.h", ] - public_deps += [ "${chip_root}/src/app/data-model-interface" ] + public_deps += [ "${chip_root}/src/app/data-model-provider" ] } if (chip_enable_read_client) { @@ -491,14 +491,14 @@ static_library("app") { "AttributePathExpandIterator-Ember.h", "AttributePathExpandIterator.h", ] - public_deps += [ "${chip_root}/src/app/data-model-interface" ] + public_deps += [ "${chip_root}/src/app/data-model-provider" ] } else { # enabled sources += [ "AttributePathExpandIterator-DataModel.cpp", "AttributePathExpandIterator-DataModel.h", "AttributePathExpandIterator.h", ] - public_deps += [ "${chip_root}/src/app/data-model-interface" ] + public_deps += [ "${chip_root}/src/app/data-model-provider" ] } if (chip_enable_read_client) { diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index dcdbd3f10d2f85..639b590a16b345 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -43,7 +43,7 @@ #include #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE -#include +#include #endif namespace chip { @@ -485,7 +485,7 @@ CHIP_ERROR InteractionModelEngine::ParseAttributePaths(const Access::SubjectDesc if (paramsList.mValue.IsWildcardPath()) { - AttributePathExpandIterator pathIterator(GetDataModel(), ¶msList); + AttributePathExpandIterator pathIterator(GetDataModelProvider(), ¶msList); ConcreteAttributePath readPath; // The definition of "valid path" is "path exists and ACL allows access". The "path exists" part is handled by @@ -849,7 +849,7 @@ Protocols::InteractionModel::Status InteractionModelEngine::OnReadInitialRequest // We have already reserved enough resources for read requests, and have granted enough resources for current subscriptions, so // we should be able to allocate resources requested by this request. ReadHandler * handler = - mReadHandlers.CreateObject(*this, apExchangeContext, aInteractionType, mReportScheduler, GetDataModel()); + mReadHandlers.CreateObject(*this, apExchangeContext, aInteractionType, mReportScheduler, GetDataModelProvider()); if (handler == nullptr) { ChipLogProgress(InteractionModel, "no resource for %s interaction", @@ -1706,23 +1706,23 @@ Protocols::InteractionModel::Status InteractionModelEngine::CommandExists(const return ServerClusterCommandExists(aCommandPath); } -InteractionModel::DataModel * InteractionModelEngine::SetDataModel(InteractionModel::DataModel * model) +DataModel::Provider * InteractionModelEngine::SetDataModelProvider(DataModel::Provider * model) { // Alternting data model should not be done while IM is actively handling requests. VerifyOrDie(mReadHandlers.begin() == mReadHandlers.end()); - InteractionModel::DataModel * oldModel = GetDataModel(); - mDataModel = model; + DataModel::Provider * oldModel = GetDataModelProvider(); + mDataModelProvider = model; return oldModel; } -InteractionModel::DataModel * InteractionModelEngine::GetDataModel() const +DataModel::Provider * InteractionModelEngine::GetDataModelProvider() const { #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE // TODO: this should be temporary, we should fully inject the data model - VerifyOrReturnValue(mDataModel != nullptr, CodegenDataModelInstance()); + VerifyOrReturnValue(mDataModelProvider != nullptr, CodegenDataModelProviderInstance()); #endif - return mDataModel; + return mDataModelProvider; } void InteractionModelEngine::OnTimedInteractionFailed(TimedHandler * apTimedHandler) diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index 9d420f7f654176..c371bad23b2d2c 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include @@ -402,14 +402,14 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, } #endif - InteractionModel::DataModel * GetDataModel() const; + DataModel::Provider * GetDataModelProvider() const; // MUST NOT be used while the interaction model engine is running as interaction // model functionality (e.g. active reads/writes/subscriptions) rely on data model // state // - // Returns the old data model value. - InteractionModel::DataModel * SetDataModel(InteractionModel::DataModel * model); + // Returns the old data model provider value. + DataModel::Provider * SetDataModelProvider(DataModel::Provider * model); private: friend class reporting::Engine; @@ -698,7 +698,7 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, SubscriptionResumptionStorage * mpSubscriptionResumptionStorage = nullptr; - InteractionModel::DataModel * mDataModel = nullptr; + DataModel::Provider * mDataModelProvider = nullptr; }; } // namespace app diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 3e182bb9428a5f..43dae0a99f9c64 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -22,13 +22,13 @@ * */ -#include "data-model-interface/DataModel.h" #include #include #include #include #include #include +#include #include #include #include @@ -54,7 +54,7 @@ uint16_t ReadHandler::GetPublisherSelectedIntervalLimit() } ReadHandler::ReadHandler(ManagementCallback & apCallback, Messaging::ExchangeContext * apExchangeContext, - InteractionType aInteractionType, Observer * observer, InteractionModel::DataModel * apDataModel) : + InteractionType aInteractionType, Observer * observer, DataModel::Provider * apDataModel) : mAttributePathExpandIterator(apDataModel, nullptr), mExchangeCtx(*this), mManagementCallback(apCallback) { @@ -80,7 +80,7 @@ ReadHandler::ReadHandler(ManagementCallback & apCallback, Messaging::ExchangeCon } #if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS -ReadHandler::ReadHandler(ManagementCallback & apCallback, Observer * observer, InteractionModel::DataModel * apDataModel) : +ReadHandler::ReadHandler(ManagementCallback & apCallback, Observer * observer, DataModel::Provider * apDataModel) : mAttributePathExpandIterator(apDataModel, nullptr), mExchangeCtx(*this), mManagementCallback(apCallback) { mInteractionType = InteractionType::Subscribe; diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index 0f6b3fada87572..1ddcb4ebf0abb1 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -212,7 +212,7 @@ class ReadHandler : public Messaging::ExchangeDelegate * */ ReadHandler(ManagementCallback & apCallback, Messaging::ExchangeContext * apExchangeContext, InteractionType aInteractionType, - Observer * observer, InteractionModel::DataModel * apDataModel); + Observer * observer, DataModel::Provider * apDataModel); #if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS /** @@ -222,7 +222,7 @@ class ReadHandler : public Messaging::ExchangeDelegate * The callback passed in has to outlive this handler object. * */ - ReadHandler(ManagementCallback & apCallback, Observer * observer, InteractionModel::DataModel * apDataModel); + ReadHandler(ManagementCallback & apCallback, Observer * observer, DataModel::Provider * apDataModel); #endif const SingleLinkedListNode * GetAttributePathList() const { return mpAttributePathList; } diff --git a/src/app/SubscriptionResumptionSessionEstablisher.cpp b/src/app/SubscriptionResumptionSessionEstablisher.cpp index 11da3c3d496f92..e6f1ba02172631 100644 --- a/src/app/SubscriptionResumptionSessionEstablisher.cpp +++ b/src/app/SubscriptionResumptionSessionEstablisher.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include namespace chip { namespace app { @@ -105,7 +105,7 @@ void SubscriptionResumptionSessionEstablisher::HandleDeviceConnected(void * cont return; } ReadHandler * readHandler = - imEngine->mReadHandlers.CreateObject(*imEngine, imEngine->GetReportScheduler(), imEngine->GetDataModel()); + imEngine->mReadHandlers.CreateObject(*imEngine, imEngine->GetReportScheduler(), imEngine->GetDataModelProvider()); if (readHandler == nullptr) { // TODO - Should we keep the subscription here? diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index eac3b492c0eeff..499bf100256546 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -17,7 +17,7 @@ set(CHIP_APP_BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) include("${CHIP_ROOT}/build/chip/chip_codegen.cmake") -include("${CHIP_ROOT}/src/app/codegen-data-model/model.cmake") +include("${CHIP_ROOT}/src/app/codegen-data-model-provider/model.cmake") # Configure ${APP_TARGET} with source files associated with ${CLUSTER} cluster # diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index ce65fe42331acb..3e4448a3bee467 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -15,7 +15,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") import("${chip_root}/build/chip/chip_codegen.gni") -import("${chip_root}/src/app/codegen-data-model/model.gni") +import("${chip_root}/src/app/codegen-data-model-provider/model.gni") import("${chip_root}/src/app/common_flags.gni") import("${chip_root}/src/platform/python.gni") diff --git a/src/app/codegen-data-model/BUILD.gn b/src/app/codegen-data-model-provider/BUILD.gn similarity index 92% rename from src/app/codegen-data-model/BUILD.gn rename to src/app/codegen-data-model-provider/BUILD.gn index 955f76c091c0bd..e88335b31044c5 100644 --- a/src/app/codegen-data-model/BUILD.gn +++ b/src/app/codegen-data-model-provider/BUILD.gn @@ -20,10 +20,10 @@ import("//build_overrides/chip.gni") # be available at link time for this model to use # # Use `model.gni` to get access to: -# CodegenDataModel.cpp -# CodegenDataModel.h -# CodegenDataModel_Read.cpp -# CodegenDataModel_Write.cpp +# CodegenDataModelProvider.cpp +# CodegenDataModelProvider.h +# CodegenDataModelProvider_Read.cpp +# CodegenDataModelProvider_Write.cpp # EmberMetadata.cpp # EmberMetadata.h # Instance.cpp diff --git a/src/app/codegen-data-model/CodegenDataModel.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp similarity index 70% rename from src/app/codegen-data-model/CodegenDataModel.cpp rename to src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp index 851f7c341ab127..e3b9823efeef9a 100644 --- a/src/app/codegen-data-model/CodegenDataModel.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include #include #include @@ -31,8 +31,7 @@ namespace app { namespace { /// Load the cluster information into the specified destination -std::variant LoadClusterInfo(const ConcreteClusterPath & path, - const EmberAfCluster & cluster) +std::variant LoadClusterInfo(const ConcreteClusterPath & path, const EmberAfCluster & cluster) { DataVersion * versionPtr = emberAfDataVersionStorage(path); if (versionPtr == nullptr) @@ -42,7 +41,7 @@ std::variant LoadClusterInfo(const Co return CHIP_ERROR_NOT_FOUND; } - InteractionModel::ClusterInfo info(*versionPtr); + DataModel::ClusterInfo info(*versionPtr); // TODO: set entry flags: // info->flags.Set(ClusterQualityFlags::kDiagnosticsData) @@ -51,7 +50,7 @@ std::variant LoadClusterInfo(const Co } /// Converts a EmberAfCluster into a ClusterEntry -std::variant ClusterEntryFrom(EndpointId endpointId, const EmberAfCluster & cluster) +std::variant ClusterEntryFrom(EndpointId endpointId, const EmberAfCluster & cluster) { ConcreteClusterPath clusterPath(endpointId, cluster.clusterId); auto info = LoadClusterInfo(clusterPath, cluster); @@ -61,9 +60,9 @@ std::variant ClusterEntryFrom(Endpoi return *err; } - if (InteractionModel::ClusterInfo * infoValue = std::get_if(&info)) + if (DataModel::ClusterInfo * infoValue = std::get_if(&info)) { - return InteractionModel::ClusterEntry{ + return DataModel::ClusterEntry{ .path = clusterPath, .info = *infoValue, }; @@ -74,8 +73,8 @@ std::variant ClusterEntryFrom(Endpoi /// Finds the first server cluster entry for the given endpoint data starting at [start_index] /// /// Returns an invalid entry if no more server clusters are found -InteractionModel::ClusterEntry FirstServerClusterEntry(EndpointId endpointId, const EmberAfEndpointType * endpoint, - unsigned start_index, unsigned & found_index) +DataModel::ClusterEntry FirstServerClusterEntry(EndpointId endpointId, const EmberAfEndpointType * endpoint, unsigned start_index, + unsigned & found_index) { for (unsigned cluster_idx = start_index; cluster_idx < endpoint->clusterCount; cluster_idx++) { @@ -88,7 +87,7 @@ InteractionModel::ClusterEntry FirstServerClusterEntry(EndpointId endpointId, co found_index = cluster_idx; auto entry = ClusterEntryFrom(endpointId, cluster); - if (InteractionModel::ClusterEntry * entryValue = std::get_if(&entry)) + if (DataModel::ClusterEntry * entryValue = std::get_if(&entry)) { return *entryValue; } @@ -106,14 +105,14 @@ InteractionModel::ClusterEntry FirstServerClusterEntry(EndpointId endpointId, co #endif } - return InteractionModel::ClusterEntry::kInvalid; + return DataModel::ClusterEntry::kInvalid; } /// Load the attribute information into the specified destination /// /// `info` is assumed to be default-constructed/clear (i.e. this sets flags, but does not reset them). void LoadAttributeInfo(const ConcreteAttributePath & path, const EmberAfAttributeMetadata & attribute, - InteractionModel::AttributeInfo * info) + DataModel::AttributeInfo * info) { info->readPrivilege = RequiredPrivilege::ForReadAttribute(path); if (!attribute.IsReadOnly()) @@ -121,8 +120,8 @@ void LoadAttributeInfo(const ConcreteAttributePath & path, const EmberAfAttribut info->writePrivilege = RequiredPrivilege::ForWriteAttribute(path); } - info->flags.Set(InteractionModel::AttributeQualityFlags::kListAttribute, (attribute.attributeType == ZCL_ARRAY_ATTRIBUTE_TYPE)); - info->flags.Set(InteractionModel::AttributeQualityFlags::kTimed, attribute.MustUseTimedWrite()); + info->flags.Set(DataModel::AttributeQualityFlags::kListAttribute, (attribute.attributeType == ZCL_ARRAY_ATTRIBUTE_TYPE)); + info->flags.Set(DataModel::AttributeQualityFlags::kTimed, attribute.MustUseTimedWrite()); // NOTE: we do NOT provide additional info for: // - IsExternal/IsSingleton/IsAutomaticallyPersisted is not used by IM handling @@ -131,15 +130,14 @@ void LoadAttributeInfo(const ConcreteAttributePath & path, const EmberAfAttribut // fixed, source attribution) // TODO: Set additional flags: - // info->flags.Set(InteractionModel::AttributeQualityFlags::kFabricScoped) - // info->flags.Set(InteractionModel::AttributeQualityFlags::kFabricSensitive) - // info->flags.Set(InteractionModel::AttributeQualityFlags::kChangesOmitted) + // info->flags.Set(DataModel::AttributeQualityFlags::kFabricScoped) + // info->flags.Set(DataModel::AttributeQualityFlags::kFabricSensitive) + // info->flags.Set(DataModel::AttributeQualityFlags::kChangesOmitted) } -InteractionModel::AttributeEntry AttributeEntryFrom(const ConcreteClusterPath & clusterPath, - const EmberAfAttributeMetadata & attribute) +DataModel::AttributeEntry AttributeEntryFrom(const ConcreteClusterPath & clusterPath, const EmberAfAttributeMetadata & attribute) { - InteractionModel::AttributeEntry entry; + DataModel::AttributeEntry entry; entry.path = ConcreteAttributePath(clusterPath.mEndpointId, clusterPath.mClusterId, attribute.attributeId); LoadAttributeInfo(entry.path, attribute, &entry.info); @@ -147,16 +145,15 @@ InteractionModel::AttributeEntry AttributeEntryFrom(const ConcreteClusterPath & return entry; } -InteractionModel::CommandEntry CommandEntryFrom(const ConcreteClusterPath & clusterPath, CommandId clusterCommandId) +DataModel::CommandEntry CommandEntryFrom(const ConcreteClusterPath & clusterPath, CommandId clusterCommandId) { - InteractionModel::CommandEntry entry; + DataModel::CommandEntry entry; entry.path = ConcreteCommandPath(clusterPath.mEndpointId, clusterPath.mClusterId, clusterCommandId); entry.info.invokePrivilege = RequiredPrivilege::ForInvokeCommand(entry.path); - entry.info.flags.Set(InteractionModel::CommandQualityFlags::kTimed, - CommandNeedsTimedInvoke(clusterPath.mClusterId, clusterCommandId)); + entry.info.flags.Set(DataModel::CommandQualityFlags::kTimed, CommandNeedsTimedInvoke(clusterPath.mClusterId, clusterCommandId)); - entry.info.flags.Set(InteractionModel::CommandQualityFlags::kFabricScoped, + entry.info.flags.Set(DataModel::CommandQualityFlags::kFabricScoped, CommandIsFabricScoped(clusterPath.mClusterId, clusterCommandId)); return entry; @@ -166,7 +163,7 @@ const ConcreteCommandPath kInvalidCommandPath(kInvalidEndpointId, kInvalidCluste } // namespace -std::optional CodegenDataModel::EmberCommandListIterator::First(const CommandId * list) +std::optional CodegenDataModelProvider::EmberCommandListIterator::First(const CommandId * list) { VerifyOrReturnValue(list != nullptr, std::nullopt); mCurrentList = mCurrentHint = list; @@ -175,7 +172,7 @@ std::optional CodegenDataModel::EmberCommandListIterator::First(const return *mCurrentList; } -std::optional CodegenDataModel::EmberCommandListIterator::Next(const CommandId * list, CommandId previousId) +std::optional CodegenDataModelProvider::EmberCommandListIterator::Next(const CommandId * list, CommandId previousId) { VerifyOrReturnValue(list != nullptr, std::nullopt); VerifyOrReturnValue(previousId != kInvalidCommandId, std::nullopt); @@ -204,7 +201,7 @@ std::optional CodegenDataModel::EmberCommandListIterator::Next(const return (*mCurrentHint == kInvalidCommandId) ? std::nullopt : std::make_optional(*mCurrentHint); } -bool CodegenDataModel::EmberCommandListIterator::Exists(const CommandId * list, CommandId toCheck) +bool CodegenDataModelProvider::EmberCommandListIterator::Exists(const CommandId * list, CommandId toCheck) { VerifyOrReturnValue(list != nullptr, false); VerifyOrReturnValue(toCheck != kInvalidCommandId, false); @@ -232,8 +229,8 @@ bool CodegenDataModel::EmberCommandListIterator::Exists(const CommandId * list, return (*mCurrentHint == toCheck); } -CHIP_ERROR CodegenDataModel::Invoke(const InteractionModel::InvokeRequest & request, TLV::TLVReader & input_arguments, - CommandHandler * handler) +CHIP_ERROR CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, TLV::TLVReader & input_arguments, + CommandHandler * handler) { // TODO: CommandHandlerInterface support is currently // residing in InteractionModelEngine itself. We may want to separate this out @@ -248,7 +245,7 @@ CHIP_ERROR CodegenDataModel::Invoke(const InteractionModel::InvokeRequest & requ return CHIP_NO_ERROR; } -EndpointId CodegenDataModel::FirstEndpoint() +EndpointId CodegenDataModelProvider::FirstEndpoint() { // find the first enabled index const uint16_t lastEndpointIndex = emberAfEndpointCount(); @@ -265,7 +262,7 @@ EndpointId CodegenDataModel::FirstEndpoint() return kInvalidEndpointId; } -std::optional CodegenDataModel::TryFindEndpointIndex(EndpointId id) const +std::optional CodegenDataModelProvider::TryFindEndpointIndex(EndpointId id) const { const uint16_t lastEndpointIndex = emberAfEndpointCount(); @@ -285,7 +282,7 @@ std::optional CodegenDataModel::TryFindEndpointIndex(EndpointId id) co return std::make_optional(idx); } -EndpointId CodegenDataModel::NextEndpoint(EndpointId before) +EndpointId CodegenDataModelProvider::NextEndpoint(EndpointId before) { const unsigned lastEndpointIndex = emberAfEndpointCount(); @@ -309,17 +306,18 @@ EndpointId CodegenDataModel::NextEndpoint(EndpointId before) return kInvalidEndpointId; } -InteractionModel::ClusterEntry CodegenDataModel::FirstCluster(EndpointId endpointId) +DataModel::ClusterEntry CodegenDataModelProvider::FirstCluster(EndpointId endpointId) { const EmberAfEndpointType * endpoint = emberAfFindEndpointType(endpointId); - VerifyOrReturnValue(endpoint != nullptr, InteractionModel::ClusterEntry::kInvalid); - VerifyOrReturnValue(endpoint->clusterCount > 0, InteractionModel::ClusterEntry::kInvalid); - VerifyOrReturnValue(endpoint->cluster != nullptr, InteractionModel::ClusterEntry::kInvalid); + VerifyOrReturnValue(endpoint != nullptr, DataModel::ClusterEntry::kInvalid); + VerifyOrReturnValue(endpoint->clusterCount > 0, DataModel::ClusterEntry::kInvalid); + VerifyOrReturnValue(endpoint->cluster != nullptr, DataModel::ClusterEntry::kInvalid); return FirstServerClusterEntry(endpointId, endpoint, 0, mClusterIterationHint); } -std::optional CodegenDataModel::TryFindServerClusterIndex(const EmberAfEndpointType * endpoint, ClusterId id) const +std::optional CodegenDataModelProvider::TryFindServerClusterIndex(const EmberAfEndpointType * endpoint, + ClusterId id) const { const unsigned clusterCount = endpoint->clusterCount; @@ -347,26 +345,26 @@ std::optional CodegenDataModel::TryFindServerClusterIndex(const EmberA return std::nullopt; } -InteractionModel::ClusterEntry CodegenDataModel::NextCluster(const ConcreteClusterPath & before) +DataModel::ClusterEntry CodegenDataModelProvider::NextCluster(const ConcreteClusterPath & before) { // TODO: This search still seems slow (ember will loop). Should use index hints as long // as ember API supports it const EmberAfEndpointType * endpoint = emberAfFindEndpointType(before.mEndpointId); - VerifyOrReturnValue(endpoint != nullptr, InteractionModel::ClusterEntry::kInvalid); - VerifyOrReturnValue(endpoint->clusterCount > 0, InteractionModel::ClusterEntry::kInvalid); - VerifyOrReturnValue(endpoint->cluster != nullptr, InteractionModel::ClusterEntry::kInvalid); + VerifyOrReturnValue(endpoint != nullptr, DataModel::ClusterEntry::kInvalid); + VerifyOrReturnValue(endpoint->clusterCount > 0, DataModel::ClusterEntry::kInvalid); + VerifyOrReturnValue(endpoint->cluster != nullptr, DataModel::ClusterEntry::kInvalid); std::optional cluster_idx = TryFindServerClusterIndex(endpoint, before.mClusterId); if (!cluster_idx.has_value()) { - return InteractionModel::ClusterEntry::kInvalid; + return DataModel::ClusterEntry::kInvalid; } return FirstServerClusterEntry(before.mEndpointId, endpoint, *cluster_idx + 1, mClusterIterationHint); } -std::optional CodegenDataModel::GetClusterInfo(const ConcreteClusterPath & path) +std::optional CodegenDataModelProvider::GetClusterInfo(const ConcreteClusterPath & path) { const EmberAfCluster * cluster = FindServerCluster(path); @@ -384,22 +382,22 @@ std::optional CodegenDataModel::GetClusterInfo(co return std::nullopt; } - return std::make_optional(std::get(info)); + return std::make_optional(std::get(info)); } -InteractionModel::AttributeEntry CodegenDataModel::FirstAttribute(const ConcreteClusterPath & path) +DataModel::AttributeEntry CodegenDataModelProvider::FirstAttribute(const ConcreteClusterPath & path) { const EmberAfCluster * cluster = FindServerCluster(path); - VerifyOrReturnValue(cluster != nullptr, InteractionModel::AttributeEntry::kInvalid); - VerifyOrReturnValue(cluster->attributeCount > 0, InteractionModel::AttributeEntry::kInvalid); - VerifyOrReturnValue(cluster->attributes != nullptr, InteractionModel::AttributeEntry::kInvalid); + VerifyOrReturnValue(cluster != nullptr, DataModel::AttributeEntry::kInvalid); + VerifyOrReturnValue(cluster->attributeCount > 0, DataModel::AttributeEntry::kInvalid); + VerifyOrReturnValue(cluster->attributes != nullptr, DataModel::AttributeEntry::kInvalid); mAttributeIterationHint = 0; return AttributeEntryFrom(path, cluster->attributes[0]); } -std::optional CodegenDataModel::TryFindAttributeIndex(const EmberAfCluster * cluster, AttributeId id) const +std::optional CodegenDataModelProvider::TryFindAttributeIndex(const EmberAfCluster * cluster, AttributeId id) const { const unsigned attributeCount = cluster->attributeCount; @@ -422,7 +420,7 @@ std::optional CodegenDataModel::TryFindAttributeIndex(const EmberAfClu return std::nullopt; } -const EmberAfCluster * CodegenDataModel::FindServerCluster(const ConcreteClusterPath & path) +const EmberAfCluster * CodegenDataModelProvider::FindServerCluster(const ConcreteClusterPath & path) { // cache things if (mPreviouslyFoundCluster.has_value() && (mPreviouslyFoundCluster->path == path)) @@ -438,18 +436,18 @@ const EmberAfCluster * CodegenDataModel::FindServerCluster(const ConcreteCluster return cluster; } -InteractionModel::AttributeEntry CodegenDataModel::NextAttribute(const ConcreteAttributePath & before) +DataModel::AttributeEntry CodegenDataModelProvider::NextAttribute(const ConcreteAttributePath & before) { const EmberAfCluster * cluster = FindServerCluster(before); - VerifyOrReturnValue(cluster != nullptr, InteractionModel::AttributeEntry::kInvalid); - VerifyOrReturnValue(cluster->attributeCount > 0, InteractionModel::AttributeEntry::kInvalid); - VerifyOrReturnValue(cluster->attributes != nullptr, InteractionModel::AttributeEntry::kInvalid); + VerifyOrReturnValue(cluster != nullptr, DataModel::AttributeEntry::kInvalid); + VerifyOrReturnValue(cluster->attributeCount > 0, DataModel::AttributeEntry::kInvalid); + VerifyOrReturnValue(cluster->attributes != nullptr, DataModel::AttributeEntry::kInvalid); // find the given attribute in the list and then return the next one std::optional attribute_idx = TryFindAttributeIndex(cluster, before.mAttributeId); if (!attribute_idx.has_value()) { - return InteractionModel::AttributeEntry::kInvalid; + return DataModel::AttributeEntry::kInvalid; } unsigned next_idx = *attribute_idx + 1; @@ -460,10 +458,10 @@ InteractionModel::AttributeEntry CodegenDataModel::NextAttribute(const ConcreteA } // iteration complete - return InteractionModel::AttributeEntry::kInvalid; + return DataModel::AttributeEntry::kInvalid; } -std::optional CodegenDataModel::GetAttributeInfo(const ConcreteAttributePath & path) +std::optional CodegenDataModelProvider::GetAttributeInfo(const ConcreteAttributePath & path) { const EmberAfCluster * cluster = FindServerCluster(path); @@ -478,36 +476,36 @@ std::optional CodegenDataModel::GetAttributeInf return std::nullopt; } - InteractionModel::AttributeInfo info; + DataModel::AttributeInfo info; LoadAttributeInfo(path, cluster->attributes[*attribute_idx], &info); return std::make_optional(info); } -InteractionModel::CommandEntry CodegenDataModel::FirstAcceptedCommand(const ConcreteClusterPath & path) +DataModel::CommandEntry CodegenDataModelProvider::FirstAcceptedCommand(const ConcreteClusterPath & path) { const EmberAfCluster * cluster = FindServerCluster(path); - VerifyOrReturnValue(cluster != nullptr, InteractionModel::CommandEntry::kInvalid); + VerifyOrReturnValue(cluster != nullptr, DataModel::CommandEntry::kInvalid); std::optional commandId = mAcceptedCommandsIterator.First(cluster->acceptedCommandList); - VerifyOrReturnValue(commandId.has_value(), InteractionModel::CommandEntry::kInvalid); + VerifyOrReturnValue(commandId.has_value(), DataModel::CommandEntry::kInvalid); return CommandEntryFrom(path, *commandId); } -InteractionModel::CommandEntry CodegenDataModel::NextAcceptedCommand(const ConcreteCommandPath & before) +DataModel::CommandEntry CodegenDataModelProvider::NextAcceptedCommand(const ConcreteCommandPath & before) { const EmberAfCluster * cluster = FindServerCluster(before); - VerifyOrReturnValue(cluster != nullptr, InteractionModel::CommandEntry::kInvalid); + VerifyOrReturnValue(cluster != nullptr, DataModel::CommandEntry::kInvalid); std::optional commandId = mAcceptedCommandsIterator.Next(cluster->acceptedCommandList, before.mCommandId); - VerifyOrReturnValue(commandId.has_value(), InteractionModel::CommandEntry::kInvalid); + VerifyOrReturnValue(commandId.has_value(), DataModel::CommandEntry::kInvalid); return CommandEntryFrom(before, *commandId); } -std::optional CodegenDataModel::GetAcceptedCommandInfo(const ConcreteCommandPath & path) +std::optional CodegenDataModelProvider::GetAcceptedCommandInfo(const ConcreteCommandPath & path) { const EmberAfCluster * cluster = FindServerCluster(path); @@ -517,7 +515,7 @@ std::optional CodegenDataModel::GetAcceptedComman return CommandEntryFrom(path, path.mCommandId).info; } -ConcreteCommandPath CodegenDataModel::FirstGeneratedCommand(const ConcreteClusterPath & path) +ConcreteCommandPath CodegenDataModelProvider::FirstGeneratedCommand(const ConcreteClusterPath & path) { const EmberAfCluster * cluster = FindServerCluster(path); @@ -528,7 +526,7 @@ ConcreteCommandPath CodegenDataModel::FirstGeneratedCommand(const ConcreteCluste return ConcreteCommandPath(path.mEndpointId, path.mClusterId, *commandId); } -ConcreteCommandPath CodegenDataModel::NextGeneratedCommand(const ConcreteCommandPath & before) +ConcreteCommandPath CodegenDataModelProvider::NextGeneratedCommand(const ConcreteCommandPath & before) { const EmberAfCluster * cluster = FindServerCluster(before); diff --git a/src/app/codegen-data-model/CodegenDataModel.h b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h similarity index 75% rename from src/app/codegen-data-model/CodegenDataModel.h rename to src/app/codegen-data-model-provider/CodegenDataModelProvider.h index 123dcd72382291..21dc0cc87e1a31 100644 --- a/src/app/codegen-data-model/CodegenDataModel.h +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h @@ -16,7 +16,7 @@ */ #pragma once -#include +#include #include @@ -33,9 +33,9 @@ namespace app { /// as well as application-specific overrides to provide data model functionality. /// /// Given that this relies on global data at link time, there generally can be -/// only one CodegenDataModel per application (you can create more instances, +/// only one CodegenDataModelProvider per application (you can create more instances, /// however they would share the exact same underlying data and storage). -class CodegenDataModel : public chip::app::InteractionModel::DataModel +class CodegenDataModelProvider : public chip::app::DataModel::Provider { private: /// Ember commands are stored as a `CommandId *` pointer that is either null (i.e. no commands) @@ -68,26 +68,26 @@ class CodegenDataModel : public chip::app::InteractionModel::DataModel /// Generic model implementations CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const InteractionModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const InteractionModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const InteractionModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; + CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; + CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) override; /// attribute tree iteration EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; - InteractionModel::ClusterEntry FirstCluster(EndpointId endpoint) override; - InteractionModel::ClusterEntry NextCluster(const ConcreteClusterPath & before) override; - std::optional GetClusterInfo(const ConcreteClusterPath & path) override; + DataModel::ClusterEntry FirstCluster(EndpointId endpoint) override; + DataModel::ClusterEntry NextCluster(const ConcreteClusterPath & before) override; + std::optional GetClusterInfo(const ConcreteClusterPath & path) override; - InteractionModel::AttributeEntry FirstAttribute(const ConcreteClusterPath & cluster) override; - InteractionModel::AttributeEntry NextAttribute(const ConcreteAttributePath & before) override; - std::optional GetAttributeInfo(const ConcreteAttributePath & path) override; + DataModel::AttributeEntry FirstAttribute(const ConcreteClusterPath & cluster) override; + DataModel::AttributeEntry NextAttribute(const ConcreteAttributePath & before) override; + std::optional GetAttributeInfo(const ConcreteAttributePath & path) override; - InteractionModel::CommandEntry FirstAcceptedCommand(const ConcreteClusterPath & cluster) override; - InteractionModel::CommandEntry NextAcceptedCommand(const ConcreteCommandPath & before) override; - std::optional GetAcceptedCommandInfo(const ConcreteCommandPath & path) override; + DataModel::CommandEntry FirstAcceptedCommand(const ConcreteClusterPath & cluster) override; + DataModel::CommandEntry NextAcceptedCommand(const ConcreteCommandPath & before) override; + std::optional GetAcceptedCommandInfo(const ConcreteCommandPath & path) override; ConcreteCommandPath FirstGeneratedCommand(const ConcreteClusterPath & cluster) override; ConcreteCommandPath NextGeneratedCommand(const ConcreteCommandPath & before) override; diff --git a/src/app/codegen-data-model/CodegenDataModel_Read.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp similarity index 97% rename from src/app/codegen-data-model/CodegenDataModel_Read.cpp rename to src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp index 3e1f246cb3a2f9..d27d18964dccf7 100644 --- a/src/app/codegen-data-model/CodegenDataModel_Read.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include #include #include @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -258,7 +258,7 @@ CHIP_ERROR EncodeEmberValue(ByteSpan data, const EmberAfAttributeMetadata * meta /// - validate ACL (only for non-internal requests) /// - Try to read attribute via the AttributeAccessInterface /// - Try to read the value from ember RAM storage -CHIP_ERROR CodegenDataModel::ReadAttribute(const InteractionModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) +CHIP_ERROR CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) { ChipLogDetail(DataManagement, "Reading attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI " (expanded=%d)", @@ -266,7 +266,7 @@ CHIP_ERROR CodegenDataModel::ReadAttribute(const InteractionModel::ReadAttribute request.path.mExpanded); // ACL check for non-internal requests - if (!request.operationFlags.Has(InteractionModel::OperationFlags::kInternal)) + if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), CHIP_ERROR_INVALID_ARGUMENT); diff --git a/src/app/codegen-data-model/CodegenDataModel_Write.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp similarity index 96% rename from src/app/codegen-data-model/CodegenDataModel_Write.cpp rename to src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp index 999f35ea7836cf..962355e8e47b08 100644 --- a/src/app/codegen-data-model/CodegenDataModel_Write.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include #include #include #include #include #include -#include +#include #include #include #include @@ -266,14 +266,14 @@ CHIP_ERROR DecodeValueIntoEmberBuffer(AttributeValueDecoder & decoder, const Emb } // namespace -CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttributeRequest & request, - AttributeValueDecoder & decoder) +CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) { ChipLogDetail(DataManagement, "Writing attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI, ChipLogValueMEI(request.path.mClusterId), request.path.mEndpointId, ChipLogValueMEI(request.path.mAttributeId)); // ACL check for non-internal requests - if (!request.operationFlags.Has(InteractionModel::OperationFlags::kInternal)) + if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); @@ -314,12 +314,11 @@ CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttribu bool isReadOnly = (attributeMetadata == nullptr) || (*attributeMetadata)->IsReadOnly(); // Internal is allowed to bypass timed writes and read-only. - if (!request.operationFlags.Has(InteractionModel::OperationFlags::kInternal)) + if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { VerifyOrReturnError(!isReadOnly, CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); - VerifyOrReturnError(!(*attributeMetadata)->MustUseTimedWrite() || - request.writeFlags.Has(InteractionModel::WriteFlags::kTimed), + VerifyOrReturnError(!(*attributeMetadata)->MustUseTimedWrite() || request.writeFlags.Has(DataModel::WriteFlags::kTimed), CHIP_IM_GLOBAL_STATUS(NeedsTimedInteraction)); } @@ -329,7 +328,7 @@ CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttribu if (request.path.mDataVersion.HasValue()) { - std::optional clusterInfo = GetClusterInfo(request.path); + std::optional clusterInfo = GetClusterInfo(request.path); if (!clusterInfo.has_value()) { ChipLogError(DataManagement, "Unable to get cluster info for Endpoint 0x%x, Cluster " ChipLogFormatMEI, @@ -371,7 +370,7 @@ CHIP_ERROR CodegenDataModel::WriteAttribute(const InteractionModel::WriteAttribu return CHIP_IM_GLOBAL_STATUS(InvalidValue); } - if (request.operationFlags.Has(InteractionModel::OperationFlags::kInternal)) + if (request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { // Internal requests use the non-External interface that has less enforcement // than the external version (e.g. does not check/enforce writable settings, does not diff --git a/src/app/codegen-data-model/EmberMetadata.cpp b/src/app/codegen-data-model-provider/EmberMetadata.cpp similarity index 98% rename from src/app/codegen-data-model/EmberMetadata.cpp rename to src/app/codegen-data-model-provider/EmberMetadata.cpp index 9114196a377906..b8d998d29f0b7e 100644 --- a/src/app/codegen-data-model/EmberMetadata.cpp +++ b/src/app/codegen-data-model-provider/EmberMetadata.cpp @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include #include #include diff --git a/src/app/codegen-data-model/EmberMetadata.h b/src/app/codegen-data-model-provider/EmberMetadata.h similarity index 100% rename from src/app/codegen-data-model/EmberMetadata.h rename to src/app/codegen-data-model-provider/EmberMetadata.h diff --git a/src/app/codegen-data-model/Instance.cpp b/src/app/codegen-data-model-provider/Instance.cpp similarity index 76% rename from src/app/codegen-data-model/Instance.cpp rename to src/app/codegen-data-model-provider/Instance.cpp index 98eeeb604503b9..30a52dd5fb219a 100644 --- a/src/app/codegen-data-model/Instance.cpp +++ b/src/app/codegen-data-model-provider/Instance.cpp @@ -14,15 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include -#include +#include +#include namespace chip { namespace app { -InteractionModel::DataModel * CodegenDataModelInstance() +DataModel::Provider * CodegenDataModelProviderInstance() { - static CodegenDataModel gCodegenModel; + static CodegenDataModelProvider gCodegenModel; return &gCodegenModel; } diff --git a/src/app/codegen-data-model/Instance.h b/src/app/codegen-data-model-provider/Instance.h similarity index 87% rename from src/app/codegen-data-model/Instance.h rename to src/app/codegen-data-model-provider/Instance.h index 4c7530981920c1..37f891280424f7 100644 --- a/src/app/codegen-data-model/Instance.h +++ b/src/app/codegen-data-model-provider/Instance.h @@ -16,12 +16,12 @@ */ #pragma once -#include +#include namespace chip { namespace app { -InteractionModel::DataModel * CodegenDataModelInstance(); +DataModel::Provider * CodegenDataModelProviderInstance(); } // namespace app } // namespace chip diff --git a/src/app/codegen-data-model/model.cmake b/src/app/codegen-data-model-provider/model.cmake similarity index 81% rename from src/app/codegen-data-model/model.cmake rename to src/app/codegen-data-model-provider/model.cmake index 73b54247a81033..777219549e44eb 100644 --- a/src/app/codegen-data-model/model.cmake +++ b/src/app/codegen-data-model-provider/model.cmake @@ -15,10 +15,10 @@ set(BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) # If you change this list, please ALSO CHANGE model.gni SET(CODEGEN_DATA_MODEL_SOURCES - "${BASE_DIR}/CodegenDataModel.cpp" - "${BASE_DIR}/CodegenDataModel.h" - "${BASE_DIR}/CodegenDataModel_Read.cpp" - "${BASE_DIR}/CodegenDataModel_Write.cpp" + "${BASE_DIR}/CodegenDataModelProvider.cpp" + "${BASE_DIR}/CodegenDataModelProvider.h" + "${BASE_DIR}/CodegenDataModelProvider_Read.cpp" + "${BASE_DIR}/CodegenDataModelProvider_Write.cpp" "${BASE_DIR}/EmberMetadata.cpp" "${BASE_DIR}/EmberMetadata.h" "${BASE_DIR}/Instance.cpp" diff --git a/src/app/codegen-data-model/model.gni b/src/app/codegen-data-model-provider/model.gni similarity index 66% rename from src/app/codegen-data-model/model.gni rename to src/app/codegen-data-model-provider/model.gni index 25f50571223971..f70d0b9ce96455 100644 --- a/src/app/codegen-data-model/model.gni +++ b/src/app/codegen-data-model-provider/model.gni @@ -25,17 +25,17 @@ import("//build_overrides/chip.gni") # be cleanly built as a stand-alone and instead have to be imported as part of # a different data model or compilation unit. codegen_data_model_SOURCES = [ - "${chip_root}/src/app/codegen-data-model/CodegenDataModel.cpp", - "${chip_root}/src/app/codegen-data-model/CodegenDataModel.h", - "${chip_root}/src/app/codegen-data-model/CodegenDataModel_Read.cpp", - "${chip_root}/src/app/codegen-data-model/CodegenDataModel_Write.cpp", - "${chip_root}/src/app/codegen-data-model/EmberMetadata.cpp", - "${chip_root}/src/app/codegen-data-model/EmberMetadata.h", - "${chip_root}/src/app/codegen-data-model/Instance.cpp", + "${chip_root}/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp", + "${chip_root}/src/app/codegen-data-model-provider/CodegenDataModelProvider.h", + "${chip_root}/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp", + "${chip_root}/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp", + "${chip_root}/src/app/codegen-data-model-provider/EmberMetadata.cpp", + "${chip_root}/src/app/codegen-data-model-provider/EmberMetadata.h", + "${chip_root}/src/app/codegen-data-model-provider/Instance.cpp", ] codegen_data_model_PUBLIC_DEPS = [ "${chip_root}/src/app/common:attribute-type", - "${chip_root}/src/app/data-model-interface", - "${chip_root}/src/app/codegen-data-model:instance-header", + "${chip_root}/src/app/data-model-provider", + "${chip_root}/src/app/codegen-data-model-provider:instance-header", ] diff --git a/src/app/codegen-data-model/tests/AttributeReportIBEncodeDecode.cpp b/src/app/codegen-data-model-provider/tests/AttributeReportIBEncodeDecode.cpp similarity index 100% rename from src/app/codegen-data-model/tests/AttributeReportIBEncodeDecode.cpp rename to src/app/codegen-data-model-provider/tests/AttributeReportIBEncodeDecode.cpp diff --git a/src/app/codegen-data-model/tests/AttributeReportIBEncodeDecode.h b/src/app/codegen-data-model-provider/tests/AttributeReportIBEncodeDecode.h similarity index 100% rename from src/app/codegen-data-model/tests/AttributeReportIBEncodeDecode.h rename to src/app/codegen-data-model-provider/tests/AttributeReportIBEncodeDecode.h diff --git a/src/app/codegen-data-model/tests/BUILD.gn b/src/app/codegen-data-model-provider/tests/BUILD.gn similarity index 94% rename from src/app/codegen-data-model/tests/BUILD.gn rename to src/app/codegen-data-model-provider/tests/BUILD.gn index 3f88ac61c41766..451a276c0367d2 100644 --- a/src/app/codegen-data-model/tests/BUILD.gn +++ b/src/app/codegen-data-model-provider/tests/BUILD.gn @@ -13,7 +13,7 @@ # limitations under the License. import("//build_overrides/chip.gni") import("${chip_root}/build/chip/chip_test_suite.gni") -import("${chip_root}/src/app/codegen-data-model/model.gni") +import("${chip_root}/src/app/codegen-data-model-provider/model.gni") source_set("ember_extra_files") { sources = [ @@ -51,7 +51,7 @@ source_set("mock_model") { } chip_test_suite("tests") { - output_name = "libCodegenDataModelTests" + output_name = "libCodegenDataModelProviderTests" test_sources = [ "TestCodegenModelViaMocks.cpp" ] diff --git a/src/app/codegen-data-model/tests/EmberInvokeOverride.cpp b/src/app/codegen-data-model-provider/tests/EmberInvokeOverride.cpp similarity index 100% rename from src/app/codegen-data-model/tests/EmberInvokeOverride.cpp rename to src/app/codegen-data-model-provider/tests/EmberInvokeOverride.cpp diff --git a/src/app/codegen-data-model/tests/EmberInvokeOverride.h b/src/app/codegen-data-model-provider/tests/EmberInvokeOverride.h similarity index 100% rename from src/app/codegen-data-model/tests/EmberInvokeOverride.h rename to src/app/codegen-data-model-provider/tests/EmberInvokeOverride.h diff --git a/src/app/codegen-data-model/tests/EmberReadWriteOverride.cpp b/src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp similarity index 100% rename from src/app/codegen-data-model/tests/EmberReadWriteOverride.cpp rename to src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp diff --git a/src/app/codegen-data-model/tests/EmberReadWriteOverride.h b/src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.h similarity index 100% rename from src/app/codegen-data-model/tests/EmberReadWriteOverride.h rename to src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.h diff --git a/src/app/codegen-data-model/tests/InteractionModelTemporaryOverrides.cpp b/src/app/codegen-data-model-provider/tests/InteractionModelTemporaryOverrides.cpp similarity index 100% rename from src/app/codegen-data-model/tests/InteractionModelTemporaryOverrides.cpp rename to src/app/codegen-data-model-provider/tests/InteractionModelTemporaryOverrides.cpp diff --git a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp similarity index 96% rename from src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp rename to src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp index 796c845ebe7787..947d0aecd9684d 100644 --- a/src/app/codegen-data-model/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp @@ -20,11 +20,11 @@ #include #include "app/ConcreteCommandPath.h" -#include +#include -#include -#include -#include +#include +#include +#include #include #include @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -62,7 +62,7 @@ using namespace chip; using namespace chip::Test; using namespace chip::app; -using namespace chip::app::InteractionModel; +using namespace chip::app::DataModel; using namespace chip::app::Clusters::Globals::Attributes; namespace { @@ -126,7 +126,7 @@ bool operator==(const Access::SubjectDescriptor & a, const Access::SubjectDescri return true; } -class TestDataModelChangeListener : public DataModelChangeListener +class TestProviderChangeListener : public ProviderChangeListener { public: void MarkDirty(const ConcreteAttributePath & path) override { mDirtyList.push_back(path); } @@ -153,10 +153,10 @@ class TestActionContext : public ActionContext Messaging::ExchangeContext * CurrentExchange() override { return nullptr; } }; -class CodegenDataModelWithContext : public CodegenDataModel +class CodegenDataModelProviderWithContext : public CodegenDataModelProvider { public: - CodegenDataModelWithContext() + CodegenDataModelProviderWithContext() { InteractionModelContext context{ .eventsGenerator = &mEventGenerator, @@ -166,14 +166,14 @@ class CodegenDataModelWithContext : public CodegenDataModel Startup(context); } - ~CodegenDataModelWithContext() { Shutdown(); } + ~CodegenDataModelProviderWithContext() { Shutdown(); } - TestDataModelChangeListener & ChangeListener() { return mChangeListener; } - const TestDataModelChangeListener & ChangeListener() const { return mChangeListener; } + TestProviderChangeListener & ChangeListener() { return mChangeListener; } + const TestProviderChangeListener & ChangeListener() const { return mChangeListener; } private: TestEventGenerator mEventGenerator; - TestDataModelChangeListener mChangeListener; + TestProviderChangeListener mChangeListener; TestActionContext mActionContext; }; @@ -625,7 +625,7 @@ struct TestReadRequest request.path = path; } - std::unique_ptr StartEncoding(InteractionModel::DataModel * model, + std::unique_ptr StartEncoding(DataModel::Provider * model, AttributeEncodeState state = AttributeEncodeState()) { std::optional info = model->GetClusterInfo(request.path); @@ -658,7 +658,7 @@ struct TestReadRequest // Sets up data for writing struct TestWriteRequest { - InteractionModel::WriteAttributeRequest request; + DataModel::WriteAttributeRequest request; uint8_t tlvBuffer[128] = { 0 }; TLV::TLVReader tlvReader; /// tlv reader used for the returned AttributeValueDecoder (since attributeValueDecoder uses references) @@ -708,7 +708,7 @@ template void TestEmberScalarTypeRead(typename NumericAttributeTraits::WorkingType value) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest( @@ -743,7 +743,7 @@ template void TestEmberScalarNullRead() { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest( @@ -776,7 +776,7 @@ template void TestEmberScalarTypeWrite(const typename NumericAttributeTraits::WorkingType value) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; // non-nullable test @@ -833,7 +833,7 @@ template void TestEmberScalarNullWrite() { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -861,7 +861,7 @@ template void TestEmberScalarTypeWriteNullValueToNullable() { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test( @@ -893,7 +893,7 @@ void WriteLe16(void * buffer, uint16_t value) TEST(TestCodegenModelViaMocks, IterateOverEndpoints) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; // This iteration relies on the hard-coding that occurs when mock_ember is used EXPECT_EQ(model.FirstEndpoint(), kMockEndpoint1); @@ -921,7 +921,7 @@ TEST(TestCodegenModelViaMocks, IterateOverEndpoints) TEST(TestCodegenModelViaMocks, IterateOverClusters) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; chip::Test::ResetVersion(); @@ -984,7 +984,7 @@ TEST(TestCodegenModelViaMocks, GetClusterInfo) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; chip::Test::ResetVersion(); @@ -1009,7 +1009,7 @@ TEST(TestCodegenModelViaMocks, GetClusterInfo) TEST(TestCodegenModelViaMocks, IterateOverAttributes) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; // invalid paths should return in "no more data" ASSERT_FALSE(model.FirstAttribute(ConcreteClusterPath(kEndpointIdThatIsMissing, MockClusterId(1))).path.HasValidIds()); @@ -1080,7 +1080,7 @@ TEST(TestCodegenModelViaMocks, IterateOverAttributes) TEST(TestCodegenModelViaMocks, GetAttributeInfo) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; // various non-existent or invalid paths should return no info data ASSERT_FALSE( @@ -1120,7 +1120,7 @@ TEST(TestCodegenModelViaMocks, GetAttributeInfo) TEST(TestCodegenModelViaMocks, GlobalAttributeInfo) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; std::optional info = model.GetAttributeInfo( ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), Clusters::Globals::Attributes::GeneratedCommandList::Id)); @@ -1135,7 +1135,7 @@ TEST(TestCodegenModelViaMocks, GlobalAttributeInfo) TEST(TestCodegenModelViaMocks, IterateOverAcceptedCommands) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; // invalid paths should return in "no more data" ASSERT_FALSE(model.FirstAcceptedCommand(ConcreteClusterPath(kEndpointIdThatIsMissing, MockClusterId(1))).path.HasValidIds()); @@ -1200,7 +1200,7 @@ TEST(TestCodegenModelViaMocks, IterateOverAcceptedCommands) TEST(TestCodegenModelViaMocks, AcceptedCommandInfo) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; // invalid paths should return in "no more data" ASSERT_FALSE(model.GetAcceptedCommandInfo(ConcreteCommandPath(kEndpointIdThatIsMissing, MockClusterId(1), 1)).has_value()); @@ -1232,7 +1232,7 @@ TEST(TestCodegenModelViaMocks, AcceptedCommandInfo) TEST(TestCodegenModelViaMocks, IterateOverGeneratedCommands) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; // invalid paths should return in "no more data" ASSERT_FALSE(model.FirstGeneratedCommand(ConcreteClusterPath(kEndpointIdThatIsMissing, MockClusterId(1))).HasValidIds()); @@ -1291,7 +1291,7 @@ TEST(TestCodegenModelViaMocks, IterateOverGeneratedCommands) TEST(TestCodegenModelViaMocks, EmberAttributeReadAclDeny) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest(kDenySubjectDescriptor, @@ -1304,7 +1304,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadAclDeny) TEST(TestCodegenModelViaMocks, ReadForInvalidGlobalAttributePath) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; { @@ -1325,7 +1325,7 @@ TEST(TestCodegenModelViaMocks, ReadForInvalidGlobalAttributePath) TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; // Invalid attribute @@ -1359,7 +1359,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) TEST(TestCodegenModelViaMocks, EmberAttributePathExpansionAccessDeniedRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest(kDenySubjectDescriptor, @@ -1377,7 +1377,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributePathExpansionAccessDeniedRead) TEST(TestCodegenModelViaMocks, AccessInterfaceUnsupportedRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kTestPath(kMockEndpoint3, MockClusterId(4), @@ -1481,7 +1481,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadNulls) TEST(TestCodegenModelViaMocks, EmberAttributeReadErrorReading) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; { @@ -1517,7 +1517,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadErrorReading) TEST(TestCodegenModelViaMocks, EmberAttributeReadNullOctetString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest(kAdminSubjectDescriptor, @@ -1552,7 +1552,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadNullOctetString) TEST(TestCodegenModelViaMocks, EmberAttributeReadOctetString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest( @@ -1591,7 +1591,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadOctetString) TEST(TestCodegenModelViaMocks, EmberAttributeReadLongOctetString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest(kAdminSubjectDescriptor, @@ -1628,7 +1628,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadLongOctetString) TEST(TestCodegenModelViaMocks, EmberAttributeReadShortString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest(kAdminSubjectDescriptor, @@ -1664,7 +1664,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadShortString) TEST(TestCodegenModelViaMocks, EmberAttributeReadLongString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest( @@ -1701,7 +1701,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadLongString) TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceStructRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -1744,7 +1744,7 @@ TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceStructRead) TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceReadError) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -1759,7 +1759,7 @@ TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceReadError) TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceListRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -1811,7 +1811,7 @@ TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceListRead) TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceListOverflowRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -1870,7 +1870,7 @@ TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceListOverflowRead) TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceListIncrementalRead) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -1932,7 +1932,7 @@ TEST(TestCodegenModelViaMocks, AttributeAccessInterfaceListIncrementalRead) TEST(TestCodegenModelViaMocks, ReadGlobalAttributeAttributeList) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestReadRequest testRequest(kAdminSubjectDescriptor, @@ -1988,7 +1988,7 @@ TEST(TestCodegenModelViaMocks, ReadGlobalAttributeAttributeList) TEST(TestCodegenModelViaMocks, EmberAttributeWriteAclDeny) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kDenySubjectDescriptor, ConcreteDataAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); @@ -2053,7 +2053,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteInvalidValueToNullable) TEST(TestCodegenModelViaMocks, EmberTestWriteReservedNullPlaceholderToNullable) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test( @@ -2071,7 +2071,7 @@ TEST(TestCodegenModelViaMocks, EmberTestWriteReservedNullPlaceholderToNullable) TEST(TestCodegenModelViaMocks, EmberTestWriteOutOfRepresentableRangeOddIntegerNonNullable) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2090,7 +2090,7 @@ TEST(TestCodegenModelViaMocks, EmberTestWriteOutOfRepresentableRangeOddIntegerNo TEST(TestCodegenModelViaMocks, EmberTestWriteOutOfRepresentableRangeOddIntegerNullable) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test( @@ -2145,7 +2145,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteNulls) TEST(TestCodegenModelViaMocks, EmberAttributeWriteShortString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2162,7 +2162,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteShortString) TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongStringOutOfBounds) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2179,7 +2179,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongStringOutOfBounds) TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongString) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2200,7 +2200,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongString) TEST(TestCodegenModelViaMocks, EmberAttributeWriteNullableLongStringValue) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2222,7 +2222,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteNullableLongStringValue) TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongNullableStringNull) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2240,7 +2240,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongNullableStringNull) TEST(TestCodegenModelViaMocks, EmberAttributeWriteShortBytes) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2262,7 +2262,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteShortBytes) TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongBytes) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2286,7 +2286,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongBytes) TEST(TestCodegenModelViaMocks, EmberAttributeWriteTimedWrite) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), kAttributeIdTimedWrite)); @@ -2302,7 +2302,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteTimedWrite) TEST(TestCodegenModelViaMocks, EmberAttributeWriteReadOnlyAttribute) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), kAttributeIdReadOnly)); @@ -2318,7 +2318,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteReadOnlyAttribute) TEST(TestCodegenModelViaMocks, EmberAttributeWriteDataVersion) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2345,7 +2345,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteDataVersion) TEST(TestCodegenModelViaMocks, WriteToInvalidPath) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; { @@ -2369,7 +2369,7 @@ TEST(TestCodegenModelViaMocks, WriteToInvalidPath) TEST(TestCodegenModelViaMocks, WriteToGlobalAttribute) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), AttributeList::Id)); @@ -2380,7 +2380,7 @@ TEST(TestCodegenModelViaMocks, WriteToGlobalAttribute) TEST(TestCodegenModelViaMocks, EmberWriteFailure) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; TestWriteRequest test(kAdminSubjectDescriptor, @@ -2404,7 +2404,7 @@ TEST(TestCodegenModelViaMocks, EmberWriteFailure) TEST(TestCodegenModelViaMocks, EmberWriteAttributeAccessInterfaceTest) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -2447,7 +2447,7 @@ TEST(TestCodegenModelViaMocks, EmberInvokeTest) // is actually invoked. UseMockNodeConfig config(gTestNodeConfig); - chip::app::CodegenDataModel model; + chip::app::CodegenDataModelProvider model; { const ConcreteCommandPath kCommandPath(kMockEndpoint1, MockClusterId(1), kMockCommandId1); @@ -2481,7 +2481,7 @@ TEST(TestCodegenModelViaMocks, EmberInvokeTest) TEST(TestCodegenModelViaMocks, EmberWriteAttributeAccessInterfaceReturningError) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), @@ -2505,7 +2505,7 @@ TEST(TestCodegenModelViaMocks, EmberWriteAttributeAccessInterfaceReturningError) TEST(TestCodegenModelViaMocks, EmberWriteInvalidDataType) { UseMockNodeConfig config(gTestNodeConfig); - CodegenDataModelWithContext model; + CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; const ConcreteAttributePath kStructPath(kMockEndpoint3, MockClusterId(4), diff --git a/src/app/data-model-interface/ActionContext.h b/src/app/data-model-provider/ActionContext.h similarity index 95% rename from src/app/data-model-interface/ActionContext.h rename to src/app/data-model-provider/ActionContext.h index bfc2555870c780..71c9c5e7710877 100644 --- a/src/app/data-model-interface/ActionContext.h +++ b/src/app/data-model-provider/ActionContext.h @@ -20,7 +20,7 @@ namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { // Context for a currently executing action class ActionContext @@ -38,6 +38,6 @@ class ActionContext virtual Messaging::ExchangeContext * CurrentExchange() = 0; }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/BUILD.gn b/src/app/data-model-provider/BUILD.gn similarity index 93% rename from src/app/data-model-interface/BUILD.gn rename to src/app/data-model-provider/BUILD.gn index abe66a68f342bd..5093cce2f4124d 100644 --- a/src/app/data-model-interface/BUILD.gn +++ b/src/app/data-model-provider/BUILD.gn @@ -13,16 +13,16 @@ # limitations under the License. import("//build_overrides/chip.gni") -source_set("data-model-interface") { +source_set("data-model-provider") { sources = [ "ActionContext.h", "Context.h", - "DataModel.h", - "DataModelChangeListener.h", "EventsGenerator.h", "MetadataTypes.cpp", "MetadataTypes.h", "OperationTypes.h", + "Provider.h", + "ProviderChangeListener.h", ] public_deps = [ diff --git a/src/app/data-model-interface/Context.h b/src/app/data-model-provider/Context.h similarity index 80% rename from src/app/data-model-interface/Context.h rename to src/app/data-model-provider/Context.h index 1ccfd1eb6586b7..e5dc725f713b0a 100644 --- a/src/app/data-model-interface/Context.h +++ b/src/app/data-model-provider/Context.h @@ -16,13 +16,13 @@ */ #pragma once -#include -#include -#include +#include +#include +#include namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { /// Data provided to data models in order to interface with the interaction model environment. /// @@ -32,10 +32,10 @@ namespace InteractionModel { struct InteractionModelContext { EventsGenerator * eventsGenerator; - DataModelChangeListener * dataModelChangeListener; + ProviderChangeListener * dataModelChangeListener; ActionContext * actionContext; }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/EventsGenerator.h b/src/app/data-model-provider/EventsGenerator.h similarity index 98% rename from src/app/data-model-interface/EventsGenerator.h rename to src/app/data-model-provider/EventsGenerator.h index b37d5107ca76c4..94b15bfa07d4a1 100644 --- a/src/app/data-model-interface/EventsGenerator.h +++ b/src/app/data-model-provider/EventsGenerator.h @@ -29,7 +29,7 @@ namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { namespace internal { template @@ -131,6 +131,6 @@ class EventsGenerator } }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/MetadataTypes.cpp b/src/app/data-model-provider/MetadataTypes.cpp similarity index 92% rename from src/app/data-model-interface/MetadataTypes.cpp rename to src/app/data-model-provider/MetadataTypes.cpp index 92104b9bf90115..3ff238d7436a94 100644 --- a/src/app/data-model-interface/MetadataTypes.cpp +++ b/src/app/data-model-provider/MetadataTypes.cpp @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { const AttributeEntry AttributeEntry::kInvalid{ .path = ConcreteAttributePath(kInvalidEndpointId, kInvalidClusterId, kInvalidAttributeId) }; @@ -30,6 +30,6 @@ const ClusterEntry ClusterEntry::kInvalid{ .info = ClusterInfo(0 /* version */), // version of invalid cluster entry does not matter }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/MetadataTypes.h b/src/app/data-model-provider/MetadataTypes.h similarity index 97% rename from src/app/data-model-interface/MetadataTypes.h rename to src/app/data-model-provider/MetadataTypes.h index 5b3c62f0be2247..5e46d63b967e81 100644 --- a/src/app/data-model-interface/MetadataTypes.h +++ b/src/app/data-model-provider/MetadataTypes.h @@ -28,7 +28,7 @@ namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { enum class ClusterQualityFlags : uint32_t { @@ -121,10 +121,10 @@ struct CommandEntry /// are returned, when iterating over a cluster, all attributes/commands are iterated over) /// - uniqueness and completeness (iterate over all possible distinct values as long as no /// internal structural changes occur) -class DataModelMetadataTree +class ProviderMetadataTree { public: - virtual ~DataModelMetadataTree() = default; + virtual ~ProviderMetadataTree() = default; virtual EndpointId FirstEndpoint() = 0; virtual EndpointId NextEndpoint(EndpointId before) = 0; @@ -150,6 +150,6 @@ class DataModelMetadataTree virtual ConcreteCommandPath NextGeneratedCommand(const ConcreteCommandPath & before) = 0; }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/OperationTypes.h b/src/app/data-model-provider/OperationTypes.h similarity index 98% rename from src/app/data-model-interface/OperationTypes.h rename to src/app/data-model-provider/OperationTypes.h index c9e5ae642158b3..00ec0424763cf5 100644 --- a/src/app/data-model-interface/OperationTypes.h +++ b/src/app/data-model-provider/OperationTypes.h @@ -26,7 +26,7 @@ namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { /// Contains common flags among all interaction model operations: read/write/invoke enum class OperationFlags : uint32_t @@ -92,6 +92,6 @@ struct InvokeRequest : OperationRequest BitFlags invokeFlags; }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/DataModel.h b/src/app/data-model-provider/Provider.h similarity index 94% rename from src/app/data-model-interface/DataModel.h rename to src/app/data-model-provider/Provider.h index bcf24c1aa9e7b2..f5d550c806fd89 100644 --- a/src/app/data-model-interface/DataModel.h +++ b/src/app/data-model-provider/Provider.h @@ -23,13 +23,13 @@ #include #include -#include -#include -#include +#include +#include +#include namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { /// Represents operations against a matter-defined data model. /// @@ -38,10 +38,10 @@ namespace InteractionModel { /// thread or equivalent /// - class is allowed to attempt to cache indexes/locations for faster /// lookups of things (e.g during iterations) -class DataModel : public DataModelMetadataTree +class Provider : public ProviderMetadataTree { public: - virtual ~DataModel() = default; + virtual ~Provider() = default; // `context` pointers will be guaranteed valid until Shutdown is called() virtual CHIP_ERROR Startup(InteractionModelContext context) @@ -107,6 +107,6 @@ class DataModel : public DataModelMetadataTree InteractionModelContext mContext = { nullptr }; }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/DataModelChangeListener.h b/src/app/data-model-provider/ProviderChangeListener.h similarity index 90% rename from src/app/data-model-interface/DataModelChangeListener.h rename to src/app/data-model-provider/ProviderChangeListener.h index a5ba12684baffe..97061865921b0f 100644 --- a/src/app/data-model-interface/DataModelChangeListener.h +++ b/src/app/data-model-provider/ProviderChangeListener.h @@ -20,7 +20,7 @@ namespace chip { namespace app { -namespace InteractionModel { +namespace DataModel { /// Notification listener for changes of the underlying data in a /// data model. @@ -31,10 +31,10 @@ namespace InteractionModel { /// Methods on this class MUST be called from within the matter /// main loop as they will likely trigger interaction model /// internal updates and subscription data reporting. -class DataModelChangeListener +class ProviderChangeListener { public: - virtual ~DataModelChangeListener() = default; + virtual ~ProviderChangeListener() = default; /// Mark all attributes matching the given path (which may be a wildcard) dirty. /// @@ -42,6 +42,6 @@ class DataModelChangeListener virtual void MarkDirty(const ConcreteAttributePath & path) = 0; }; -} // namespace InteractionModel +} // namespace DataModel } // namespace app } // namespace chip diff --git a/src/app/data-model-interface/tests/BUILD.gn b/src/app/data-model-provider/tests/BUILD.gn similarity index 94% rename from src/app/data-model-interface/tests/BUILD.gn rename to src/app/data-model-provider/tests/BUILD.gn index 94faf695f687af..23107b9b5b1fd8 100644 --- a/src/app/data-model-interface/tests/BUILD.gn +++ b/src/app/data-model-provider/tests/BUILD.gn @@ -22,7 +22,7 @@ chip_test_suite("tests") { cflags = [ "-Wconversion" ] public_deps = [ - "${chip_root}/src/app/data-model-interface", + "${chip_root}/src/app/data-model-provider", "${chip_root}/src/lib/core:string-builder-adapters", ] } diff --git a/src/app/data-model-interface/tests/TestEventEmitting.cpp b/src/app/data-model-provider/tests/TestEventEmitting.cpp similarity index 98% rename from src/app/data-model-interface/tests/TestEventEmitting.cpp rename to src/app/data-model-provider/tests/TestEventEmitting.cpp index fe4e37e57b7dd0..36dd28312cc73c 100644 --- a/src/app/data-model-interface/tests/TestEventEmitting.cpp +++ b/src/app/data-model-provider/tests/TestEventEmitting.cpp @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include #include @@ -28,7 +28,7 @@ namespace { using namespace chip; using namespace chip::app; -using namespace chip::app::InteractionModel; +using namespace chip::app::DataModel; using StartUpEventType = chip::app::Clusters::BasicInformation::Events::StartUp::Type; using AccessControlEntryChangedType = chip::app::Clusters::AccessControl::Events::AccessControlEntryChanged::Type; diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 50e23498aeeadb..faf76e031e177e 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -182,7 +182,7 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu ConcreteReadAttributePath pathForRetrieval(readPath); // Load the saved state from previous encoding session for chunking of one single attribute (list chunking). AttributeEncodeState encodeState = apReadHandler->GetAttributeEncodeState(); - err = Impl::RetrieveClusterData(mpImEngine->GetDataModel(), apReadHandler->GetSubjectDescriptor(), + err = Impl::RetrieveClusterData(mpImEngine->GetDataModelProvider(), apReadHandler->GetSubjectDescriptor(), apReadHandler->IsFabricFiltered(), attributeReportIBs, pathForRetrieval, &encodeState); if (err != CHIP_NO_ERROR) { diff --git a/src/app/reporting/Read-Checked.cpp b/src/app/reporting/Read-Checked.cpp index 76a6d1378eb653..3b434d5da5f624 100644 --- a/src/app/reporting/Read-Checked.cpp +++ b/src/app/reporting/Read-Checked.cpp @@ -50,7 +50,7 @@ class ScopedAttributeReportIBsBuilderState } // namespace -CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Access::SubjectDescriptor & subjectDescriptor, +CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { diff --git a/src/app/reporting/Read-Checked.h b/src/app/reporting/Read-Checked.h index 6df9715fcc3da9..2652d4f98c86d7 100644 --- a/src/app/reporting/Read-Checked.h +++ b/src/app/reporting/Read-Checked.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include namespace chip { @@ -27,7 +27,7 @@ namespace app { namespace reporting { namespace CheckedImpl { -CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Access::SubjectDescriptor & subjectDescriptor, +CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); diff --git a/src/app/reporting/Read-DataModel.cpp b/src/app/reporting/Read-DataModel.cpp index c004853cdaa495..9364d5c5fde9ce 100644 --- a/src/app/reporting/Read-DataModel.cpp +++ b/src/app/reporting/Read-DataModel.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include namespace chip { @@ -33,7 +33,7 @@ bool IsOutOfSpaceError(CHIP_ERROR err) } // namespace -CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Access::SubjectDescriptor & subjectDescriptor, +CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { @@ -45,17 +45,17 @@ CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Ac DataModelCallbacks::OperationOrder::Pre, path); #endif // !CHIP_CONFIG_USE_EMBER_DATA_MODEL - InteractionModel::ReadAttributeRequest readRequest; + DataModel::ReadAttributeRequest readRequest; if (isFabricFiltered) { - readRequest.readFlags.Set(InteractionModel::ReadFlags::kFabricFiltered); + readRequest.readFlags.Set(DataModel::ReadFlags::kFabricFiltered); } readRequest.subjectDescriptor = subjectDescriptor; readRequest.path = path; DataVersion version = 0; - if (std::optional clusterInfo = dataModel->GetClusterInfo(path); clusterInfo.has_value()) + if (std::optional clusterInfo = dataModel->GetClusterInfo(path); clusterInfo.has_value()) { version = clusterInfo->dataVersion; } diff --git a/src/app/reporting/Read-DataModel.h b/src/app/reporting/Read-DataModel.h index 231429c4a2e242..346ebb2340f6d7 100644 --- a/src/app/reporting/Read-DataModel.h +++ b/src/app/reporting/Read-DataModel.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include namespace chip { @@ -27,7 +27,7 @@ namespace app { namespace reporting { namespace DataModelImpl { -CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Access::SubjectDescriptor & subjectDescriptor, +CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); diff --git a/src/app/reporting/Read-Ember.cpp b/src/app/reporting/Read-Ember.cpp index 290c4e627ac7bb..3e9ad543a6e2b4 100644 --- a/src/app/reporting/Read-Ember.cpp +++ b/src/app/reporting/Read-Ember.cpp @@ -25,7 +25,7 @@ namespace app { namespace reporting { namespace EmberImpl { -CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Access::SubjectDescriptor & subjectDescriptor, +CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { diff --git a/src/app/reporting/Read-Ember.h b/src/app/reporting/Read-Ember.h index 0181734d205053..5ff3fff4103dc5 100644 --- a/src/app/reporting/Read-Ember.h +++ b/src/app/reporting/Read-Ember.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include namespace chip { @@ -27,7 +27,7 @@ namespace app { namespace reporting { namespace EmberImpl { -CHIP_ERROR RetrieveClusterData(InteractionModel::DataModel * dataModel, const Access::SubjectDescriptor & subjectDescriptor, +CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index e600fbeb3f1987..681f16aedc1e6c 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -229,7 +229,7 @@ chip_test_suite("tests") { ":thread-network-directory-test-srcs", ":time-sync-data-provider-test-srcs", "${chip_root}/src/app", - "${chip_root}/src/app/codegen-data-model:instance-header", + "${chip_root}/src/app/codegen-data-model-provider:instance-header", "${chip_root}/src/app/common:cluster-objects", "${chip_root}/src/app/icd/client:manager", "${chip_root}/src/app/tests:helpers", diff --git a/src/app/tests/TestAclAttribute.cpp b/src/app/tests/TestAclAttribute.cpp index c11adde08d6208..264137dbfbdd8b 100644 --- a/src/app/tests/TestAclAttribute.cpp +++ b/src/app/tests/TestAclAttribute.cpp @@ -118,17 +118,17 @@ class TestAclAttribute : public Test::AppContext Access::GetAccessControl().Finish(); Access::GetAccessControl().Init(GetTestAccessControlDelegate(), gDeviceTypeResolver); - mOldModel = InteractionModelEngine::GetInstance()->SetDataModel(&TestImCustomDataModel::Instance()); + mOldProvider = InteractionModelEngine::GetInstance()->SetDataModelProvider(&TestImCustomDataModel::Instance()); } void TearDown() override { AppContext::TearDown(); - InteractionModelEngine::GetInstance()->SetDataModel(mOldModel); + InteractionModelEngine::GetInstance()->SetDataModelProvider(mOldProvider); } private: - chip::app::InteractionModel::DataModel * mOldModel = nullptr; + chip::app::DataModel::Provider * mOldProvider = nullptr; }; // Read Client sends a malformed subscribe request, interaction model engine fails to parse the request and generates a status diff --git a/src/app/tests/TestAttributePathExpandIterator.cpp b/src/app/tests/TestAttributePathExpandIterator.cpp index 236203098c8fb8..d27c2780f2ec17 100644 --- a/src/app/tests/TestAttributePathExpandIterator.cpp +++ b/src/app/tests/TestAttributePathExpandIterator.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -133,7 +133,7 @@ TEST(TestAttributePathExpandIterator, TestAllWildcard) size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); @@ -157,7 +157,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardEndpoint) size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); @@ -184,7 +184,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardCluster) size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); @@ -211,7 +211,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardClusterGlobalAttributeNotInMet size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); @@ -245,7 +245,7 @@ TEST(TestAttributePathExpandIterator, TestWildcardAttribute) size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); @@ -270,7 +270,7 @@ TEST(TestAttributePathExpandIterator, TestNoWildcard) size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); @@ -414,7 +414,7 @@ TEST(TestAttributePathExpandIterator, TestMultipleClusInfo) size_t index = 0; - for (app::AttributePathExpandIterator iter(CodegenDataModelInstance(), &clusInfo1); iter.Get(path); iter.Next()) + for (app::AttributePathExpandIterator iter(CodegenDataModelProviderInstance(), &clusInfo1); iter.Get(path); iter.Next()) { ChipLogDetail(AppServer, "Visited Attribute: 0x%04X / " ChipLogFormatMEI " / " ChipLogFormatMEI, path.mEndpointId, ChipLogValueMEI(path.mClusterId), ChipLogValueMEI(path.mAttributeId)); diff --git a/src/app/tests/TestInteractionModelEngine.cpp b/src/app/tests/TestInteractionModelEngine.cpp index db79875b010f48..0a4a8bd5af6ef4 100644 --- a/src/app/tests/TestInteractionModelEngine.cpp +++ b/src/app/tests/TestInteractionModelEngine.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -267,7 +267,7 @@ TEST_F_FROM_FIXTURE(TestInteractionModelEngine, TestSubjectHasActiveSubscription // Create and setup readHandler 1 ReadHandler * readHandler1 = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx1, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Verify that Bob still doesn't have an active subscription EXPECT_FALSE(engine->SubjectHasActiveSubscription(bobFabricIndex, bobNodeId)); @@ -313,7 +313,7 @@ TEST_F_FROM_FIXTURE(TestInteractionModelEngine, TestSubjectHasActiveSubscription // Create readHandler 1 engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx1, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Verify that Bob still doesn't have an active subscription EXPECT_FALSE(engine->SubjectHasActiveSubscription(bobFabricIndex, bobNodeId)); @@ -321,7 +321,7 @@ TEST_F_FROM_FIXTURE(TestInteractionModelEngine, TestSubjectHasActiveSubscription // Create and setup readHandler 2 ReadHandler * readHandler2 = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx2, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Verify that Bob still doesn't have an active subscription EXPECT_FALSE(engine->SubjectHasActiveSubscription(bobFabricIndex, bobNodeId)); @@ -373,12 +373,12 @@ TEST_F_FROM_FIXTURE(TestInteractionModelEngine, TestSubjectHasActiveSubscription // Create and setup readHandler 1 ReadHandler * readHandler1 = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx1, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Create and setup readHandler 2 ReadHandler * readHandler2 = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx2, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Verify that Bob still doesn't have an active subscription EXPECT_FALSE(engine->SubjectHasActiveSubscription(bobFabricIndex, bobNodeId)); @@ -454,21 +454,21 @@ TEST_F_FROM_FIXTURE(TestInteractionModelEngine, TestSubjectHasActiveSubscription // Create and setup readHandler 1-1 engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx11, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Create and setup readHandler 1-2 ReadHandler * readHandler12 = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx12, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Create and setup readHandler 2-1 engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx21, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Create and setup readHandler 2-2 ReadHandler * readHandler22 = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx22, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Verify that both Alice and Bob have no active subscriptions EXPECT_FALSE(engine->SubjectHasActiveSubscription(bobFabricIndex, bobNodeId)); @@ -540,7 +540,7 @@ TEST_F_FROM_FIXTURE(TestInteractionModelEngine, TestSubjectHasActiveSubscription // Create readHandler ReadHandler * readHandler = engine->GetReadHandlerPool().CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); // Verify there are not active subscriptions EXPECT_FALSE(engine->SubjectHasActiveSubscription(bobFabricIndex, valideSubjectId)); diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 5c712b7c0a9a4a..e984b3ee081d89 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -272,11 +272,11 @@ class TestReadInteraction : public chip::Test::AppContext ASSERT_EQ(mEventCounter.Init(0), CHIP_NO_ERROR); chip::app::EventManagement::CreateEventManagement(&GetExchangeManager(), ArraySize(logStorageResources), gCircularEventBuffer, logStorageResources, &mEventCounter); - mOldModel = InteractionModelEngine::GetInstance()->SetDataModel(&TestImCustomDataModel::Instance()); + mOldProvider = InteractionModelEngine::GetInstance()->SetDataModelProvider(&TestImCustomDataModel::Instance()); } void TearDown() { - InteractionModelEngine::GetInstance()->SetDataModel(mOldModel); + InteractionModelEngine::GetInstance()->SetDataModelProvider(mOldProvider); chip::app::EventManagement::DestroyEventManagement(); AppContext::TearDown(); } @@ -331,7 +331,7 @@ class TestReadInteraction : public chip::Test::AppContext protected: chip::MonotonicallyIncreasingCounter mEventCounter; static bool sSyncScheduler; - chip::app::InteractionModel::DataModel * mOldModel = nullptr; + chip::app::DataModel::Provider * mOldProvider = nullptr; }; bool TestReadInteraction::sSyncScheduler = false; @@ -474,7 +474,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadHandler) { Messaging::ExchangeContext * exchangeCtx = NewExchangeToAlice(nullptr, false); ReadHandler readHandler(nullCallback, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); GenerateReportData(reportDatabuf, ReportType::kValid, false /* aSuppressResponse*/); EXPECT_EQ(readHandler.SendReportData(std::move(reportDatabuf), false), CHIP_ERROR_INCORRECT_STATE); @@ -630,7 +630,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestReadHandlerInvalidAttributePath) { Messaging::ExchangeContext * exchangeCtx = NewExchangeToAlice(nullptr, false); ReadHandler readHandler(nullCallback, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); GenerateReportData(reportDatabuf, ReportType::kValid, false /* aSuppressResponse*/); EXPECT_EQ(readHandler.SendReportData(std::move(reportDatabuf), false), CHIP_ERROR_INCORRECT_STATE); @@ -1356,7 +1356,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestProcessSubscribeRequest) { ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); writer.Init(std::move(subscribeRequestbuf)); EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); @@ -1416,7 +1416,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestSupMaxInt { ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); writer.Init(std::move(subscribeRequestbuf)); EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); @@ -1483,7 +1483,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestInfMaxInt { ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); writer.Init(std::move(subscribeRequestbuf)); EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); @@ -1550,7 +1550,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestSupMinInt { ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); writer.Init(std::move(subscribeRequestbuf)); EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); @@ -1617,7 +1617,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestMaxMinInt { ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); writer.Init(std::move(subscribeRequestbuf)); EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); @@ -1682,7 +1682,7 @@ TEST_F_FROM_FIXTURE(TestReadInteraction, TestICDProcessSubscribeRequestInvalidId { ReadHandler readHandler(*engine, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, gReportScheduler, - CodegenDataModelInstance()); + CodegenDataModelProviderInstance()); writer.Init(std::move(subscribeRequestbuf)); EXPECT_EQ(subscribeRequestBuilder.Init(&writer), CHIP_NO_ERROR); diff --git a/src/app/tests/TestReportScheduler.cpp b/src/app/tests/TestReportScheduler.cpp index f9ff58eac9e017..79ff67ec9bff25 100644 --- a/src/app/tests/TestReportScheduler.cpp +++ b/src/app/tests/TestReportScheduler.cpp @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include #include @@ -276,7 +276,7 @@ TEST_F_FROM_FIXTURE(TestReportScheduler, TestReadHandlerList) for (size_t i = 0; i < kNumMaxReadHandlers; i++) { ReadHandler * readHandler = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &sScheduler, CodegenDataModelInstance()); + &sScheduler, CodegenDataModelProviderInstance()); sScheduler.OnSubscriptionEstablished(readHandler); ASSERT_NE(nullptr, readHandler); ASSERT_NE(nullptr, sScheduler.FindReadHandlerNode(readHandler)); @@ -340,19 +340,19 @@ TEST_F_FROM_FIXTURE(TestReportScheduler, TestReportTiming) // Dirty read handler, will be triggered at min interval // Test OnReadHandler created ReadHandler * readHandler1 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &sScheduler, CodegenDataModelInstance()); + &sScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler1, &sScheduler, 1, 2)); readHandler1->ForceDirtyState(); // Clean read handler, will be triggered at max interval ReadHandler * readHandler2 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &sScheduler, CodegenDataModelInstance()); + &sScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler2, &sScheduler, 0, 3)); // Clean read handler, will be triggered at max interval, but will be cancelled before ReadHandler * readHandler3 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &sScheduler, CodegenDataModelInstance()); + &sScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler3, &sScheduler, 0, 3)); // Confirms that none of the ReadHandlers are currently reportable @@ -406,7 +406,7 @@ TEST_F_FROM_FIXTURE(TestReportScheduler, TestObserverCallbacks) sTestTimerDelegate.SetMockSystemTimestamp(Milliseconds64(0)); ReadHandler * readHandler = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &sScheduler, CodegenDataModelInstance()); + &sScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler, &sScheduler, 1, 2)); @@ -482,13 +482,13 @@ TEST_F_FROM_FIXTURE(TestReportScheduler, TestSynchronizedScheduler) sTestTimerSynchronizedDelegate.SetMockSystemTimestamp(System::Clock::Milliseconds64(0)); ReadHandler * readHandler1 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &syncScheduler, CodegenDataModelInstance()); + &syncScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler1, &syncScheduler, 0, 2)); ReadHandlerNode * node1 = syncScheduler.FindReadHandlerNode(readHandler1); ReadHandler * readHandler2 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &syncScheduler, CodegenDataModelInstance()); + &syncScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler2, &syncScheduler, 1, 3)); ReadHandlerNode * node2 = syncScheduler.FindReadHandlerNode(readHandler2); @@ -616,7 +616,7 @@ TEST_F_FROM_FIXTURE(TestReportScheduler, TestSynchronizedScheduler) sTestTimerSynchronizedDelegate.IncrementMockTimestamp(System::Clock::Milliseconds64(1000)); ReadHandler * readHandler3 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &syncScheduler, CodegenDataModelInstance()); + &syncScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler3, &syncScheduler, 2, 3)); ReadHandlerNode * node3 = syncScheduler.FindReadHandlerNode(readHandler3); @@ -670,7 +670,7 @@ TEST_F_FROM_FIXTURE(TestReportScheduler, TestSynchronizedScheduler) // Now simulate a new readHandler being added with a max forcing a conflict ReadHandler * readHandler4 = readHandlerPool.CreateObject(nullCallback, exchangeCtx, ReadHandler::InteractionType::Subscribe, - &syncScheduler, CodegenDataModelInstance()); + &syncScheduler, CodegenDataModelProviderInstance()); EXPECT_EQ(CHIP_NO_ERROR, MockReadHandlerSubscriptionTransaction(readHandler4, &syncScheduler, 0, 1)); ReadHandlerNode * node4 = syncScheduler.FindReadHandlerNode(readHandler4); diff --git a/src/app/tests/TestReportingEngine.cpp b/src/app/tests/TestReportingEngine.cpp index c18fbdbf1f2dcc..f4f52b83f8bfa7 100644 --- a/src/app/tests/TestReportingEngine.cpp +++ b/src/app/tests/TestReportingEngine.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -59,12 +59,12 @@ class TestReportingEngine : public chip::Test::AppContext void SetUp() override { chip::Test::AppContext::SetUp(); - mOldModel = InteractionModelEngine::GetInstance()->SetDataModel(&TestImCustomDataModel::Instance()); + mOldProvider = InteractionModelEngine::GetInstance()->SetDataModelProvider(&TestImCustomDataModel::Instance()); } void TearDown() override { - InteractionModelEngine::GetInstance()->SetDataModel(mOldModel); + InteractionModelEngine::GetInstance()->SetDataModelProvider(mOldProvider); chip::Test::AppContext::TearDown(); } @@ -77,7 +77,7 @@ class TestReportingEngine : public chip::Test::AppContext void TestMergeAttributePathWhenDirtySetPoolExhausted(); private: - chip::app::InteractionModel::DataModel * mOldModel = nullptr; + chip::app::DataModel::Provider * mOldProvider = nullptr; struct ExpectedDirtySetContent : public AttributePathParams { @@ -186,7 +186,7 @@ TEST_F_FROM_FIXTURE(TestReportingEngine, TestBuildAndSendSingleReportData) EXPECT_EQ(readRequestBuilder.GetError(), CHIP_NO_ERROR); EXPECT_EQ(writer.Finalize(&readRequestbuf), CHIP_NO_ERROR); app::ReadHandler readHandler(dummy, exchangeCtx, chip::app::ReadHandler::InteractionType::Read, - app::reporting::GetDefaultReportScheduler(), CodegenDataModelInstance()); + app::reporting::GetDefaultReportScheduler(), CodegenDataModelProviderInstance()); readHandler.OnInitialRequest(std::move(readRequestbuf)); EXPECT_EQ(InteractionModelEngine::GetInstance()->GetReportingEngine().BuildAndSendSingleReportData(&readHandler), diff --git a/src/app/tests/test-interaction-model-api.cpp b/src/app/tests/test-interaction-model-api.cpp index 444516a79ddf1a..f626d061c2b107 100644 --- a/src/app/tests/test-interaction-model-api.cpp +++ b/src/app/tests/test-interaction-model-api.cpp @@ -17,14 +17,14 @@ #include #include -#include +#include #include #include #include #include #include -using namespace chip::app::InteractionModel; +using namespace chip::app::DataModel; namespace chip { uint8_t Test::attributeDataTLV[CHIP_CONFIG_DEFAULT_UDP_MTU_SIZE]; @@ -180,67 +180,67 @@ CHIP_ERROR TestImCustomDataModel::Invoke(const InvokeRequest & request, chip::TL EndpointId TestImCustomDataModel::FirstEndpoint() { - return CodegenDataModelInstance()->FirstEndpoint(); + return CodegenDataModelProviderInstance()->FirstEndpoint(); } EndpointId TestImCustomDataModel::NextEndpoint(EndpointId before) { - return CodegenDataModelInstance()->NextEndpoint(before); + return CodegenDataModelProviderInstance()->NextEndpoint(before); } ClusterEntry TestImCustomDataModel::FirstCluster(EndpointId endpoint) { - return CodegenDataModelInstance()->FirstCluster(endpoint); + return CodegenDataModelProviderInstance()->FirstCluster(endpoint); } ClusterEntry TestImCustomDataModel::NextCluster(const ConcreteClusterPath & before) { - return CodegenDataModelInstance()->NextCluster(before); + return CodegenDataModelProviderInstance()->NextCluster(before); } std::optional TestImCustomDataModel::GetClusterInfo(const ConcreteClusterPath & path) { - return CodegenDataModelInstance()->GetClusterInfo(path); + return CodegenDataModelProviderInstance()->GetClusterInfo(path); } AttributeEntry TestImCustomDataModel::FirstAttribute(const ConcreteClusterPath & cluster) { - return CodegenDataModelInstance()->FirstAttribute(cluster); + return CodegenDataModelProviderInstance()->FirstAttribute(cluster); } AttributeEntry TestImCustomDataModel::NextAttribute(const ConcreteAttributePath & before) { - return CodegenDataModelInstance()->NextAttribute(before); + return CodegenDataModelProviderInstance()->NextAttribute(before); } std::optional TestImCustomDataModel::GetAttributeInfo(const ConcreteAttributePath & path) { - return CodegenDataModelInstance()->GetAttributeInfo(path); + return CodegenDataModelProviderInstance()->GetAttributeInfo(path); } CommandEntry TestImCustomDataModel::FirstAcceptedCommand(const ConcreteClusterPath & cluster) { - return CodegenDataModelInstance()->FirstAcceptedCommand(cluster); + return CodegenDataModelProviderInstance()->FirstAcceptedCommand(cluster); } CommandEntry TestImCustomDataModel::NextAcceptedCommand(const ConcreteCommandPath & before) { - return CodegenDataModelInstance()->NextAcceptedCommand(before); + return CodegenDataModelProviderInstance()->NextAcceptedCommand(before); } std::optional TestImCustomDataModel::GetAcceptedCommandInfo(const ConcreteCommandPath & path) { - return CodegenDataModelInstance()->GetAcceptedCommandInfo(path); + return CodegenDataModelProviderInstance()->GetAcceptedCommandInfo(path); } ConcreteCommandPath TestImCustomDataModel::FirstGeneratedCommand(const ConcreteClusterPath & cluster) { - return CodegenDataModelInstance()->FirstGeneratedCommand(cluster); + return CodegenDataModelProviderInstance()->FirstGeneratedCommand(cluster); } ConcreteCommandPath TestImCustomDataModel::NextGeneratedCommand(const ConcreteCommandPath & before) { - return CodegenDataModelInstance()->NextGeneratedCommand(before); + return CodegenDataModelProviderInstance()->NextGeneratedCommand(before); } } // namespace app diff --git a/src/app/tests/test-interaction-model-api.h b/src/app/tests/test-interaction-model-api.h index e88fee62ec1d23..ccaf6514890546 100644 --- a/src/app/tests/test-interaction-model-api.h +++ b/src/app/tests/test-interaction-model-api.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -111,29 +111,29 @@ bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint); /// TODO items for above: /// - once IM only supports DataModel /// - break ember-overrides in this h/cpp file -class TestImCustomDataModel : public InteractionModel::DataModel +class TestImCustomDataModel : public DataModel::Provider { public: static TestImCustomDataModel & Instance(); CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const InteractionModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const InteractionModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const InteractionModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; + CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; + CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; - InteractionModel::ClusterEntry FirstCluster(EndpointId endpoint) override; - InteractionModel::ClusterEntry NextCluster(const ConcreteClusterPath & before) override; - std::optional GetClusterInfo(const ConcreteClusterPath & path) override; - InteractionModel::AttributeEntry FirstAttribute(const ConcreteClusterPath & cluster) override; - InteractionModel::AttributeEntry NextAttribute(const ConcreteAttributePath & before) override; - std::optional GetAttributeInfo(const ConcreteAttributePath & path) override; - InteractionModel::CommandEntry FirstAcceptedCommand(const ConcreteClusterPath & cluster) override; - InteractionModel::CommandEntry NextAcceptedCommand(const ConcreteCommandPath & before) override; - std::optional GetAcceptedCommandInfo(const ConcreteCommandPath & path) override; + DataModel::ClusterEntry FirstCluster(EndpointId endpoint) override; + DataModel::ClusterEntry NextCluster(const ConcreteClusterPath & before) override; + std::optional GetClusterInfo(const ConcreteClusterPath & path) override; + DataModel::AttributeEntry FirstAttribute(const ConcreteClusterPath & cluster) override; + DataModel::AttributeEntry NextAttribute(const ConcreteAttributePath & before) override; + std::optional GetAttributeInfo(const ConcreteAttributePath & path) override; + DataModel::CommandEntry FirstAcceptedCommand(const ConcreteClusterPath & cluster) override; + DataModel::CommandEntry NextAcceptedCommand(const ConcreteCommandPath & before) override; + std::optional GetAcceptedCommandInfo(const ConcreteCommandPath & path) override; ConcreteCommandPath FirstGeneratedCommand(const ConcreteClusterPath & cluster) override; ConcreteCommandPath NextGeneratedCommand(const ConcreteCommandPath & before) override; }; diff --git a/src/app/util/mock/BUILD.gn b/src/app/util/mock/BUILD.gn index fa57cf4e9e71e9..db566aad578793 100644 --- a/src/app/util/mock/BUILD.gn +++ b/src/app/util/mock/BUILD.gn @@ -14,7 +14,7 @@ import("//build_overrides/chip.gni") -import("${chip_root}/src/app/codegen-data-model/model.gni") +import("${chip_root}/src/app/codegen-data-model-provider/model.gni") config("mock_include") { include_dirs = [ "include" ] diff --git a/src/controller/tests/data_model/BUILD.gn b/src/controller/tests/data_model/BUILD.gn index 692696d3be2548..9bf2eac9391bac 100644 --- a/src/controller/tests/data_model/BUILD.gn +++ b/src/controller/tests/data_model/BUILD.gn @@ -41,7 +41,7 @@ chip_test_suite("data_model") { public_deps = [ "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", - "${chip_root}/src/app/data-model-interface", + "${chip_root}/src/app/data-model-provider", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util/mock:mock_codegen_data_model", "${chip_root}/src/app/util/mock:mock_ember", diff --git a/src/controller/tests/data_model/DataModelFixtures.cpp b/src/controller/tests/data_model/DataModelFixtures.cpp index eb043acd04353d..ff22f2063e6e62 100644 --- a/src/controller/tests/data_model/DataModelFixtures.cpp +++ b/src/controller/tests/data_model/DataModelFixtures.cpp @@ -23,12 +23,12 @@ #include #include #include -#include +#include using namespace chip; using namespace chip::app; using namespace chip::app::DataModelTests; -using namespace chip::app::InteractionModel; +using namespace chip::app::DataModel; using namespace chip::app::Clusters; using namespace chip::app::Clusters::UnitTesting; using namespace chip::Protocols; @@ -531,67 +531,67 @@ CHIP_ERROR CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLV EndpointId CustomDataModel::FirstEndpoint() { - return CodegenDataModelInstance()->FirstEndpoint(); + return CodegenDataModelProviderInstance()->FirstEndpoint(); } EndpointId CustomDataModel::NextEndpoint(EndpointId before) { - return CodegenDataModelInstance()->NextEndpoint(before); + return CodegenDataModelProviderInstance()->NextEndpoint(before); } ClusterEntry CustomDataModel::FirstCluster(EndpointId endpoint) { - return CodegenDataModelInstance()->FirstCluster(endpoint); + return CodegenDataModelProviderInstance()->FirstCluster(endpoint); } ClusterEntry CustomDataModel::NextCluster(const ConcreteClusterPath & before) { - return CodegenDataModelInstance()->NextCluster(before); + return CodegenDataModelProviderInstance()->NextCluster(before); } std::optional CustomDataModel::GetClusterInfo(const ConcreteClusterPath & path) { - return CodegenDataModelInstance()->GetClusterInfo(path); + return CodegenDataModelProviderInstance()->GetClusterInfo(path); } AttributeEntry CustomDataModel::FirstAttribute(const ConcreteClusterPath & cluster) { - return CodegenDataModelInstance()->FirstAttribute(cluster); + return CodegenDataModelProviderInstance()->FirstAttribute(cluster); } AttributeEntry CustomDataModel::NextAttribute(const ConcreteAttributePath & before) { - return CodegenDataModelInstance()->NextAttribute(before); + return CodegenDataModelProviderInstance()->NextAttribute(before); } std::optional CustomDataModel::GetAttributeInfo(const ConcreteAttributePath & path) { - return CodegenDataModelInstance()->GetAttributeInfo(path); + return CodegenDataModelProviderInstance()->GetAttributeInfo(path); } CommandEntry CustomDataModel::FirstAcceptedCommand(const ConcreteClusterPath & cluster) { - return CodegenDataModelInstance()->FirstAcceptedCommand(cluster); + return CodegenDataModelProviderInstance()->FirstAcceptedCommand(cluster); } CommandEntry CustomDataModel::NextAcceptedCommand(const ConcreteCommandPath & before) { - return CodegenDataModelInstance()->NextAcceptedCommand(before); + return CodegenDataModelProviderInstance()->NextAcceptedCommand(before); } std::optional CustomDataModel::GetAcceptedCommandInfo(const ConcreteCommandPath & path) { - return CodegenDataModelInstance()->GetAcceptedCommandInfo(path); + return CodegenDataModelProviderInstance()->GetAcceptedCommandInfo(path); } ConcreteCommandPath CustomDataModel::FirstGeneratedCommand(const ConcreteClusterPath & cluster) { - return CodegenDataModelInstance()->FirstGeneratedCommand(cluster); + return CodegenDataModelProviderInstance()->FirstGeneratedCommand(cluster); } ConcreteCommandPath CustomDataModel::NextGeneratedCommand(const ConcreteCommandPath & before) { - return CodegenDataModelInstance()->NextGeneratedCommand(before); + return CodegenDataModelProviderInstance()->NextGeneratedCommand(before); } } // namespace app diff --git a/src/controller/tests/data_model/DataModelFixtures.h b/src/controller/tests/data_model/DataModelFixtures.h index 405b4ff4d4e7d8..a36e905c23ce41 100644 --- a/src/controller/tests/data_model/DataModelFixtures.h +++ b/src/controller/tests/data_model/DataModelFixtures.h @@ -22,7 +22,7 @@ #pragma once #include -#include +#include #include #include #include @@ -108,29 +108,29 @@ extern CommandHandler::Handle gAsyncCommandHandle; /// TODO items for above: /// - once IM only supports DataModel /// - break ember-overrides in this h/cpp file -class CustomDataModel : public InteractionModel::DataModel +class CustomDataModel : public DataModel::Provider { public: static CustomDataModel & Instance(); CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const InteractionModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const InteractionModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const InteractionModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; + CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; + CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; - InteractionModel::ClusterEntry FirstCluster(EndpointId endpoint) override; - InteractionModel::ClusterEntry NextCluster(const ConcreteClusterPath & before) override; - std::optional GetClusterInfo(const ConcreteClusterPath & path) override; - InteractionModel::AttributeEntry FirstAttribute(const ConcreteClusterPath & cluster) override; - InteractionModel::AttributeEntry NextAttribute(const ConcreteAttributePath & before) override; - std::optional GetAttributeInfo(const ConcreteAttributePath & path) override; - InteractionModel::CommandEntry FirstAcceptedCommand(const ConcreteClusterPath & cluster) override; - InteractionModel::CommandEntry NextAcceptedCommand(const ConcreteCommandPath & before) override; - std::optional GetAcceptedCommandInfo(const ConcreteCommandPath & path) override; + DataModel::ClusterEntry FirstCluster(EndpointId endpoint) override; + DataModel::ClusterEntry NextCluster(const ConcreteClusterPath & before) override; + std::optional GetClusterInfo(const ConcreteClusterPath & path) override; + DataModel::AttributeEntry FirstAttribute(const ConcreteClusterPath & cluster) override; + DataModel::AttributeEntry NextAttribute(const ConcreteAttributePath & before) override; + std::optional GetAttributeInfo(const ConcreteAttributePath & path) override; + DataModel::CommandEntry FirstAcceptedCommand(const ConcreteClusterPath & cluster) override; + DataModel::CommandEntry NextAcceptedCommand(const ConcreteCommandPath & before) override; + std::optional GetAcceptedCommandInfo(const ConcreteCommandPath & path) override; ConcreteCommandPath FirstGeneratedCommand(const ConcreteClusterPath & cluster) override; ConcreteCommandPath NextGeneratedCommand(const ConcreteCommandPath & before) override; }; diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index 1281d9190c56bc..c2c2e63689f932 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -56,13 +56,13 @@ class TestRead : public chip::Test::AppContext, public app::ReadHandler::Applica void SetUp() override { chip::Test::AppContext::SetUp(); - mOldModel = InteractionModelEngine::GetInstance()->SetDataModel(&CustomDataModel::Instance()); + mOldProvider = InteractionModelEngine::GetInstance()->SetDataModelProvider(&CustomDataModel::Instance()); } // Performs teardown for each individual test in the test suite void TearDown() override { - InteractionModelEngine::GetInstance()->SetDataModel(mOldModel); + InteractionModelEngine::GetInstance()->SetDataModelProvider(mOldProvider); chip::Test::AppContext::TearDown(); } @@ -97,10 +97,10 @@ class TestRead : public chip::Test::AppContext, public app::ReadHandler::Applica // max-interval to time out. static System::Clock::Timeout ComputeSubscriptionTimeout(System::Clock::Seconds16 aMaxInterval); - bool mEmitSubscriptionError = false; - int32_t mNumActiveSubscriptions = 0; - bool mAlterSubscriptionIntervals = false; - chip::app::InteractionModel::DataModel * mOldModel = nullptr; + bool mEmitSubscriptionError = false; + int32_t mNumActiveSubscriptions = 0; + bool mAlterSubscriptionIntervals = false; + chip::app::DataModel::Provider * mOldProvider = nullptr; }; uint16_t TestRead::mMaxInterval = 66; From 6da66b7d51fe79afc141160c015fb937827c0105 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Wed, 31 Jul 2024 10:48:53 -0400 Subject: [PATCH 06/40] TC-LVL-2.3: Wording tweaks / approximate first report (#34665) * TC-LVL-2.3: Wording tweaks / approximate first report * add missing skip marker --- src/python_testing/TC_LVL_2_3.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/python_testing/TC_LVL_2_3.py b/src/python_testing/TC_LVL_2_3.py index 57fbe2b7edc367..8d31b8641c3f7e 100644 --- a/src/python_testing/TC_LVL_2_3.py +++ b/src/python_testing/TC_LVL_2_3.py @@ -51,7 +51,7 @@ def steps_TC_LVL_2_3(self) -> list[TestStep]: test_plan_support.verify_success()), TestStep(6, "Set up a subscription wildcard subscription for the Level Control Cluster, with MinIntervalFloor set to 0, MaxIntervalCeiling set to 30 and KeepSubscriptions set to false", "Subscription successfully established"), - TestStep(7, f"{THcommand} MoveToLevel with Level field set to maxLevel, TransitionTime field set to 10 and remaining fields set to 0", + TestStep(7, f"{THcommand} MoveToLevel with Level field set to maxLevel, TransitionTime field set to 100 (10s) and remaining fields set to 0", test_plan_support.verify_success()), TestStep(8, "TH stores the reported values of CurrentLevel in all incoming reports for CurrentLevel attribute, that contains data in reportedCurrentLevelValuesList, over a period of 30 seconds."), TestStep(9, "TH verifies that reportedCurrentLevelValuesList does not contain more than 10 entries for CurrentLevel", @@ -65,18 +65,18 @@ def steps_TC_LVL_2_3(self) -> list[TestStep]: TestStep(13, "If the LT feature is not supported, skip remaining steps and end test case"), # 14 is missing in the test plan TestStep(15, "TH stores the reported values of RemainingTime in all incoming reports for RemainingTime attribute, that contains data in reportedRemainingTimeValuesList."), - TestStep(16, f" {THcommand} MoveToLevel with Level field set to startCurrentLevel, TransitionTime field set to 10 and remaining fields set to 0", + TestStep(16, f" {THcommand} MoveToLevel with Level field set to startCurrentLevel, TransitionTime field set to 100 (10s) and remaining fields set to 0", test_plan_support.verify_success()), TestStep(17, "Wait for 5 seconds"), - TestStep(18, f"{THcommand} MoveToLevel with Level field set to startCurrentLevel, TransitionTime field set to 15 and remaining fields set to 0", + TestStep(18, f"{THcommand} MoveToLevel with Level field set to startCurrentLevel, TransitionTime field set to 150 (15s) and remaining fields set to 0", test_plan_support.verify_success()), TestStep(19, "Wait for 20 seconds"), TestStep(20, "TH verifies reportedRemainingTimeValuesList contains three entries", "reportedRemainingTimeValuesList has 3 entries in the list"), - TestStep(21, "TH verifies the first entry in reportedRemainingTimeValuesList is 10", - "The first entry in reportedRemainingTimeValuesList is equal to 10"), - TestStep(22, "TH verifies the second entry in reportedRemainingTimeValuesList is 15", - "The second entry in reportedRemainingTimeValuesList is equal to 15"), + TestStep(21, "TH verifies the first entry in reportedRemainingTimeValuesList is approximately 100 (10s)", + "The first entry in reportedRemainingTimeValuesList is approximately equal to 100"), + TestStep(22, "TH verifies the second entry in reportedRemainingTimeValuesList is approximately 150", + "The second entry in reportedRemainingTimeValuesList is approximately equal to 150"), TestStep(23, "TH verifies the third entry in reportedRemainingTimeValuesList is 0", "The third entry in reportedRemainingTimeValuesList is equal to 0") ] @@ -127,6 +127,8 @@ async def test_TC_LVL_2_3(self): if count == 1: entry = sub_handler.attribute_reports[lvl.Attributes.CurrentLevel][-1] asserts.assert_equal(entry.value, max_level, "Entry is not equal to max level") + else: + self.mark_current_step_skipped() if count > 1: self.step(11) @@ -173,7 +175,7 @@ async def test_TC_LVL_2_3(self): self.step(21) remaining_time = sub_handler.attribute_reports[lvl.Attributes.RemainingTime] logging.info(f'Reamining time reports: {remaining_time}') - asserts.assert_equal(remaining_time[0].value, 100, "Unexpected first RemainingTime report") + asserts.assert_almost_equal(remaining_time[0].value, 100, delta=10, msg="Unexpected first RemainingTime report") self.step(22) asserts.assert_almost_equal(remaining_time[1].value, 150, delta=10, msg="Unexpected second RemainingTime report") From 1a7d048d75fdab47e39d828fcb2ea57fb63dccba Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Thu, 1 Aug 2024 03:35:42 +0900 Subject: [PATCH 07/40] [Darwin] Implement MTREventNameForID function (#34653) * Implement MTREventNameForID in darwin * Restyled by whitespace --------- Co-authored-by: Restyled.io --- src/darwin/Framework/CHIP/MTRClusterNames.h | 9 + .../CHIP/templates/MTRClusterNames-src.zapt | 56 + .../CHIP/zap-generated/MTRClusterNames.mm | 1854 +++++++++++++++++ 3 files changed, 1919 insertions(+) diff --git a/src/darwin/Framework/CHIP/MTRClusterNames.h b/src/darwin/Framework/CHIP/MTRClusterNames.h index 379757b5bd4a06..c13edf44e574b2 100644 --- a/src/darwin/Framework/CHIP/MTRClusterNames.h +++ b/src/darwin/Framework/CHIP/MTRClusterNames.h @@ -41,3 +41,12 @@ MTR_EXTERN MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) NSSt * will be returned. */ MTR_EXTERN MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)) NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType attributeID); + +/** + * Resolve Matter event IDs into a descriptive string. + * + * For unknown IDs, a string '' (if the cluster ID is not known) + * or '' (if the cluster ID is known but the event ID is not known) + * will be returned. + */ +MTR_EXTERN MTR_NEWLY_AVAILABLE NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID); diff --git a/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt index b495d79b1b4c72..1c18b6a2489b2a 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusterNames-src.zapt @@ -75,6 +75,62 @@ NSString * MTRAttributeNameForID(MTRClusterIDType clusterID, MTRAttributeIDType result = [NSString stringWithFormat:@"", attributeID]; break; } + break; +{{/if}} + +{{/zcl_clusters}} + default: + result = [NSString stringWithFormat:@"", clusterID]; + break; + } + + return result; +} + + +#pragma mark - Event IDs + +NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID) +{ + NSString * result = nil; + + switch (clusterID) { + +{{#zcl_clusters}} +{{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} +{{~#*inline "cluster"}}{{asUpperCamelCase label preserveAcronyms=true}}{{/inline~}} + case MTRClusterIDType{{>cluster}}ID: + + switch (eventID) { + +{{/if}} + +{{#*inline "eventIDs"}} +{{#zcl_events}} +{{~#*inline "cluster"}}{{asUpperCamelCase ../clusterName preserveAcronyms=true}}{{/inline~}} +{{~#*inline "event"}}{{asUpperCamelCase name preserveAcronyms=true}}{{/inline~}} +{{#first}} +{{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) isForIds=true)}} +// Cluster {{> cluster}} events +{{/if}} +{{/first}} +{{#if (isSupported (asUpperCamelCase ../clusterName preserveAcronyms=true) event=(asUpperCamelCase name preserveAcronyms=true) isForIds=true)}} + case MTREventIDTypeCluster{{>cluster}}Event{{>event}}ID: + result = @"{{>event}}"; + break; + +{{/if}} +{{/zcl_events}} +{{/inline}} + +{{> eventIDs clusterName=label}} + +{{#if (isSupported (asUpperCamelCase label preserveAcronyms=true) isForIds=true)}} + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; {{/if}} {{/zcl_clusters}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 406d253ba5fb00..a46ab76ca9cc17 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -451,6 +451,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeGroupsID: @@ -489,6 +490,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOnOffID: @@ -543,6 +545,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOnOffSwitchConfigurationID: @@ -585,6 +588,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeLevelControlID: @@ -675,6 +679,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBinaryInputBasicID: @@ -745,6 +750,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePulseWidthModulationID: @@ -779,6 +785,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDescriptorID: @@ -833,6 +840,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBindingID: @@ -871,6 +879,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeAccessControlID: @@ -933,6 +942,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeActionsID: @@ -979,6 +989,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBasicInformationID: @@ -1105,6 +1116,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOTASoftwareUpdateProviderID: @@ -1139,6 +1151,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOTASoftwareUpdateRequestorID: @@ -1189,6 +1202,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeLocalizationConfigurationID: @@ -1231,6 +1245,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTimeFormatLocalizationID: @@ -1277,6 +1292,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeUnitLocalizationID: @@ -1315,6 +1331,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePowerSourceConfigurationID: @@ -1353,6 +1370,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePowerSourceID: @@ -1515,6 +1533,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeGeneralCommissioningID: @@ -1585,6 +1604,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeNetworkCommissioningID: @@ -1663,6 +1683,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDiagnosticLogsID: @@ -1697,6 +1718,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeGeneralDiagnosticsID: @@ -1767,6 +1789,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeSoftwareDiagnosticsID: @@ -1817,6 +1840,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeThreadNetworkDiagnosticsID: @@ -2103,6 +2127,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeWiFiNetworkDiagnosticsID: @@ -2189,6 +2214,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeEthernetNetworkDiagnosticsID: @@ -2259,6 +2285,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTimeSynchronizationID: @@ -2345,6 +2372,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBridgedDeviceBasicInformationID: @@ -2443,6 +2471,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeSwitchID: @@ -2489,6 +2518,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeAdministratorCommissioningID: @@ -2535,6 +2565,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOperationalCredentialsID: @@ -2593,6 +2624,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeGroupKeyManagementID: @@ -2643,6 +2675,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeFixedLabelID: @@ -2681,6 +2714,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeUserLabelID: @@ -2719,6 +2753,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBooleanStateID: @@ -2757,6 +2792,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeICDManagementID: @@ -2831,6 +2867,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTimerID: @@ -2877,6 +2914,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOvenCavityOperationalStateID: @@ -2935,6 +2973,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOvenModeID: @@ -2985,6 +3024,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeLaundryDryerControlsID: @@ -3027,6 +3067,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeModeSelectID: @@ -3085,6 +3126,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeLaundryWasherModeID: @@ -3135,6 +3177,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRefrigeratorAndTemperatureControlledCabinetModeID: @@ -3185,6 +3228,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeLaundryWasherControlsID: @@ -3235,6 +3279,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRVCRunModeID: @@ -3277,6 +3322,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRVCCleanModeID: @@ -3319,6 +3365,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTemperatureControlID: @@ -3377,6 +3424,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRefrigeratorAlarmID: @@ -3423,6 +3471,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDishwasherModeID: @@ -3473,6 +3522,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeAirQualityID: @@ -3511,6 +3561,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeSmokeCOAlarmID: @@ -3597,6 +3648,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDishwasherAlarmID: @@ -3647,6 +3699,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeMicrowaveOvenModeID: @@ -3689,6 +3742,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeMicrowaveOvenControlID: @@ -3759,6 +3813,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOperationalStateID: @@ -3817,6 +3872,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRVCOperationalStateID: @@ -3875,6 +3931,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeScenesManagementID: @@ -3921,6 +3978,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeHEPAFilterMonitoringID: @@ -3979,6 +4037,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeActivatedCarbonFilterMonitoringID: @@ -4037,6 +4096,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBooleanStateConfigurationID: @@ -4103,6 +4163,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeValveConfigurationAndControlID: @@ -4181,6 +4242,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeElectricalPowerMeasurementID: @@ -4291,6 +4353,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeElectricalEnergyMeasurementID: @@ -4349,6 +4412,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeWaterHeaterManagementID: @@ -4407,6 +4471,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDemandResponseLoadControlID: @@ -4473,6 +4538,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeMessagesID: @@ -4515,6 +4581,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDeviceEnergyManagementID: @@ -4581,6 +4648,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeEnergyEVSEID: @@ -4707,6 +4775,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeEnergyPreferenceID: @@ -4761,6 +4830,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePowerTopologyID: @@ -4803,6 +4873,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeEnergyEVSEModeID: @@ -4853,6 +4924,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeWaterHeaterModeID: @@ -4903,6 +4975,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDeviceEnergyManagementModeID: @@ -4953,6 +5026,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeDoorLockID: @@ -5167,6 +5241,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeWindowCoveringID: @@ -5289,6 +5364,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBarrierControlID: @@ -5363,6 +5439,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeServiceAreaID: @@ -5421,6 +5498,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePumpConfigurationAndControlID: @@ -5547,6 +5625,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeThermostatID: @@ -5825,6 +5904,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeFanControlID: @@ -5907,6 +5987,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeThermostatUserInterfaceConfigurationID: @@ -5953,6 +6034,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeColorControlID: @@ -6195,6 +6277,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeBallastConfigurationID: @@ -6285,6 +6368,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeIlluminanceMeasurementID: @@ -6339,6 +6423,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTemperatureMeasurementID: @@ -6389,6 +6474,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePressureMeasurementID: @@ -6459,6 +6545,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeFlowMeasurementID: @@ -6509,6 +6596,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRelativeHumidityMeasurementID: @@ -6559,6 +6647,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOccupancySensingID: @@ -6649,6 +6738,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeCarbonMonoxideConcentrationMeasurementID: @@ -6727,6 +6817,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeCarbonDioxideConcentrationMeasurementID: @@ -6805,6 +6896,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeNitrogenDioxideConcentrationMeasurementID: @@ -6883,6 +6975,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeOzoneConcentrationMeasurementID: @@ -6961,6 +7054,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePM25ConcentrationMeasurementID: @@ -7039,6 +7133,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeFormaldehydeConcentrationMeasurementID: @@ -7117,6 +7212,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePM1ConcentrationMeasurementID: @@ -7195,6 +7291,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypePM10ConcentrationMeasurementID: @@ -7273,6 +7370,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTotalVolatileOrganicCompoundsConcentrationMeasurementID: @@ -7351,6 +7449,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeRadonConcentrationMeasurementID: @@ -7429,6 +7528,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeWiFiNetworkManagementID: @@ -7471,6 +7571,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeThreadBorderRouterManagementID: @@ -7525,6 +7626,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeThreadNetworkDirectoryID: @@ -7571,6 +7673,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeWakeOnLANID: @@ -7613,6 +7716,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeChannelID: @@ -7659,6 +7763,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeTargetNavigatorID: @@ -7701,6 +7806,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeMediaPlaybackID: @@ -7779,6 +7885,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeMediaInputID: @@ -7821,6 +7928,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeLowPowerID: @@ -7855,6 +7963,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeKeypadInputID: @@ -7889,6 +7998,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeContentLauncherID: @@ -7931,6 +8041,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeAudioOutputID: @@ -7973,6 +8084,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeApplicationLauncherID: @@ -8015,6 +8127,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeApplicationBasicID: @@ -8081,6 +8194,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeAccountLoginID: @@ -8115,6 +8229,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeContentControlID: @@ -8181,6 +8296,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeContentAppObserverID: @@ -8215,6 +8331,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeEcosystemInformationID: @@ -8261,6 +8378,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeCommissionerControlID: @@ -8299,6 +8417,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeElectricalMeasurementID: @@ -8845,6 +8964,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeUnitTestingID: @@ -9211,6 +9331,7 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; case MTRClusterIDTypeSampleMEIID: @@ -9249,6 +9370,1739 @@ result = [NSString stringWithFormat:@"", attributeID]; break; } + break; + + default: + result = [NSString stringWithFormat:@"", clusterID]; + break; + } + + return result; +} + +#pragma mark - Event IDs + +NSString * MTREventNameForID(MTRClusterIDType clusterID, MTREventIDType eventID) +{ + NSString * result = nil; + + switch (clusterID) { + + case MTRClusterIDTypeIdentifyID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeGroupsID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOnOffID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOnOffSwitchConfigurationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeLevelControlID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBinaryInputBasicID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePulseWidthModulationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDescriptorID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBindingID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeAccessControlID: + + switch (eventID) { + + // Cluster AccessControl events + case MTREventIDTypeClusterAccessControlEventAccessControlEntryChangedID: + result = @"AccessControlEntryChanged"; + break; + + case MTREventIDTypeClusterAccessControlEventAccessControlExtensionChangedID: + result = @"AccessControlExtensionChanged"; + break; + + case MTREventIDTypeClusterAccessControlEventAccessRestrictionEntryChangedID: + result = @"AccessRestrictionEntryChanged"; + break; + + case MTREventIDTypeClusterAccessControlEventFabricRestrictionReviewUpdateID: + result = @"FabricRestrictionReviewUpdate"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeActionsID: + + switch (eventID) { + + // Cluster Actions events + case MTREventIDTypeClusterActionsEventStateChangedID: + result = @"StateChanged"; + break; + + case MTREventIDTypeClusterActionsEventActionFailedID: + result = @"ActionFailed"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBasicInformationID: + + switch (eventID) { + + // Cluster BasicInformation events + case MTREventIDTypeClusterBasicInformationEventStartUpID: + result = @"StartUp"; + break; + + case MTREventIDTypeClusterBasicInformationEventShutDownID: + result = @"ShutDown"; + break; + + case MTREventIDTypeClusterBasicInformationEventLeaveID: + result = @"Leave"; + break; + + case MTREventIDTypeClusterBasicInformationEventReachableChangedID: + result = @"ReachableChanged"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOTASoftwareUpdateProviderID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOTASoftwareUpdateRequestorID: + + switch (eventID) { + + // Cluster OTASoftwareUpdateRequestor events + case MTREventIDTypeClusterOTASoftwareUpdateRequestorEventStateTransitionID: + result = @"StateTransition"; + break; + + case MTREventIDTypeClusterOTASoftwareUpdateRequestorEventVersionAppliedID: + result = @"VersionApplied"; + break; + + case MTREventIDTypeClusterOTASoftwareUpdateRequestorEventDownloadErrorID: + result = @"DownloadError"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeLocalizationConfigurationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTimeFormatLocalizationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeUnitLocalizationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePowerSourceConfigurationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePowerSourceID: + + switch (eventID) { + + // Cluster PowerSource events + case MTREventIDTypeClusterPowerSourceEventWiredFaultChangeID: + result = @"WiredFaultChange"; + break; + + case MTREventIDTypeClusterPowerSourceEventBatFaultChangeID: + result = @"BatFaultChange"; + break; + + case MTREventIDTypeClusterPowerSourceEventBatChargeFaultChangeID: + result = @"BatChargeFaultChange"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeGeneralCommissioningID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeNetworkCommissioningID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDiagnosticLogsID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeGeneralDiagnosticsID: + + switch (eventID) { + + // Cluster GeneralDiagnostics events + case MTREventIDTypeClusterGeneralDiagnosticsEventHardwareFaultChangeID: + result = @"HardwareFaultChange"; + break; + + case MTREventIDTypeClusterGeneralDiagnosticsEventRadioFaultChangeID: + result = @"RadioFaultChange"; + break; + + case MTREventIDTypeClusterGeneralDiagnosticsEventNetworkFaultChangeID: + result = @"NetworkFaultChange"; + break; + + case MTREventIDTypeClusterGeneralDiagnosticsEventBootReasonID: + result = @"BootReason"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeSoftwareDiagnosticsID: + + switch (eventID) { + + // Cluster SoftwareDiagnostics events + case MTREventIDTypeClusterSoftwareDiagnosticsEventSoftwareFaultID: + result = @"SoftwareFault"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeThreadNetworkDiagnosticsID: + + switch (eventID) { + + // Cluster ThreadNetworkDiagnostics events + case MTREventIDTypeClusterThreadNetworkDiagnosticsEventConnectionStatusID: + result = @"ConnectionStatus"; + break; + + case MTREventIDTypeClusterThreadNetworkDiagnosticsEventNetworkFaultChangeID: + result = @"NetworkFaultChange"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWiFiNetworkDiagnosticsID: + + switch (eventID) { + + // Cluster WiFiNetworkDiagnostics events + case MTREventIDTypeClusterWiFiNetworkDiagnosticsEventDisconnectionID: + result = @"Disconnection"; + break; + + case MTREventIDTypeClusterWiFiNetworkDiagnosticsEventAssociationFailureID: + result = @"AssociationFailure"; + break; + + case MTREventIDTypeClusterWiFiNetworkDiagnosticsEventConnectionStatusID: + result = @"ConnectionStatus"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeEthernetNetworkDiagnosticsID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTimeSynchronizationID: + + switch (eventID) { + + // Cluster TimeSynchronization events + case MTREventIDTypeClusterTimeSynchronizationEventDSTTableEmptyID: + result = @"DSTTableEmpty"; + break; + + case MTREventIDTypeClusterTimeSynchronizationEventDSTStatusID: + result = @"DSTStatus"; + break; + + case MTREventIDTypeClusterTimeSynchronizationEventTimeZoneStatusID: + result = @"TimeZoneStatus"; + break; + + case MTREventIDTypeClusterTimeSynchronizationEventTimeFailureID: + result = @"TimeFailure"; + break; + + case MTREventIDTypeClusterTimeSynchronizationEventMissingTrustedTimeSourceID: + result = @"MissingTrustedTimeSource"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBridgedDeviceBasicInformationID: + + switch (eventID) { + + // Cluster BridgedDeviceBasicInformation events + case MTREventIDTypeClusterBridgedDeviceBasicInformationEventStartUpID: + result = @"StartUp"; + break; + + case MTREventIDTypeClusterBridgedDeviceBasicInformationEventShutDownID: + result = @"ShutDown"; + break; + + case MTREventIDTypeClusterBridgedDeviceBasicInformationEventLeaveID: + result = @"Leave"; + break; + + case MTREventIDTypeClusterBridgedDeviceBasicInformationEventReachableChangedID: + result = @"ReachableChanged"; + break; + + case MTREventIDTypeClusterBridgedDeviceBasicInformationEventActiveChangedID: + result = @"ActiveChanged"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeSwitchID: + + switch (eventID) { + + // Cluster Switch events + case MTREventIDTypeClusterSwitchEventSwitchLatchedID: + result = @"SwitchLatched"; + break; + + case MTREventIDTypeClusterSwitchEventInitialPressID: + result = @"InitialPress"; + break; + + case MTREventIDTypeClusterSwitchEventLongPressID: + result = @"LongPress"; + break; + + case MTREventIDTypeClusterSwitchEventShortReleaseID: + result = @"ShortRelease"; + break; + + case MTREventIDTypeClusterSwitchEventLongReleaseID: + result = @"LongRelease"; + break; + + case MTREventIDTypeClusterSwitchEventMultiPressOngoingID: + result = @"MultiPressOngoing"; + break; + + case MTREventIDTypeClusterSwitchEventMultiPressCompleteID: + result = @"MultiPressComplete"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeAdministratorCommissioningID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOperationalCredentialsID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeGroupKeyManagementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeFixedLabelID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeUserLabelID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBooleanStateID: + + switch (eventID) { + + // Cluster BooleanState events + case MTREventIDTypeClusterBooleanStateEventStateChangeID: + result = @"StateChange"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeICDManagementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTimerID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOvenCavityOperationalStateID: + + switch (eventID) { + + // Cluster OvenCavityOperationalState events + case MTREventIDTypeClusterOvenCavityOperationalStateEventOperationalErrorID: + result = @"OperationalError"; + break; + + case MTREventIDTypeClusterOvenCavityOperationalStateEventOperationCompletionID: + result = @"OperationCompletion"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOvenModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeLaundryDryerControlsID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeModeSelectID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeLaundryWasherModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRefrigeratorAndTemperatureControlledCabinetModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeLaundryWasherControlsID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRVCRunModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRVCCleanModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTemperatureControlID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRefrigeratorAlarmID: + + switch (eventID) { + + // Cluster RefrigeratorAlarm events + case MTREventIDTypeClusterRefrigeratorAlarmEventNotifyID: + result = @"Notify"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDishwasherModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeAirQualityID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeSmokeCOAlarmID: + + switch (eventID) { + + // Cluster SmokeCOAlarm events + case MTREventIDTypeClusterSmokeCOAlarmEventSmokeAlarmID: + result = @"SmokeAlarm"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventCOAlarmID: + result = @"COAlarm"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventLowBatteryID: + result = @"LowBattery"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventHardwareFaultID: + result = @"HardwareFault"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventEndOfServiceID: + result = @"EndOfService"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventSelfTestCompleteID: + result = @"SelfTestComplete"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventAlarmMutedID: + result = @"AlarmMuted"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventMuteEndedID: + result = @"MuteEnded"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventInterconnectSmokeAlarmID: + result = @"InterconnectSmokeAlarm"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventInterconnectCOAlarmID: + result = @"InterconnectCOAlarm"; + break; + + case MTREventIDTypeClusterSmokeCOAlarmEventAllClearID: + result = @"AllClear"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDishwasherAlarmID: + + switch (eventID) { + + // Cluster DishwasherAlarm events + case MTREventIDTypeClusterDishwasherAlarmEventNotifyID: + result = @"Notify"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeMicrowaveOvenModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeMicrowaveOvenControlID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOperationalStateID: + + switch (eventID) { + + // Cluster OperationalState events + case MTREventIDTypeClusterOperationalStateEventOperationalErrorID: + result = @"OperationalError"; + break; + + case MTREventIDTypeClusterOperationalStateEventOperationCompletionID: + result = @"OperationCompletion"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRVCOperationalStateID: + + switch (eventID) { + + // Cluster RVCOperationalState events + case MTREventIDTypeClusterRVCOperationalStateEventOperationalErrorID: + result = @"OperationalError"; + break; + + case MTREventIDTypeClusterRVCOperationalStateEventOperationCompletionID: + result = @"OperationCompletion"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeScenesManagementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeHEPAFilterMonitoringID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeActivatedCarbonFilterMonitoringID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBooleanStateConfigurationID: + + switch (eventID) { + + // Cluster BooleanStateConfiguration events + case MTREventIDTypeClusterBooleanStateConfigurationEventAlarmsStateChangedID: + result = @"AlarmsStateChanged"; + break; + + case MTREventIDTypeClusterBooleanStateConfigurationEventSensorFaultID: + result = @"SensorFault"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeValveConfigurationAndControlID: + + switch (eventID) { + + // Cluster ValveConfigurationAndControl events + case MTREventIDTypeClusterValveConfigurationAndControlEventValveStateChangedID: + result = @"ValveStateChanged"; + break; + + case MTREventIDTypeClusterValveConfigurationAndControlEventValveFaultID: + result = @"ValveFault"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeElectricalPowerMeasurementID: + + switch (eventID) { + + // Cluster ElectricalPowerMeasurement events + case MTREventIDTypeClusterElectricalPowerMeasurementEventMeasurementPeriodRangesID: + result = @"MeasurementPeriodRanges"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeElectricalEnergyMeasurementID: + + switch (eventID) { + + // Cluster ElectricalEnergyMeasurement events + case MTREventIDTypeClusterElectricalEnergyMeasurementEventCumulativeEnergyMeasuredID: + result = @"CumulativeEnergyMeasured"; + break; + + case MTREventIDTypeClusterElectricalEnergyMeasurementEventPeriodicEnergyMeasuredID: + result = @"PeriodicEnergyMeasured"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWaterHeaterManagementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDemandResponseLoadControlID: + + switch (eventID) { + + // Cluster DemandResponseLoadControl events + case MTREventIDTypeClusterDemandResponseLoadControlEventLoadControlEventStatusChangeID: + result = @"LoadControlEventStatusChange"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeMessagesID: + + switch (eventID) { + + // Cluster Messages events + case MTREventIDTypeClusterMessagesEventMessageQueuedID: + result = @"MessageQueued"; + break; + + case MTREventIDTypeClusterMessagesEventMessagePresentedID: + result = @"MessagePresented"; + break; + + case MTREventIDTypeClusterMessagesEventMessageCompleteID: + result = @"MessageComplete"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDeviceEnergyManagementID: + + switch (eventID) { + + // Cluster DeviceEnergyManagement events + case MTREventIDTypeClusterDeviceEnergyManagementEventPowerAdjustStartID: + result = @"PowerAdjustStart"; + break; + + case MTREventIDTypeClusterDeviceEnergyManagementEventPowerAdjustEndID: + result = @"PowerAdjustEnd"; + break; + + case MTREventIDTypeClusterDeviceEnergyManagementEventPausedID: + result = @"Paused"; + break; + + case MTREventIDTypeClusterDeviceEnergyManagementEventResumedID: + result = @"Resumed"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeEnergyEVSEID: + + switch (eventID) { + + // Cluster EnergyEVSE events + case MTREventIDTypeClusterEnergyEVSEEventEVConnectedID: + result = @"EVConnected"; + break; + + case MTREventIDTypeClusterEnergyEVSEEventEVNotDetectedID: + result = @"EVNotDetected"; + break; + + case MTREventIDTypeClusterEnergyEVSEEventEnergyTransferStartedID: + result = @"EnergyTransferStarted"; + break; + + case MTREventIDTypeClusterEnergyEVSEEventEnergyTransferStoppedID: + result = @"EnergyTransferStopped"; + break; + + case MTREventIDTypeClusterEnergyEVSEEventFaultID: + result = @"Fault"; + break; + + case MTREventIDTypeClusterEnergyEVSEEventRFIDID: + result = @"RFID"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeEnergyPreferenceID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePowerTopologyID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeEnergyEVSEModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWaterHeaterModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDeviceEnergyManagementModeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeDoorLockID: + + switch (eventID) { + + // Cluster DoorLock events + case MTREventIDTypeClusterDoorLockEventDoorLockAlarmID: + result = @"DoorLockAlarm"; + break; + + case MTREventIDTypeClusterDoorLockEventDoorStateChangeID: + result = @"DoorStateChange"; + break; + + case MTREventIDTypeClusterDoorLockEventLockOperationID: + result = @"LockOperation"; + break; + + case MTREventIDTypeClusterDoorLockEventLockOperationErrorID: + result = @"LockOperationError"; + break; + + case MTREventIDTypeClusterDoorLockEventLockUserChangeID: + result = @"LockUserChange"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWindowCoveringID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBarrierControlID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeServiceAreaID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePumpConfigurationAndControlID: + + switch (eventID) { + + // Cluster PumpConfigurationAndControl events + case MTREventIDTypeClusterPumpConfigurationAndControlEventSupplyVoltageLowID: + result = @"SupplyVoltageLow"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventSupplyVoltageHighID: + result = @"SupplyVoltageHigh"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventPowerMissingPhaseID: + result = @"PowerMissingPhase"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventSystemPressureLowID: + result = @"SystemPressureLow"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventSystemPressureHighID: + result = @"SystemPressureHigh"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventDryRunningID: + result = @"DryRunning"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventMotorTemperatureHighID: + result = @"MotorTemperatureHigh"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventPumpMotorFatalFailureID: + result = @"PumpMotorFatalFailure"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventElectronicTemperatureHighID: + result = @"ElectronicTemperatureHigh"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventPumpBlockedID: + result = @"PumpBlocked"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventSensorFailureID: + result = @"SensorFailure"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventElectronicNonFatalFailureID: + result = @"ElectronicNonFatalFailure"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventElectronicFatalFailureID: + result = @"ElectronicFatalFailure"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventGeneralFaultID: + result = @"GeneralFault"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventLeakageID: + result = @"Leakage"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventAirDetectionID: + result = @"AirDetection"; + break; + + case MTREventIDTypeClusterPumpConfigurationAndControlEventTurbineOperationID: + result = @"TurbineOperation"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeThermostatID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeFanControlID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeThermostatUserInterfaceConfigurationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeColorControlID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeBallastConfigurationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeIlluminanceMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTemperatureMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePressureMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeFlowMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRelativeHumidityMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOccupancySensingID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeCarbonMonoxideConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeCarbonDioxideConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeNitrogenDioxideConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeOzoneConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePM25ConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeFormaldehydeConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePM1ConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypePM10ConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTotalVolatileOrganicCompoundsConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeRadonConcentrationMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWiFiNetworkManagementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeThreadBorderRouterManagementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeThreadNetworkDirectoryID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeWakeOnLANID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeChannelID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeTargetNavigatorID: + + switch (eventID) { + + // Cluster TargetNavigator events + case MTREventIDTypeClusterTargetNavigatorEventTargetUpdatedID: + result = @"TargetUpdated"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeMediaPlaybackID: + + switch (eventID) { + + // Cluster MediaPlayback events + case MTREventIDTypeClusterMediaPlaybackEventStateChangedID: + result = @"StateChanged"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeMediaInputID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeLowPowerID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeKeypadInputID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeContentLauncherID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeAudioOutputID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeApplicationLauncherID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeApplicationBasicID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeAccountLoginID: + + switch (eventID) { + + // Cluster AccountLogin events + case MTREventIDTypeClusterAccountLoginEventLoggedOutID: + result = @"LoggedOut"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeContentControlID: + + switch (eventID) { + + // Cluster ContentControl events + case MTREventIDTypeClusterContentControlEventRemainingScreenTimeExpiredID: + result = @"RemainingScreenTimeExpired"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeContentAppObserverID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeEcosystemInformationID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeCommissionerControlID: + + switch (eventID) { + + // Cluster CommissionerControl events + case MTREventIDTypeClusterCommissionerControlEventCommissioningRequestResultID: + result = @"CommissioningRequestResult"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeElectricalMeasurementID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeUnitTestingID: + + switch (eventID) { + + // Cluster UnitTesting events + case MTREventIDTypeClusterUnitTestingEventTestEventID: + result = @"TestEvent"; + break; + + case MTREventIDTypeClusterUnitTestingEventTestFabricScopedEventID: + result = @"TestFabricScopedEvent"; + break; + + case MTREventIDTypeClusterUnitTestingEventTestDifferentVendorMeiEventID: + result = @"TestDifferentVendorMeiEvent"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + + case MTRClusterIDTypeSampleMEIID: + + switch (eventID) { + + // Cluster SampleMEI events + case MTREventIDTypeClusterSampleMEIEventPingCountEventID: + result = @"PingCountEvent"; + break; + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; default: result = [NSString stringWithFormat:@"", clusterID]; From f2f3d0eb03ba5bea32b22f19982c402a8c1c9063 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Wed, 31 Jul 2024 15:06:04 -0400 Subject: [PATCH 08/40] Add TC_MCORE_FS_1_3.py test implementation (#34650) --- src/python_testing/TC_MCORE_FS_1_3.py | 175 ++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 src/python_testing/TC_MCORE_FS_1_3.py diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py new file mode 100644 index 00000000000000..791d3785f28395 --- /dev/null +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -0,0 +1,175 @@ +# +# 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. +# + +# This test requires a TH_SERVER application that returns UnsupportedAttribute when reading UniqueID from BasicInformation Cluster. Please specify with --string-arg th_server_app_path: + +import logging +import os +import random +import signal +import subprocess +import time +import uuid + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.interaction_model import Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches +from mobly import asserts + + +class TC_MCORE_FS_1_3(MatterBaseTest): + @async_test_body + async def setup_class(self): + super().setup_class() + self.device_for_th_eco_nodeid = 1111 + self.device_for_th_eco_kvs = None + self.device_for_th_eco_port = 5543 + self.app_process_for_th_eco = None + + self.device_for_dut_eco_nodeid = 1112 + self.device_for_dut_eco_kvs = None + self.device_for_dut_eco_port = 5544 + self.app_process_for_dut_eco = None + + # Create a second controller on a new fabric to communicate to the server + new_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() + new_fabric_admin = new_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=2) + paa_path = str(self.matter_test_config.paa_trust_store_path) + self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) + + def teardown_class(self): + if self.app_process_for_dut_eco is not None: + logging.warning("Stopping app with SIGTERM") + self.app_process_for_dut_eco.send_signal(signal.SIGTERM.value) + self.app_process_for_dut_eco.wait() + if self.app_process_for_th_eco is not None: + logging.warning("Stopping app with SIGTERM") + self.app_process_for_th_eco.send_signal(signal.SIGTERM.value) + self.app_process_for_th_eco.wait() + + os.remove(self.device_for_dut_eco_kvs) + if self.device_for_th_eco_kvs is not None: + os.remove(self.device_for_th_eco_kvs) + super().teardown_class() + + async def create_device_and_commission_to_th_fabric(self, kvs, port, node_id_for_th, device_info): + # TODO: confirm whether we can open processes like this on the TH + app = self.user_params.get("th_server_app_path", None) + if not app: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + + discriminator = random.randint(0, 4095) + passcode = 20202021 + app_args = f'--secured-device-port {port} --discriminator {discriminator} --passcode {passcode} --KVS {kvs}' + cmd = f'{app} {app_args}' + # TODO: Determine if we want these logs cooked or pushed to somewhere else + logging.info(f"Starting TH device for {device_info}") + self.app_process_for_dut_eco = subprocess.Popen(cmd, bufsize=0, shell=True) + logging.info(f"Started TH device for {device_info}") + time.sleep(3) + + logging.info("Commissioning from separate fabric") + await self.TH_server_controller.CommissionOnNetwork(nodeId=node_id_for_th, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + logging.info("Commissioning device for DUT ecosystem onto TH for managing") + + async def create_and_commission_device_for_th_ecosystem(self): + # TODO: confirm whether we can open processes like this on the TH + app = self.user_params.get("th_server_app_path", None) + + self.device_for_th_eco_kvs = f'kvs_{str(uuid.uuid4())}' + discriminator = random.randint(0, 4095) + passcode = 20202021 + app_args = f'--secured-device-port {self.device_for_th_eco_port} --discriminator {discriminator} --passcode {passcode} --KVS {self.device_for_th_eco_kvs}' + cmd = f'{app} {app_args}' + # TODO: Determine if we want these logs cooked or pushed to somewhere else + logging.info("Starting TH device for TH ecosystem") + self.app_process_for_th_eco = subprocess.Popen(cmd, bufsize=0, shell=True) + logging.info("Started TH device for TH ecosystem") + time.sleep(3) + + logging.info("Commissioning from separate fabric") + self.server_nodeid = 1112 + await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + logging.info("Commissioning TH device for TH ecosystem") + + def steps_TC_MCORE_FS_1_3(self) -> list[TestStep]: + steps = [TestStep(1, "DUT_FSA commissions TH_SED_DUT to DUT_FSAs fabric and generates a UniqueID", is_commissioning=True), + TestStep(2, "TH_FSA commissions TH_SED_TH onto TH_FSAs fabric and generates a UniqueID."), + TestStep(3, "Follow manufacturer provided instructions to enable DUT_FSA to synchronize TH_SED_TH onto DUT_FSAs fabric."), + TestStep(4, "DUT_FSA synchronizes TH_SED_TH onto DUT_FSAs fabric and copies the UniqueID presented by TH_FSAs Bridged Device Basic Information Cluster.")] + return steps + + @async_test_body + async def test_TC_MCORE_FS_1_3(self): + self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') + self.print_step(0, "Commissioning DUT to TH, already done") + self.step(1) + # These steps are not explicitly in step 1, but they help identify the dynamically added endpoint in step 1. + root_node_endpoint = 0 + root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=root_node_endpoint) + set_of_endpoints_before_adding_device = set(root_part_list) + + kvs = f'kvs_{str(uuid.uuid4())}' + device_info = "for DUT ecosystem" + await self.create_device_and_commission_to_th_fabric(kvs, self.device_for_dut_eco_port, self.device_for_dut_eco_nodeid, device_info) + self.device_for_dut_eco_kvs = kvs + read_result = await self.TH_server_controller.ReadAttribute(self.device_for_dut_eco_nodeid, [(root_node_endpoint, Clusters.BasicInformation.Attributes.UniqueID)]) + result = read_result[root_node_endpoint][Clusters.BasicInformation][Clusters.BasicInformation.Attributes.UniqueID] + asserts.assert_true(type_matches(result, Clusters.Attribute.ValueDecodeFailure), "We were expecting a value decode failure") + asserts.assert_equal(result.Reason.status, Status.UnsupportedAttribute, "Incorrect error returned from reading UniqueID") + + params = await self.openCommissioningWindow(dev_ctrl=self.TH_server_controller, node_id=self.device_for_dut_eco_nodeid) + + self.wait_for_user_input( + prompt_msg=f"Using the DUT vendor's provided interface, commission the device using the following parameters:\n" + f"- discriminator: {params.randomDiscriminator}\n" + f"- setupPinCode: {params.commissioningParameters.setupPinCode}\n" + f"- setupQRCode: {params.commissioningParameters.setupQRCode}\n" + f"- setupManualcode: {params.commissioningParameters.setupManualCode}\n" + f"If using FabricSync Admin, you may type:\n" + f">>> pairing onnetwork {params.commissioningParameters.setupPinCode}") + + root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=root_node_endpoint) + set_of_endpoints_after_adding_device = set(root_part_list) + + asserts.assert_true(set_of_endpoints_after_adding_device.issuperset( + set_of_endpoints_before_adding_device), "Expected only new endpoints to be added") + unique_endpoints_set = set_of_endpoints_after_adding_device - set_of_endpoints_before_adding_device + asserts.assert_equal(len(unique_endpoints_set), 1, "Expected only one new endpoint") + newly_added_endpoint = list(unique_endpoints_set)[0] + + th_sed_dut_unique_id = await self.read_single_attribute_check_success(cluster=Clusters.BridgedDeviceBasicInformation, attribute=Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID, endpoint=newly_added_endpoint) + asserts.assert_true(type_matches(th_sed_dut_unique_id, str), "UniqueID should be a string") + asserts.assert_true(th_sed_dut_unique_id, "UniqueID should not be an empty string") + + self.step(2) + kvs = f'kvs_{str(uuid.uuid4())}' + device_info = "for TH_FSA ecosystem" + await self.create_device_and_commission_to_th_fabric(kvs, self.device_for_th_eco_port, self.device_for_th_eco_nodeid, device_info) + self.device_for_th_eco_kvs = kvs + # TODO(https://github.com/CHIP-Specifications/chip-test-plans/issues/4375) During setup we need to create the TH_FSA device + # where we would commission device created in create_device_and_commission_to_th_fabric to be commissioned into TH_FSA. + + # TODO(https://github.com/CHIP-Specifications/chip-test-plans/issues/4375) Because we cannot create a TH_FSA and there is + # no way to mock it the following 2 test steps are skipped for now. + self.skip_step(3) + self.skip_step(4) + + +if __name__ == "__main__": + default_matter_test_main() From fbbcc7d9b6ec580a6c2c14c1d9c7f4386e5a1552 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Wed, 31 Jul 2024 15:37:08 -0400 Subject: [PATCH 09/40] Fix most TC-SWTCH-2.4 remaining issues (#34677) - Move 2.4 in a better place in the file - Add test steps properly - Allow default button press position override Issue #34656 Testing done: - Test still passes on DUT with automation --- src/python_testing/TC_SWTCH.py | 255 +++++++++++++++++---------------- 1 file changed, 132 insertions(+), 123 deletions(-) diff --git a/src/python_testing/TC_SWTCH.py b/src/python_testing/TC_SWTCH.py index 6da5c7a229e0b7..08bf23d91c30d4 100644 --- a/src/python_testing/TC_SWTCH.py +++ b/src/python_testing/TC_SWTCH.py @@ -45,22 +45,28 @@ logger = logging.getLogger(__name__) -class TC_SwitchTests(MatterBaseTest): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) +def bump_substep(step: str) -> str: + """Given a string like "5a", bump it to "5b", or "6c" to "6d" """ + if len(step) == 0: + raise ValueError("Can't bump empty steps!") - def desc_TC_SWTCH_2_4(self) -> str: - """Returns a description of this test""" - return "[TC-SWTCH-2.4] Momentary Switch Long Press Verification" + end_char = step[-1] + if not end_char.isalpha(): + return step + "a" - # TODO(#34656): Fill test steps - # def steps_TC_SWTCH_2_4(self) -> list[TestStep]: - # steps = [ - # TestStep("0", "Commissioning, already done", is_commissioning=True), - # # TODO: fill when test is done - # ] + step_prefix = step[:-1] + next_end_char = chr(ord(end_char) + 1) + if ord(next_end_char) > ord('z'): + raise ValueError(f"Reached max substep for step '{step}'") + next_step = step_prefix + next_end_char - # return steps + return next_step + + +class TC_SwitchTests(MatterBaseTest): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self._default_pressed_position = self.user_params.get("default_pressed_position", 1) def _send_named_pipe_command(self, command_dict: dict[str, Any]): app_pid = self.matter_test_config.app_pid @@ -164,14 +170,6 @@ def _ask_for_release(self): else: time.sleep(self.keep_pressed_delay/1000) - def _placeholder_for_step(self, step_id: str): - # TODO(#34656): Global search an replace of `self._placeholder_for_step` with `self.step` when done. - logging.info(f"Step {step_id}") - pass - - def _placeholder_for_skip(self, step_id: str): - logging.info(f"Skipped step {step_id}") - def _await_sequence_of_reports(self, report_queue: queue.Queue, endpoint_id: int, attribute: TypedAttributePath, sequence: list[Any], timeout_sec: float): start_time = time.time() elapsed = 0.0 @@ -269,93 +267,6 @@ def _expect_no_events_for_cluster(self, event_queue: queue.Queue, endpoint_id: i logging.info(f"Successfully waited for no further events on {expected_cluster} for {elapsed:.1f} seconds") - @per_endpoint_test(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kMomentarySwitch)) - async def test_TC_SWTCH_2_4(self): - # TODO(#34656): Make this come from PIXIT - switch_pressed_position = 1 - post_prompt_settle_delay_seconds = 10.0 - - # Commission DUT - already done - - # Read feature map to set bool markers - cluster = Clusters.Objects.Switch - feature_map = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.FeatureMap) - - has_ms_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitch) != 0 - has_msr_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchRelease) != 0 - has_msl_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchLongPress) != 0 - has_as_feature = (feature_map & cluster.Bitmaps.Feature.kActionSwitch) != 0 - # has_msm_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchMultiPress) != 0 - - if not has_ms_feature: - logging.info("Skipping rest of test: SWTCH.S.F01(MS) feature not present") - self.skip_all_remaining_steps("2") - - endpoint_id = self.matter_test_config.endpoint - - # Step 1: Set up subscription to all Switch cluster events - self._placeholder_for_step("1") - event_listener = EventChangeCallback(cluster) - attrib_listener = ClusterAttributeChangeAccumulator(cluster) - await event_listener.start(self.default_controller, self.dut_node_id, endpoint=endpoint_id) - await attrib_listener.start(self.default_controller, self.dut_node_id, endpoint=endpoint_id) - - # Step 2: Operator does not operate switch on the DUT - self._placeholder_for_step("2") - self._ask_for_switch_idle() - - # Step 3: TH reads the CurrentPosition attribute from the DUT - self._placeholder_for_step("3") - - # Verify that the value is 0 - current_position = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.CurrentPosition) - asserts.assert_equal(current_position, 0) - - # Step 4a: Operator operates switch (keep pressed for long time, e.g. 5 seconds) on the DUT, the release it - self._placeholder_for_step("4a") - self._ask_for_long_press(endpoint_id, switch_pressed_position, feature_map) - - # Step 4b: TH expects report of CurrentPosition 1, followed by a report of Current Position 0. - self._placeholder_for_step("4b") - logging.info( - f"Starting to wait for {post_prompt_settle_delay_seconds:.1f} seconds for CurrentPosition to go {switch_pressed_position}, then 0.") - self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.CurrentPosition, sequence=[ - switch_pressed_position, 0], timeout_sec=post_prompt_settle_delay_seconds) - - # Step 4c: TH expects at least InitialPress with NewPosition = 1 - self._placeholder_for_step("4c") - logging.info(f"Starting to wait for {post_prompt_settle_delay_seconds:.1f} seconds for InitialPress event.") - expected_events = [cluster.Events.InitialPress(newPosition=switch_pressed_position)] - self._await_sequence_of_events(event_queue=event_listener.event_queue, endpoint_id=endpoint_id, - sequence=expected_events, timeout_sec=post_prompt_settle_delay_seconds) - - # Step 4d: For MSL/AS, expect to see LongPress/LongRelease in that order - if not has_msl_feature and not has_as_feature: - logging.info("Skipping Step 4d due to missing MSL and AS features") - self._placeholder_for_skip("4d") - else: - # Steb 4d: TH expects report of LongPress, LongRelease in that order. - self._placeholder_for_step("4d") - logging.info(f"Starting to wait for {post_prompt_settle_delay_seconds:.1f} seconds for LongPress then LongRelease.") - expected_events = [] - expected_events.append(cluster.Events.LongPress(newPosition=switch_pressed_position)) - expected_events.append(cluster.Events.LongRelease(previousPosition=switch_pressed_position)) - self._await_sequence_of_events(event_queue=event_listener.event_queue, endpoint_id=endpoint_id, - sequence=expected_events, timeout_sec=post_prompt_settle_delay_seconds) - - # Step 4e: For MS & (!MSL & !AS & !MSR), expect no further events for 10 seconds. - if not has_msl_feature and not has_as_feature and not has_msr_feature: - self._placeholder_for_step("4e") - self._expect_no_events_for_cluster(event_queue=event_listener.event_queue, - endpoint_id=endpoint_id, expected_cluster=cluster, timeout_sec=10.0) - - # Step 4f: For MSR & not MSL, expect to see ShortRelease. - if not has_msl_feature and has_msr_feature: - self._placeholder_for_step("4f") - expected_events = [cluster.Events.ShortRelease(previousPosition=switch_pressed_position)] - self._await_sequence_of_events(event_queue=event_listener.event_queue, endpoint_id=endpoint_id, - sequence=expected_events, timeout_sec=post_prompt_settle_delay_seconds) - def _received_event(self, event_listener: EventChangeCallback, target_event: ClusterObjects.ClusterEvent, timeout_s: int) -> bool: """ Returns true if this event was received, false otherwise @@ -534,6 +445,104 @@ async def test_TC_SWTCH_2_3(self): button_val = await self.read_single_attribute_check_success(cluster=cluster, attribute=cluster.Attributes.CurrentPosition) asserts.assert_equal(button_val, 0, "Button value is not 0") + def desc_TC_SWTCH_2_4(self) -> str: + return "[TC-SWTCH-2.4] Momentary Switch Long Press Verification" + + def steps_TC_SWTCH_2_4(self): + return [TestStep(1, test_plan_support.commission_if_required(), "", is_commissioning=True), + TestStep(2, "Set up subscription to all events of Switch cluster on the endpoint"), + TestStep(3, "Operator does not operate switch on the DUT"), + TestStep(4, "TH reads the CurrentPosition attribute from the DUT", "Verify that the value is 0"), + TestStep(5, "Operator operates switch (keep pressed for long time, e.g. 5 seconds) on the DUT, the release it", + """ + * TH expects receiving a subscription report of CurrentPosition 1, followed by a report of Current Position 0. + * TH expects receiving at InitialPress event with NewPosition = 1. + * if MSL or AS feature is supported, TH expect receiving LongPress/LongRelease in that order. + * if MS & (!MSL & !AS & !MSR) features present, TH expects receiving no further events for 10 seconds after release. + * if (MSR & !MSL) features present, TH expects receiving ShortRelease event. + """) + ] + + @per_endpoint_test(has_feature(Clusters.Switch, Clusters.Switch.Bitmaps.Feature.kMomentarySwitch)) + async def test_TC_SWTCH_2_4(self): + switch_pressed_position = self._default_pressed_position + post_prompt_settle_delay_seconds = 10.0 + + endpoint_id = self.matter_test_config.endpoint + cluster = Clusters.Objects.Switch + + # Step 1: Commission DUT - already done + self.step(1) + + # Read feature map to set bool markers + feature_map = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.FeatureMap) + + has_ms_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitch) != 0 + has_msr_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchRelease) != 0 + has_msl_feature = (feature_map & cluster.Bitmaps.Feature.kMomentarySwitchLongPress) != 0 + has_as_feature = (feature_map & cluster.Bitmaps.Feature.kActionSwitch) != 0 + + if not has_ms_feature: + logging.info("Skipping rest of test: SWTCH.S.F01(MS) feature not present") + self.skip_all_remaining_steps("2") + + # Step 2: Set up subscription to all events of Switch cluster on the endpoint + self.step(2) + event_listener = EventChangeCallback(cluster) + attrib_listener = ClusterAttributeChangeAccumulator(cluster) + await event_listener.start(self.default_controller, self.dut_node_id, endpoint=endpoint_id) + await attrib_listener.start(self.default_controller, self.dut_node_id, endpoint=endpoint_id) + + # Step 3: Operator does not operate switch on the DUT + self.step(3) + self._ask_for_switch_idle() + + # Step 4: TH reads the CurrentPosition attribute from the DUT + self.step(4) + + # Verify that the value is 0 + current_position = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.CurrentPosition) + asserts.assert_equal(current_position, 0) + + # Step 5: Operator operates switch (keep pressed for long time, e.g. 5 seconds) on the DUT, the release it + self.step(5) + self._ask_for_long_press(endpoint_id, switch_pressed_position, feature_map) + + # - TH expects report of CurrentPosition 1, followed by a report of Current Position 0. + logging.info( + f"Starting to wait for {post_prompt_settle_delay_seconds:.1f} seconds for CurrentPosition to go {switch_pressed_position}, then 0.") + self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.CurrentPosition, sequence=[ + switch_pressed_position, 0], timeout_sec=post_prompt_settle_delay_seconds) + + # - TH expects at least InitialPress with NewPosition = 1 + logging.info(f"Starting to wait for {post_prompt_settle_delay_seconds:.1f} seconds for InitialPress event.") + expected_events = [cluster.Events.InitialPress(newPosition=switch_pressed_position)] + self._await_sequence_of_events(event_queue=event_listener.event_queue, endpoint_id=endpoint_id, + sequence=expected_events, timeout_sec=post_prompt_settle_delay_seconds) + + # - if MSL or AS feature is supported, expect to see LongPress/LongRelease in that order. + if not has_msl_feature and not has_as_feature: + logging.info("Since MSL and AS features both unsupported, skipping check for LongPress/LongRelease") + else: + # - TH expects report of LongPress, LongRelease in that order. + logging.info(f"Starting to wait for {post_prompt_settle_delay_seconds:.1f} seconds for LongPress then LongRelease.") + expected_events = [] + expected_events.append(cluster.Events.LongPress(newPosition=switch_pressed_position)) + expected_events.append(cluster.Events.LongRelease(previousPosition=switch_pressed_position)) + self._await_sequence_of_events(event_queue=event_listener.event_queue, endpoint_id=endpoint_id, + sequence=expected_events, timeout_sec=post_prompt_settle_delay_seconds) + + # - if MS & (!MSL & !AS & !MSR) features present, expect no further events for 10 seconds after release. + if not has_msl_feature and not has_as_feature and not has_msr_feature: + self._expect_no_events_for_cluster(event_queue=event_listener.event_queue, + endpoint_id=endpoint_id, expected_cluster=cluster, timeout_sec=10.0) + + # - if (MSR & !MSL) features present, expect to see ShortRelease event. + if not has_msl_feature and has_msr_feature: + expected_events = [cluster.Events.ShortRelease(previousPosition=switch_pressed_position)] + self._await_sequence_of_events(event_queue=event_listener.event_queue, endpoint_id=endpoint_id, + sequence=expected_events, timeout_sec=post_prompt_settle_delay_seconds) + def steps_TC_SWTCH_2_5(self): return [TestStep(1, test_plan_support.commission_if_required(), "", is_commissioning=True), TestStep(2, "Set up a subscription to all Switch cluster events"), @@ -638,7 +647,7 @@ async def test_TC_SWTCH_2_5(self): multi_press_max = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.MultiPressMax) endpoint_id = self.matter_test_config.endpoint - pressed_position = 1 + pressed_position = self._default_pressed_position self.step(2) event_listener = EventChangeCallback(cluster) @@ -657,27 +666,27 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool = else: self._ask_for_multi_press(endpoint_id, number_of_presses=count, pressed_position=pressed_position, feature_map=feature_map, multi_press_max=multi_press_max) - for i in range(count): + for pos_idx in range(count): event = event_listener.wait_for_event_report(cluster.Events.InitialPress) asserts.assert_equal(event.newPosition, pressed_position, "Unexpected NewPosition on InitialEvent") - if i > 0: + if pos_idx > 0: event = event_listener.wait_for_event_report(cluster.Events.MultiPressOngoing) asserts.assert_equal(event.newPosition, pressed_position, "Unexpected NewPosition on MultiPressOngoing") - asserts.assert_equal(event.currentNumberOfPressesCounted, i+1, + asserts.assert_equal(event.currentNumberOfPressesCounted, pos_idx + 1, "Unexpected CurrentNumberOfPressesCounted on MultiPressOngoing") event = event_listener.wait_for_event_report(cluster.Events.ShortRelease) asserts.assert_equal(event.previousPosition, pressed_position, "Unexpected PreviousPosition on ShortRelease") - step = step[:-1] + chr(ord(step[-1])+1) + step = bump_substep(step) self.step(step) self._ask_for_switch_idle() event = event_listener.wait_for_event_report(cluster.Events.MultiPressComplete) asserts.assert_equal(event.previousPosition, pressed_position, "Unexpected PreviousPosition on MultiPressComplete") asserts.assert_equal(event.totalNumberOfPressesCounted, count, "Unexpected count on MultiPressComplete") - test_multi_press_sequence("4a", 1) + test_multi_press_sequence("4a", count=1) - test_multi_press_sequence("5a", 2) + test_multi_press_sequence("5a", count=2) self.step("6a") multi_press_max = await self.read_single_attribute_check_success(cluster=cluster, attribute=cluster.Attributes.MultiPressMax) @@ -685,7 +694,7 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool = self.skip_step("6b") self.skip_step("6c") else: - test_multi_press_sequence("6b", 3) + test_multi_press_sequence("6b", count=3) if not has_msl_feature: self.skip_all_remaining_steps(7) @@ -694,7 +703,7 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool = self.step(7) # subscription is already set up - test_multi_press_sequence("8a", 2, short_long=True) + test_multi_press_sequence("8a", count=2, short_long=True) self.step("9a") self._ask_for_multi_press_long_short(endpoint_id, pressed_position, feature_map) @@ -813,7 +822,7 @@ async def test_TC_SWTCH_2_6(self): multi_press_max = await self.read_single_attribute_check_success(cluster, attribute=cluster.Attributes.MultiPressMax) endpoint_id = self.matter_test_config.endpoint - pressed_position = 1 + pressed_position = self._default_pressed_position self.step(2) event_listener = EventChangeCallback(cluster) @@ -836,7 +845,7 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool = event = event_listener.wait_for_event_report(cluster.Events.InitialPress) asserts.assert_equal(event.newPosition, pressed_position, "Unexpected NewPosition on InitialEvent") - step = step[:-1] + chr(ord(step[-1])+1) + step = bump_substep(step) self.step(step) self._ask_for_switch_idle() event = event_listener.wait_for_event_report(cluster.Events.MultiPressComplete) @@ -844,11 +853,11 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool = expected_count = 0 if count > multi_press_max else count asserts.assert_equal(event.totalNumberOfPressesCounted, expected_count, "Unexpected count on MultiPressComplete") - test_multi_press_sequence("4a", 1) + test_multi_press_sequence("4a", count=1) - test_multi_press_sequence("5a", 2) + test_multi_press_sequence("5a", count=2) - test_multi_press_sequence("6a", multi_press_max + 1) + test_multi_press_sequence("6a", count=(multi_press_max + 1)) self.step("7a") if not has_msl_feature: @@ -857,7 +866,7 @@ def test_multi_press_sequence(starting_step: str, count: int, short_long: bool = # subscription is already established self.step("7b") - test_multi_press_sequence("8a", 2, short_long=True) + test_multi_press_sequence("8a", count=2, short_long=True) self.step("9a") self._ask_for_multi_press_long_short(endpoint_id, pressed_position, feature_map) From e1137ebfbe90ae16a8be6c5dbd128391ed112534 Mon Sep 17 00:00:00 2001 From: Chris Letnick Date: Wed, 31 Jul 2024 13:17:01 -0700 Subject: [PATCH 10/40] Initial test script for Fabric Sync TC_MCORE_FS_1_2 (#34675) * Initial test script for Fabric Sync TC_MCORE_FS_1_2 * Apply suggestions from code review Co-authored-by: C Freeman * Address Review Comments * Address review comments * Fix default timeout after other timeouts changed * Restyled by autopep8 * Fix linter error --------- Co-authored-by: C Freeman Co-authored-by: Restyled.io --- src/python_testing/TC_MCORE_FS_1_2.py | 176 ++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 src/python_testing/TC_MCORE_FS_1_2.py diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py new file mode 100644 index 00000000000000..0af8cbedb30345 --- /dev/null +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -0,0 +1,176 @@ +# +# 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. +# + +# TODO: add to CI. See https://github.com/project-chip/connectedhomeip/issues/34676 +# for details about the block below. +# + +import base64 +import logging +import queue +import time + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts +from TC_SC_3_6 import AttributeChangeAccumulator + + +class TC_MCORE_FS_1_2(MatterBaseTest): + def steps_TC_MCORE_FS_1_2(self) -> list[TestStep]: + steps = [TestStep(1, "TH_FSA subscribes to all the Bridged Device Basic Information clusters provided by DUT_FSA to identify the presence of a Bridged Node endpoint with a UniqueID matching the UniqueID provided by the BasicInformationCluster of the TH_SED_DUT."), + TestStep(2, "TH_FSA initiates commissioning of TH_SED_DUT by sending the OpenCommissioningWindow command to the Administrator Commissioning Cluster on the endpoint with the uniqueID matching that of TH_SED_DUT."), + TestStep(3, "TH_FSA completes commissioning of TH_SED_DUT using the Enhanced Commissioning Method."), + TestStep(4, "Commission TH_SED_L onto DUT_FSA’s fabric using the manufacturer specified mechanism."), + TestStep(5, "TH_FSA waits for subscription report from a the Bridged Device Basic Information clusters provided by DUT_FSA to identify the presence of a Bridged Node endpoint with a UniqueID matching the UniqueID provided by the BasicInformationCluster of the TH_SED_L."), + TestStep(6, "TH_FSA initiates commissions of TH_SED_L by sending the OpenCommissioningWindow command to the Administrator Commissioning Cluster on the endpoint with the uniqueID matching that of TH_SED_L."), + TestStep(7, "TH_FSA completes commissioning of TH_SED_L using the Enhanced Commissioning Method.")] + return steps + + @property + def default_timeout(self) -> int: + return self.user_params.get("report_waiting_timeout_delay_sec", 10)*2 + 60 + + @async_test_body + async def test_TC_MCORE_FS_1_2(self): + self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') + min_report_interval_sec = self.user_params.get("min_report_interval_sec", 0) + max_report_interval_sec = self.user_params.get("max_report_interval_sec", 2) + report_waiting_timeout_delay_sec = self.user_params.get("report_waiting_timeout_delay_sec", 10) + + self.step(1) + + # Subscribe to the UniqueIDs + unique_id_queue = queue.Queue() + subscription_contents = [ + (Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID) # On all endpoints + ] + sub = await self.default_controller.ReadAttribute( + nodeid=self.dut_node_id, + attributes=subscription_contents, + reportInterval=(min_report_interval_sec, max_report_interval_sec), + keepSubscriptions=False + ) + attribute_handler = AttributeChangeAccumulator( + name=self.default_controller.name, expected_attribute=Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID, output=unique_id_queue) + sub.SetAttributeUpdateCallback(attribute_handler) + + logging.info("Waiting for First BridgedDeviceBasicInformation.") + start_time = time.time() + elapsed = 0 + time_remaining = report_waiting_timeout_delay_sec + + th_sed_dut_bdbi_endpoint = -1 + th_sed_dut_unique_id = -1 + + while time_remaining > 0 and th_sed_dut_bdbi_endpoint < 0: + try: + item = unique_id_queue.get(block=True, timeout=time_remaining) + endpoint, attribute, value = item['endpoint'], item['attribute'], item['value'] + + # Record arrival of an expected subscription change when seen + if attribute == Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID: + th_sed_dut_bdbi_endpoint = endpoint + th_sed_dut_unique_id = value + + except queue.Empty: + # No error, we update timeouts and keep going + pass + + elapsed = time.time() - start_time + time_remaining = report_waiting_timeout_delay_sec - elapsed + + asserts.assert_greater(th_sed_dut_bdbi_endpoint, 0, "Failed to find any BDBI instances with UniqueID present.") + logging.info("Found BDBI with UniqueID (%d) on endpoint %d." % th_sed_dut_unique_id, th_sed_dut_bdbi_endpoint) + + self.step(2) + + self.sync_passcode = 20202024 + self.th_sed_dut_discriminator = 2222 + cmd = Clusters.AdministratorCommissioning.Commands.OpenCommissioningWindow(commissioningTimeout=3*60, + PAKEPasscodeVerifier=b"+w1qZQR05Zn0bc2LDyNaDAhsrhDS5iRHPTN10+EmNx8E2OpIPC4SjWRDQVOgqcbnXdYMlpiZ168xLBqn1fx9659gGK/7f9Yc6GxpoJH8kwAUYAYyLGsYeEBt1kL6kpXjgA==", + discriminator=self.th_sed_dut_discriminator, + iterations=10000, salt=base64.b64encode(bytes('SaltyMcSalterson', 'utf-8'))) + await self.send_single_cmd(cmd, endpoint=th_sed_dut_bdbi_endpoint, timedRequestTimeoutMs=5000) + + logging.info("Commissioning Window open for TH_SED_DUT.") + + self.step(3) + + self.th_sed_dut_nodeid = 1111 + await self.TH_server_controller.CommissionOnNetwork(nodeId=self.th_sed_dut_nodeid, setupPinCode=self.sync_passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.th_sed_dut_discriminator) + logging.info("Commissioning TH_SED_DUT complete") + + self.step(4) + if not self.is_ci: + self.wait_for_use_input( + "Commission TH_SED_DUT onto DUT_FSA’s fabric using the manufacturer specified mechanism. (ensure Synchronization is enabled.)") + else: + logging.info("Stopping after step 3 while running in CI to avoid manual steps.") + return + + self.step(5) + + th_sed_later_bdbi_endpoint = -1 + th_sed_later_unique_id = -1 + logging.info("Waiting for Second BridgedDeviceBasicInformation.") + start_time = time.time() + elapsed = 0 + time_remaining = report_waiting_timeout_delay_sec + + while time_remaining > 0 and th_sed_later_bdbi_endpoint < 0: + try: + item = unique_id_queue.get(block=True, timeout=time_remaining) + endpoint, attribute, value = item['endpoint'], item['attribute'], item['value'] + + # Record arrival of an expected subscription change when seen + if attribute == Clusters.BridgedDeviceBasicInformation.Attributes.UniqueID and endpoint != th_sed_dut_bdbi_endpoint and th_sed_later_unique_id != th_sed_dut_unique_id: + th_sed_later_bdbi_endpoint = endpoint + th_sed_later_unique_id = value + + except queue.Empty: + # No error, we update timeouts and keep going + pass + + elapsed = time.time() - start_time + time_remaining = report_waiting_timeout_delay_sec - elapsed + + asserts.assert_greater(th_sed_later_bdbi_endpoint, 0, "Failed to find any BDBI instances with UniqueID present.") + logging.info("Found another BDBI with UniqueID (%d) on endpoint %d." % th_sed_later_unique_id, th_sed_later_bdbi_endpoint) + + self.step(6) + + self.th_sed_later_discriminator = 3333 + # min commissioning timeout is 3*60 seconds, so use that even though the command said 30. + cmd = Clusters.AdministratorCommissioning.Commands.OpenCommissioningWindow(commissioningTimeout=3*60, + PAKEPasscodeVerifier=b"+w1qZQR05Zn0bc2LDyNaDAhsrhDS5iRHPTN10+EmNx8E2OpIPC4SjWRDQVOgqcbnXdYMlpiZ168xLBqn1fx9659gGK/7f9Yc6GxpoJH8kwAUYAYyLGsYeEBt1kL6kpXjgA==", + discriminator=self.th_sed_later_discriminator, + iterations=10000, salt=base64.b64encode(bytes('SaltyMcSalterson', 'utf-8'))) + await self.send_single_cmd(cmd, endpoint=th_sed_later_bdbi_endpoint, timedRequestTimeoutMs=5000) + + logging.info("Commissioning Window open for TH_SED_L.") + + self.step(7) + + self.th_sed_later_nodeid = 2222 + await self.TH_server_controller.CommissionOnNetwork(nodeId=self.th_sed_later_nodeid, setupPinCode=self.sync_passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.th_sed_later_discriminator) + logging.info("Commissioning TH_SED_L complete") + + +if __name__ == "__main__": + default_matter_test_main() From 884360a66546ccbfc5474f0a70a69a9ed52d40cb Mon Sep 17 00:00:00 2001 From: Douglas Rocha Ferraz Date: Wed, 31 Jul 2024 16:19:41 -0400 Subject: [PATCH 11/40] Test automation for FabricSync ICD BridgedDeviceBasicInfoCluster (#34628) * WIP Bridged ICD, commissioning to both fabrics * wip testing sending KeepActive * wip most steps implemented * using SIGSTOP and SIGCONT to control ICD server pausing * Update src/python_testing/TC_BRBINFO_4_1.py Co-authored-by: Terence Hampson * comments addressed * more comments addressed * lint pass * Update src/python_testing/TC_BRBINFO_4_1.py Co-authored-by: C Freeman * comments addressed, incl TH_SERVER configurable * added setupQRCode and setupManualCode as options for DUT commissioning * Restyled by autopep8 * Restyled by isort * Update src/python_testing/TC_BRBINFO_4_1.py Co-authored-by: Terence Hampson * Update src/python_testing/TC_BRBINFO_4_1.py Co-authored-by: Terence Hampson * Update src/python_testing/TC_BRBINFO_4_1.py Co-authored-by: Terence Hampson * comments addressed * Restyled by autopep8 --------- Co-authored-by: Terence Hampson Co-authored-by: C Freeman Co-authored-by: Restyled.io --- src/python_testing/TC_BRBINFO_4_1.py | 275 +++++++++++++++++++++++++++ 1 file changed, 275 insertions(+) create mode 100644 src/python_testing/TC_BRBINFO_4_1.py diff --git a/src/python_testing/TC_BRBINFO_4_1.py b/src/python_testing/TC_BRBINFO_4_1.py new file mode 100644 index 00000000000000..6c65f634bb6a7b --- /dev/null +++ b/src/python_testing/TC_BRBINFO_4_1.py @@ -0,0 +1,275 @@ +# +# 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. +# + +# This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: +# TH_SERVER must support following arguments: --secured-device-port --discriminator --passcode --KVS +# E.g: python3 src/python_testing/TC_BRBINFO_4_1.py --commissioning-method on-network --qr-code MT:-24J042C00KA0648G00 \ +# --string-arg th_server_app_path:out/linux-x64-lit-icd/lit-icd-app + +import logging +import os +import queue +import signal +import subprocess +import time +import uuid + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from matter_testing_support import MatterBaseTest, SimpleEventCallback, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + +logger = logging.getLogger(__name__) +_ROOT_ENDPOINT_ID = 0 + + +class TC_BRBINFO_4_1(MatterBaseTest): + + # + # Class Helper functions + # + + async def _read_attribute_expect_success(self, endpoint, cluster, attribute, node_id): + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute, node_id=node_id) + + # Override default timeout to support a 60 min wait + @property + def default_timeout(self) -> int: + return 63*60 + + def desc_TC_BRBINFO_4_1(self) -> str: + """Returns a description of this test""" + return "[TC_BRBINFO_4_1] Verification of KeepActive Command [DUT-Server]" + + def steps_TC_BRBINFO_4_1(self) -> list[TestStep]: + steps = [ + TestStep("0", "Preconditions"), + TestStep("1a", "TH reads from the ICD the A_IDLE_MODE_DURATION, A_ACTIVE_MODE_DURATION, and ACTIVE_MODE_THRESHOLD attributes"), + TestStep("1b", "Simple KeepActive command w/ subscription. ActiveChanged event received by TH contains PromisedActiveDuration"), + TestStep("2", "Sends 3x KeepActive commands w/ subscription. ActiveChanged event received ONCE and contains PromisedActiveDuration"), + TestStep("3", "KeepActive not returned after 60 minutes of offline ICD"), + ] + return steps + + def _ask_for_vendor_commissioniong_ux_operation(self, discriminator, setupPinCode, setupManualCode, setupQRCode): + self.wait_for_user_input( + prompt_msg=f"Using the DUT vendor's provided interface, commission the ICD device using the following parameters:\n" + f"- discriminator: {discriminator}\n" + f"- setupPinCode: {setupPinCode}\n" + f"- setupQRCode: {setupQRCode}\n" + f"- setupManualcode: {setupManualCode}\n" + f"If using FabricSync Admin test app, you may type:\n" + f">>> pairing onnetwork 111 {setupPinCode}") + + async def _send_keep_active_command(self, duration, endpoint_id) -> int: + logging.info("Sending keep active command") + keep_active = await self.default_controller.SendCommand(nodeid=self.dut_node_id, endpoint=endpoint_id, payload=Clusters.Objects.BridgedDeviceBasicInformation.Commands.KeepActive(stayActiveDuration=duration)) + return keep_active + + async def _wait_for_active_changed_event(self, timeout) -> int: + try: + promised_active_duration = self.q.get(block=True, timeout=timeout) + logging.info(f"PromisedActiveDuration: {promised_active_duration}") + return promised_active_duration + except queue.Empty: + asserts.fail("Timeout on event ActiveChanged") + + async def _get_dynamic_endpoint(self) -> int: + root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=_ROOT_ENDPOINT_ID) + set_of_endpoints_after_adding_device = set(root_part_list) + + asserts.assert_true(set_of_endpoints_after_adding_device.issuperset( + self.set_of_dut_endpoints_before_adding_device), "Expected only new endpoints to be added") + unique_endpoints_set = set_of_endpoints_after_adding_device - self.set_of_dut_endpoints_before_adding_device + asserts.assert_equal(len(unique_endpoints_set), 1, "Expected only one new endpoint") + newly_added_endpoint = list(unique_endpoints_set)[0] + return newly_added_endpoint + + @async_test_body + async def setup_class(self): + # These steps are not explicitly, but they help identify the dynamically added endpoint + # The second part of this process happens on _get_dynamic_endpoint() + root_part_list = await self.read_single_attribute_check_success(cluster=Clusters.Descriptor, attribute=Clusters.Descriptor.Attributes.PartsList, endpoint=_ROOT_ENDPOINT_ID) + self.set_of_dut_endpoints_before_adding_device = set(root_part_list) + + super().setup_class() + app = self.user_params.get("th_server_app_path", None) + if not app: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + + self.kvs = f'kvs_{str(uuid.uuid4())}' + self.port = 5543 + discriminator = 3850 + passcode = 20202021 + app_args = f'--secured-device-port {self.port} --discriminator {discriminator} --passcode {passcode} --KVS {self.kvs} ' + cmd = f'{app} {app_args}' + + logging.info("Starting ICD Server App") + self.app_process = subprocess.Popen(cmd, bufsize=0, shell=True) + logging.info("ICD started") + time.sleep(3) + + logging.info("Commissioning of ICD to fabric one (TH)") + self.icd_nodeid = 1111 + + await self.default_controller.CommissionOnNetwork(nodeId=self.icd_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + + logging.info("Commissioning of ICD to fabric two (DUT)") + params = await self.openCommissioningWindow(dev_ctrl=self.default_controller, node_id=self.icd_nodeid) + + self._ask_for_vendor_commissioniong_ux_operation(params.randomDiscriminator, params.commissioningParameters.setupPinCode, + params.commissioningParameters.setupManualCode, params.commissioningParameters.setupQRCode) + + def teardown_class(self): + logging.warning("Stopping app with SIGTERM") + self.app_process.send_signal(signal.SIGTERM.value) + self.app_process.wait() + os.remove(self.kvs) + super().teardown_class() + + # + # BRBINFO 4.1 Test Body + # + + @async_test_body + async def test_TC_BRBINFO_4_1(self): + self.is_ci = self.check_pics('PICS_SDK_CI_ONLY') + icdm_cluster = Clusters.Objects.IcdManagement + icdm_attributes = icdm_cluster.Attributes + brb_info_cluster = Clusters.Objects.BridgedDeviceBasicInformation + basic_info_cluster = Clusters.Objects.BasicInformation + basic_info_attributes = basic_info_cluster.Attributes + + dynamic_endpoint_id = await self._get_dynamic_endpoint() + logging.info(f"Dynamic endpoint is {dynamic_endpoint_id}") + + # Preconditions + self.step("0") + + logging.info("Ensuring DUT is commissioned to TH") + + # Confirms commissioning of DUT on TH as it reads its fature map + await self._read_attribute_expect_success( + _ROOT_ENDPOINT_ID, + basic_info_cluster, + basic_info_attributes.FeatureMap, + self.dut_node_id + ) + + logging.info("Ensuring ICD is commissioned to TH") + + # Confirms commissioning of ICD on TH as it reads its feature map + await self._read_attribute_expect_success( + _ROOT_ENDPOINT_ID, + basic_info_cluster, + basic_info_attributes.FeatureMap, + self.icd_nodeid + ) + + self.step("1a") + + idle_mode_duration = await self._read_attribute_expect_success( + _ROOT_ENDPOINT_ID, + icdm_cluster, + icdm_attributes.IdleModeDuration, + self.icd_nodeid + ) + logging.info(f"IdleModeDuration: {idle_mode_duration}") + + active_mode_duration = await self._read_attribute_expect_success( + _ROOT_ENDPOINT_ID, + icdm_cluster, + icdm_attributes.ActiveModeDuration, + self.icd_nodeid + ) + logging.info(f"ActiveModeDuration: {active_mode_duration}") + + self.step("1b") + + # Subscription to ActiveChanged + event = brb_info_cluster.Events.ActiveChanged + self.q = queue.Queue() + urgent = 1 + cb = SimpleEventCallback("ActiveChanged", event.cluster_id, event.event_id, self.q) + subscription = await self.default_controller.ReadEvent(nodeid=self.dut_node_id, events=[(dynamic_endpoint_id, event, urgent)], reportInterval=[1, 3]) + subscription.SetEventUpdateCallback(callback=cb) + + stay_active_duration = 1000 + logging.info(f"Sending KeepActiveCommand({stay_active_duration}ms)") + self._send_keep_active_command(stay_active_duration, dynamic_endpoint_id) + + logging.info("Waiting for ActiveChanged from DUT...") + promised_active_duration = await self._wait_for_active_changed_event((idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000) + + asserts.assert_greater_equal(promised_active_duration, stay_active_duration, "PromisedActiveDuration < StayActiveDuration") + + self.step("2") + + stay_active_duration = 1500 + logging.info(f"Sending KeepActiveCommand({stay_active_duration}ms)") + self._send_keep_active_command(stay_active_duration) + + logging.info("Waiting for ActiveChanged from DUT...") + promised_active_duration = await self._wait_for_active_changed_event((idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000) + + # wait for active time duration + time.sleep(max(stay_active_duration/1000, promised_active_duration)) + # ICD now should be in idle mode + + # sends 3x keep active commands + logging.info(f"Sending KeepActiveCommand({stay_active_duration})") + self._send_keep_active_command(stay_active_duration, dynamic_endpoint_id) + time.sleep(100) + logging.info(f"Sending KeepActiveCommand({stay_active_duration})") + self._send_keep_active_command(stay_active_duration, dynamic_endpoint_id) + time.sleep(100) + logging.info(f"Sending KeepActiveCommand({stay_active_duration})") + self._send_keep_active_command(stay_active_duration, dynamic_endpoint_id) + time.sleep(100) + + logging.info("Waiting for ActiveChanged from DUT...") + promised_active_duration = await self._wait_for_active_changed_event((idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000) + + asserts.assert_equal(self.q.qSize(), 0, "More than one event received from DUT") + + self.step("3") + + stay_active_duration = 10000 + logging.info(f"Sending KeepActiveCommand({stay_active_duration})") + self._send_keep_active_command(stay_active_duration, dynamic_endpoint_id) + + # stops (halts) the ICD server process by sending a SIGTOP signal + self.app_process.send_signal(signal.SIGSTOP.value) + + if not self.is_ci: + logging.info("Waiting for 60 minutes") + self._timeout + time.sleep(60*60) + + # resumes (continues) the ICD server process by sending a SIGCONT signal + self.app_process.send_signal(signal.SIGCONT.value) + + # wait for active changed event, expect no event will be sent + event_timeout = (idle_mode_duration + max(active_mode_duration, stay_active_duration))/1000 + try: + promised_active_duration = self.q.get(block=True, timeout=event_timeout) + finally: + asserts.assert_true(queue.Empty(), "ActiveChanged event received when not expected") + + +if __name__ == "__main__": + default_matter_test_main() From d88dee09ad40cb82ac3ec215e035b0388d96e7ef Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:24:17 -0400 Subject: [PATCH 12/40] ServiceArea test scripts (#34548) * initial commit * fix bugs * fix issues reported by the linter * fix bug in checking for unique areaDesc * add TC 1.5 * Update src/python_testing/TC_SEAR_1_2.py Co-authored-by: William * Update src/python_testing/TC_SEAR_1_2.py Co-authored-by: William * address code review comments * fix issue introduced by the previous commit * address code review feedback * Update src/python_testing/TC_SEAR_1_2.py Co-authored-by: Kiel Oleson * address code review feedback * remove PICS checked by the TC_SEAR_1.6 * more code review updates * Restyled by autopep8 --------- Co-authored-by: William Co-authored-by: Kiel Oleson Co-authored-by: Restyled.io --- src/python_testing/TC_SEAR_1_2.py | 368 ++++++++++++++++++++++++++++++ src/python_testing/TC_SEAR_1_3.py | 155 +++++++++++++ src/python_testing/TC_SEAR_1_4.py | 84 +++++++ src/python_testing/TC_SEAR_1_5.py | 283 +++++++++++++++++++++++ src/python_testing/TC_SEAR_1_6.py | 148 ++++++++++++ 5 files changed, 1038 insertions(+) create mode 100644 src/python_testing/TC_SEAR_1_2.py create mode 100644 src/python_testing/TC_SEAR_1_3.py create mode 100644 src/python_testing/TC_SEAR_1_4.py create mode 100644 src/python_testing/TC_SEAR_1_5.py create mode 100644 src/python_testing/TC_SEAR_1_6.py diff --git a/src/python_testing/TC_SEAR_1_2.py b/src/python_testing/TC_SEAR_1_2.py new file mode 100644 index 00000000000000..4ebb3342ee9bfc --- /dev/null +++ b/src/python_testing/TC_SEAR_1_2.py @@ -0,0 +1,368 @@ +# +# 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. +# + +# TODO - this was copied/pasted from another test, it needs to be reviewed and updated +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${CHIP_RVC_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +from time import sleep + +import chip.clusters as Clusters +from chip.clusters.Types import NullValue +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_SEAR_1_2(MatterBaseTest): + def __init__(self, *args): + super().__init__(*args) + self.endpoint = None + self.is_ci = False + self.app_pipe = "/tmp/chip_rvc_fifo_" + self.mapid_list = [] + + # this must be kept in sync with the definitions from the Common Landmark Semantic Tag Namespace + self.MAX_LANDMARK_ID = 0x33 + + # this must be kept in sync with the definitions from the Common Relative Position Semantic Tag Namespace + self.MAX_RELPOS_ID = 0x07 + + async def read_sear_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.ServiceArea + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + async def read_and_validate_supported_maps(self, step): + self.print_step(step, "Read SupportedMaps attribute") + supported_maps = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SupportedMaps) + logging.info("SupportedMaps: %s" % (supported_maps)) + asserts.assert_less_equal(len(supported_maps), 255, + "SupportedMaps should have max 255 entries") + + mapid_list = [m.mapID for m in supported_maps] + asserts.assert_true(len(set(mapid_list)) == len(mapid_list), "SupportedMaps must have unique MapID values!") + + name_list = [m.name for m in supported_maps] + asserts.assert_true(len(set(name_list)) == len(name_list), "SupportedMaps must have unique Name values!") + + # save so other methods can use this if neeeded + self.mapid_list = mapid_list + + async def read_and_validate_supported_areas(self, step): + self.print_step(step, "Read SupportedAreas attribute") + supported_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SupportedAreas) + logging.info("SupportedAreas: %s" % (supported_areas)) + asserts.assert_less_equal(len(supported_areas), 255, + "SupportedAreas should have max 255 entries") + areaid_list = [] + areadesc_s = set() + for a in supported_areas: + asserts.assert_true(a.areaID not in areaid_list, "SupportedAreas must have unique AreaID values!") + + areaid_list.append(a.areaID) + + if len(self.mapid_list) > 0: + asserts.assert_is_not(a.mapID, NullValue, + f"SupportedAreas entry with AreaID({a.areaID}) should not have null MapID") + asserts.assert_is(a.mapID in self.mapid_list, + f"SupportedAreas entry with AreaID({a.areaID}) has unknown MapID({a.mapID})") + k = f"mapID:{a.mapID} areaDesc:{a.areaDesc}" + asserts.assert_true(k not in areadesc_s, + f"SupportedAreas must have unique MapID({a.mapID}) + AreaDesc({a.areaDesc}) values!") + areadesc_s.add(k) + else: + # empty SupportedMaps + asserts.assert_is(a.mapID, NullValue, + f"SupportedAreas entry with AreaID({a.areaID}) should have null MapID") + k = f"areaDesc:{a.areaDesc}" + asserts.assert_true(k not in areadesc_s, f"SupportedAreas must have unique AreaDesc({a.areaDesc}) values!") + areadesc_s.add(k) + + if a.locationInfo is NullValue and a.landmarkTag is NullValue: + asserts.assert_true( + f"SupportedAreas entry with AreaID({a.areaID}) should not have null LocationInfo and null LandmarkTag") + if a.landmarkTag is not NullValue: + asserts.assert_true(a.landmarkTag <= self.MAX_LANDMARK_ID, + f"SupportedAreas entry with AreaID({a.areaID}) has invalid LandmarkTag({a.landmarkTag})") + asserts.assert_true(a.positionTag is NullValue or a.positionTag in range(0, self.MAX_RELPOS_ID), + f"SupportedAreas entry with AreaID({a.areaID}) has invalid PositionTag({a.positionTag})") + # save so other methods can use this if neeeded + self.areaid_list = areaid_list + + async def read_and_validate_selected_areas(self, step): + self.print_step(step, "Read SelectedAreas attribute") + selected_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SelectedAreas) + logging.info(f"SelectedAreas {selected_areas}") + + # TODO how to check if all entries are uint32? + + asserts.assert_true(len(selected_areas) <= len(self.areaid_list), + f"SelectedAreas(len {len(selected_areas)}) should have at most {len(self.areaid_list)} entries") + + asserts.assert_true(len(set(selected_areas)) == len(selected_areas), "SelectedAreas must have unique AreaID values!") + + for a in selected_areas: + asserts.assert_true(a in self.areaid_list, + f"SelectedAreas entry {a} has invalid value") + # save so other methods can use this if neeeded + self.selareaid_list = selected_areas + + async def read_and_validate_current_area(self, step): + self.print_step(step, "Read CurrentArea attribute") + current_area = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.CurrentArea) + logging.info(f"CurrentArea {current_area}") + + asserts.assert_true((len(self.selareaid_list) == 0 and current_area is NullValue) + or + current_area in self.selareaid_list, + f"CurrentArea {current_area} is invalid. SelectedAreas is {self.selareaid_list}.") + # save so other methods can use this if neeeded + self.current_area = current_area + + async def read_and_validate_estimated_end_time(self, step): + import time + read_time = int(time.time()) + self.print_step(step, "Read EstimatedEndTime attribute") + estimated_end_time = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.EstimatedEndTime) + logging.info(f"EstimatedEndTime {estimated_end_time}") + + if self.current_area is NullValue: + asserts.assert_true(estimated_end_time is NullValue, + "EstimatedEndTime should be null if CurrentArea is null.") + else: + # allow for some clock skew + asserts.assert_true(estimated_end_time >= read_time - 3*60, + f"EstimatedEndTime({estimated_end_time}) should be greater than the time when it was read({read_time})") + + async def read_and_validate_progress(self, step): + self.print_step(step, "Read Progress attribute") + progress = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.Progress) + logging.info(f"Progress {progress}") + + asserts.assert_true(len(progress) <= len(self.areaid_list), + f"Progress(len {len(progress)}) should have at most {len(self.areaid_list)} entries") + + progareaid_list = [] + for p in progress: + if p.areaID in progareaid_list: + asserts.fail("Progress must have unique AreaID values!") + else: + progareaid_list.append(p.areaID) + asserts.assert_true(p.areaID in self.areaid_list, + f"Progress entry has invalid AreaID value ({p.areaID})") + asserts.assert_true(p.status in (Clusters.ServiceArea.OperationalStatusEnum.kPending, + Clusters.ServiceArea.OperationalStatusEnum.kOperating, + Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + Clusters.ServiceArea.OperationalStatusEnum.kCompleted), + f"Progress entry has invalid Status value ({p.status})") + if p.status not in (Clusters.ServiceArea.OperationalStatusEnum.kSkipped, Clusters.ServiceArea.OperationalStatusEnum.kCompleted): + asserts.assert_true(p.totalOperationalTime is NullValue, + f"Progress entry should have a null TotalOperationalTime value (Status is {p.status})") + # TODO how to check that InitialTimeEstimate is either null or uint32? + + # Sends and out-of-band command to the rvc-app + def write_to_app_pipe(self, command): + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Allow some time for the command to take effect. + # This removes the test flakyness which is very annoying for everyone in CI. + sleep(0.001) + + def TC_SEAR_1_2(self) -> list[str]: + return ["SEAR.S"] + + @async_test_body + async def test_TC_SEAR_1_2(self): + self.endpoint = self.matter_test_config.endpoint + asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") + self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") + self.app_pipe = self.app_pipe + str(app_pid) + + self.print_step(1, "Commissioning, already done") + + # Ensure that the device is in the correct state + if self.is_ci: + self.write_to_app_pipe('{"Name": "Reset"}') + + if self.check_pics("SEAR.S.F02"): + await self.read_and_validate_supported_maps(step=2) + + await self.read_and_validate_supported_areas(step=3) + + await self.read_and_validate_selected_areas(step=4) + + if self.check_pics("SEAR.S.A0003"): + await self.read_and_validate_current_area(step=5) + + if self.check_pics("SEAR.S.A0004"): + await self.read_and_validate_estimated_end_time(step=6) + + if self.check_pics("SEAR.S.A0005"): + await self.read_and_validate_progress(step=7) + + if self.check_pics("SEAR.S.F02") and self.check_pics("SEAR.S.M.REMOVE_MAP"): + test_step = "Manually ensure the SupportedMaps attribute is not empty and that the device is not operating" + self.print_step("8", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_maps(step=9) + old_supported_maps = self.mapid_list + + test_step = "Manually intervene to remove one or more entries in the SupportedMaps list" + self.print_step("10", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_maps(step=11) + new_supported_maps = self.mapid_list + asserts.assert_true(len(old_supported_maps) > len(new_supported_maps), "Failed to remove map(s)") + + # NOTE the following operations are all part of step 11 - read all these attributes and check the data consistency + # after removing map(s) + await self.read_and_validate_supported_areas(step=11) + + await self.read_and_validate_selected_areas(step=11) + + if self.check_pics("SEAR.S.A0003"): + await self.read_and_validate_current_area(step=11) + + if self.check_pics("SEAR.S.A0004"): + await self.read_and_validate_estimated_end_time(step=11) + + if self.check_pics("SEAR.S.A0005"): + await self.read_and_validate_progress(step=11) + + if self.check_pics("SEAR.S.F02") and self.check_pics("SEAR.S.M.ADD_MAP"): + test_step = "Manually ensure the SupportedMaps attribute has less than 255 entries and that the device is not operating" + self.print_step("12", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_maps(step=13) + old_supported_maps = self.mapid_list + + test_step = "Manually intervene to add one or more entries to the SupportedMaps list" + self.print_step("14", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_maps(step=15) + new_supported_maps = self.mapid_list + asserts.assert_true(len(old_supported_maps) < len(new_supported_maps), "Failed to add map(s)") + + # NOTE the following operations are all part of step 15 - read all these attributes and check the data consistency + # after adding map(s) + await self.read_and_validate_supported_areas(step=15) + + await self.read_and_validate_selected_areas(step=15) + + if self.check_pics("SEAR.S.A0003"): + await self.read_and_validate_current_area(step=15) + + if self.check_pics("SEAR.S.A0004"): + await self.read_and_validate_estimated_end_time(step=15) + + if self.check_pics("SEAR.S.A0005"): + await self.read_and_validate_progress(step=15) + + if self.check_pics("SEAR.S.M.REMOVE_AREA"): + test_step = "Manually ensure the SupportedAreas attribute is not empty and that the device is not operating" + self.print_step("16", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_areas(step=17) + old_supported_areas = self.areaid_list + + test_step = "Manually intervene to remove one or more entries from the SupportedAreas list" + self.print_step("18", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_areas(step=19) + new_supported_areas = self.areaid_list + asserts.assert_true(len(old_supported_areas) > len(new_supported_areas), "Failed to remove area(s)") + + # NOTE the following operations are all part of step 19 - read all these attributes and check the data consistency + # after removing areas(s) + + await self.read_and_validate_selected_areas(step=19) + + if self.check_pics("SEAR.S.A0003"): + await self.read_and_validate_current_area(step=19) + + if self.check_pics("SEAR.S.A0004"): + await self.read_and_validate_estimated_end_time(step=19) + + if self.check_pics("SEAR.S.A0005"): + await self.read_and_validate_progress(step=19) + + if self.check_pics("SEAR.S.M.ADD_AREA"): + test_step = "Manually ensure the SupportedAreas attribute has less than 255 entries and that the device is not operating" + self.print_step("20", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_areas(step=21) + old_supported_areas = self.areaid_list + + test_step = "Manually intervene to add one or more entries to the SupportedAreas list" + self.print_step("22", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.read_and_validate_supported_areas(step=23) + new_supported_areas = self.areaid_list + asserts.assert_true(len(old_supported_areas) < len(new_supported_areas), "Failed to add area(s)") + + # NOTE the following operations are all part of step 23 - read all these attributes and check the data consistency + # after removing areas(s) + + await self.read_and_validate_selected_areas(step=23) + + if self.check_pics("SEAR.S.A0003"): + await self.read_and_validate_current_area(step=23) + + if self.check_pics("SEAR.S.A0004"): + await self.read_and_validate_estimated_end_time(step=23) + + if self.check_pics("SEAR.S.A0005"): + await self.read_and_validate_progress(step=23) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_SEAR_1_3.py b/src/python_testing/TC_SEAR_1_3.py new file mode 100644 index 00000000000000..0acee1b34cdeb8 --- /dev/null +++ b/src/python_testing/TC_SEAR_1_3.py @@ -0,0 +1,155 @@ +# +# 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. +# + +# TODO - this was copied/pasted from abother test, it needs to be reviewed and updated +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${CHIP_RVC_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +from time import sleep + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_SEAR_1_3(MatterBaseTest): + def __init__(self, *args): + super().__init__(*args) + self.endpoint = None + self.is_ci = False + self.app_pipe = "/tmp/chip_rvc_fifo_" + + async def read_sear_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.ServiceArea + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + async def read_supported_areas(self, step): + self.print_step(step, "Read SupportedAreas attribute") + supported_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SupportedAreas) + logging.info("SupportedAreas: %s" % (supported_areas)) + + return [a.areaID for a in supported_areas] + + async def read_selected_areas(self, step): + self.print_step(step, "Read SelectedAreas attribute") + selected_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SelectedAreas) + logging.info(f"SelectedAreas {selected_areas}") + + return selected_areas + + async def send_cmd_select_areas_expect_response(self, step, new_areas, expected_response): + self.print_step(step, f"Send SelectAreas command with NewAreas({new_areas})") + ret = await self.send_single_cmd(cmd=Clusters.Objects.ServiceArea.Commands.SelectAreas(newAreas=new_areas), + endpoint=self.endpoint) + + asserts.assert_equal(ret.commandResponseState.errorStateID, + expected_response, + f"Command response ({ret.commandResponseState}) doesn't match the expected one") + + # Sends and out-of-band command to the rvc-app + def write_to_app_pipe(self, command): + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Allow some time for the command to take effect. + # This removes the test flakyness which is very annoying for everyone in CI. + sleep(0.001) + + def TC_SEAR_1_3(self) -> list[str]: + return ["SEAR.S"] + + @async_test_body + async def test_TC_SEAR_1_3(self): + self.endpoint = self.matter_test_config.endpoint + asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") + self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") + self.app_pipe = self.app_pipe + str(app_pid) + + self.print_step(1, "Commissioning, already done") + + # Ensure that the device is in the correct state + if self.is_ci: + self.write_to_app_pipe('{"Name": "Reset"}') + + supported_area_ids = await self.read_supported_areas(step=2) + asserts.assert_true(len(self.supported_areas) > 0, "SupportedAreas is empty") + valid_area_id = supported_area_ids[0] + invalid_area_id = 1 + max(supported_area_ids) + + duplicated_areas = [valid_area_id, valid_area_id] + + # FIXME need to check if this is the correct name of this status code + await self.send_cmd_select_areas_expect_response(step=3, new_areas=duplicated_areas, expected_response=Clusters.ServiceArea.SelectAreasStatus.kDuplicatedAreas) + + await self.send_cmd_select_areas_expect_response(step=4, new_areas=[], expected_response=Clusters.ServiceArea.SelectAreasStatus.kSuccess) + + selected_areas = await self.read_selected_areas(step=5) + asserts.assert_true(len(selected_areas) == 0, "SelectedAreas should be empty") + + await self.send_cmd_select_areas_expect_response(step=6, new_areas=[invalid_area_id], expected_response=Clusters.ServiceArea.SelectAreasStatus.kUnsupportedArea) + + if self.check_pics("SEAR.S.M.INVALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"): + test_step = "Manually intervene to put the device in a state that prevents it from executing the SelectAreas command" + self.print_step("7", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.send_cmd_select_areas_expect_response(step=8, new_areas=[valid_area_id], expected_response=Clusters.ServiceArea.SelectAreasStatus.kInvalidInMode) + + if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL"): + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({supported_area_ids}) command" + self.print_step("9", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.send_cmd_select_areas_expect_response(step=10, new_areas=supported_area_ids, expected_response=Clusters.ServiceArea.SelectAreasStatus.kSuccess) + + selected_areas = await self.read_selected_areas(step=11) + asserts.assert_true(len(selected_areas) == len(supported_area_ids), + f"SelectedAreas({selected_areas}) should match SupportedAreas({supported_area_ids})") + + await self.send_cmd_select_areas_expect_response(step=12, new_areas=supported_area_ids, expected_response=Clusters.ServiceArea.SelectAreasStatus.kSuccess) + + if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SELECT_AREAS") and self.check_pics("SEAR.S.M.HAS_MANUAL_SELAREA_STATE_CONTROL") and self.check_pics("SEAR.S.M.SELECT_AREAS_WHILE_NON_IDLE"): + test_step = f"Manually intervene to put the device in a state that allows it to execute the SelectAreas({valid_area_id}) command, and put the device in a non-idle state" + self.print_step("13", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + if self.check_pics("SEAR.S.F00"): + await self.send_cmd_select_areas_expect_response(step=14, new_areas=[valid_area_id], expected_response=Clusters.ServiceArea.SelectAreasStatus.kSuccess) + else: + await self.send_cmd_select_areas_expect_response(step=14, new_areas=[valid_area_id], expected_response=Clusters.ServiceArea.SelectAreasStatus.kInvalidInMode) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_SEAR_1_4.py b/src/python_testing/TC_SEAR_1_4.py new file mode 100644 index 00000000000000..a6326559beaa20 --- /dev/null +++ b/src/python_testing/TC_SEAR_1_4.py @@ -0,0 +1,84 @@ +# +# 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. +# + +# TODO - this was copied/pasted from abother test, it needs to be reviewed and updated +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${CHIP_RVC_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_SEAR_1_4(MatterBaseTest): + def __init__(self, *args): + super().__init__(*args) + self.endpoint = None + self.is_ci = False + self.app_pipe = "/tmp/chip_rvc_fifo_" + + async def read_sear_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.ServiceArea + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + def TC_SEAR_1_4(self) -> list[str]: + return ["SEAR.S"] + + @async_test_body + async def test_TC_SEAR_1_4(self): + self.endpoint = self.matter_test_config.endpoint + asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") + self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") + self.app_pipe = self.app_pipe + str(app_pid) + + self.print_step(1, "Commissioning, already done") + + # Ensure that the device is in the correct state + if self.is_ci: + self.write_to_app_pipe('{"Name": "Reset"}') + + attribute_list = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AttributeList) + logging.info("AttributeList: %s" % (attribute_list)) + + if Clusters.ServiceArea.Attributes.CurrentArea not in attribute_list \ + and Clusters.ServiceArea.Attributes.Progress not in attribute_list: + + cmd_list = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.AcceptedCommandList) + logging.info("AcceptedCommandList: %s" % (cmd_list)) + asserts.assert_true(Clusters.ServiceArea.Commands.SkipArea not in cmd_list, + "SkipArea command should not be implemented if both CurrentArea and Progress are not") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_SEAR_1_5.py b/src/python_testing/TC_SEAR_1_5.py new file mode 100644 index 00000000000000..adcf8341c93389 --- /dev/null +++ b/src/python_testing/TC_SEAR_1_5.py @@ -0,0 +1,283 @@ +# +# 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. +# + +# TODO - this was copied/pasted from abother test, it needs to be reviewed and updated +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${CHIP_RVC_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +from time import sleep + +import chip.clusters as Clusters +from chip.clusters.Types import NullValue +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_SEAR_1_5(MatterBaseTest): + def __init__(self, *args): + super().__init__(*args) + self.endpoint = None + self.is_ci = False + self.app_pipe = "/tmp/chip_rvc_fifo_" + + async def read_sear_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.ServiceArea + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + async def read_supported_areas(self, step): + self.print_step(step, "Read SupportedAreas attribute") + supported_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SupportedAreas) + logging.info("SupportedAreas: %s" % (supported_areas)) + + return [a.areaID for a in supported_areas] + + async def read_selected_areas(self, step): + self.print_step(step, "Read SelectedAreas attribute") + selected_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SelectedAreas) + logging.info(f"SelectedAreas {selected_areas}") + + return selected_areas + + async def read_progress(self, step): + self.print_step(step, "Read Progress attribute") + progress = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.Progress) + logging.info(f"Progress {progress}") + + return progress + + async def read_current_area(self, step): + self.print_step(step, "Read CurrentArea attribute") + current_area = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.CurrentArea) + logging.info(f"CurrentArea {current_area}") + + return current_area + + async def send_cmd_skip_area_expect_response(self, step, skipped_area, expected_response): + self.print_step(step, f"Send SkipArea command with SkippedArea({skipped_area})") + ret = await self.send_single_cmd(cmd=Clusters.Objects.ServiceArea.Commands.SkipArea(skippedArea=skipped_area), + endpoint=self.endpoint) + + asserts.assert_equal(ret.commandResponseState.errorStateID, + expected_response, + f"Command response ({ret.commandResponseState}) doesn't match the expected one") + + # Sends and out-of-band command to the rvc-app + + def write_to_app_pipe(self, command): + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Allow some time for the command to take effect. + # This removes the test flakyness which is very annoying for everyone in CI. + sleep(0.001) + + def TC_SEAR_1_5(self) -> list[str]: + return ["SEAR.S", "SEAR.S.C02.Rsp"] + + @async_test_body + async def test_TC_SEAR_1_5(self): + self.endpoint = self.matter_test_config.endpoint + asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") + self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") + self.app_pipe = self.app_pipe + str(app_pid) + + self.print_step(1, "Commissioning, already done") + + # Ensure that the device is in the correct state + if self.is_ci: + self.write_to_app_pipe('{"Name": "Reset"}') + + supported_area_ids = await self.read_supported_areas(step=2) + asserts.assert_true(len(supported_area_ids) > 0, "SupportedAreas is empty") + valid_area_id = supported_area_ids[0] + invalid_area_id = 1 + max(supported_area_ids) + + if self.check_pics("SEAR.S.M.INVALID_STATE_FOR_SKIP") and self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"): + test_step = "Manually intervene to put the device in a state that prevents it from executing the SkipArea command \ + (e.g. set CurrentArea to null or make it not operate, i.e. be in the idle state)" + self.print_step("3", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.send_cmd_skip_area_expect_response(step=4, skipped_area=valid_area_id, + expected_response=Clusters.ServiceArea.SkipAreaStatus.kInvalidInMode) + + if self.check_pics("SEAR.S.M.NO_SELAREA_FOR_SKIP") and self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"): + test_step = "Manually intervene to put the device in a state where the state would allow it to execute the SkipArea command, \ + if SelectedAreas wasn't empty, and SelectedAreas is empty" + self.print_step("5", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.send_cmd_skip_area_expect_response(step=6, skipped_area=valid_area_id, + expected_response=Clusters.ServiceArea.SkipAreaStatus.kInvalidAreaList) + + if self.check_pics("SEAR.S.M.VALID_STATE_FOR_SKIP") and self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"): + test_step = "Manually intervene to put the device in a state that allows it to execute the SkipArea command" + self.print_step("7", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + await self.send_cmd_skip_area_expect_response(step=8, skipped_area=invalid_area_id, + expected_response=Clusters.ServiceArea.SkipAreaStatus.kInvalidSkippedArea) + + if not self.check_pics("SEAR.S.M.VALID_STATE_FOR_SKIP"): + return + + if self.check_pics("SEAR.S.A0005"): + old_progress_list = await self.read_progress(step=9) + asserts.assert_true(len(old_progress_list) > 0, f"len of Progress({len(old_progress_list)}) should not be zero)") + + selected_areas = await self.read_selected_areas(step=10) + asserts.assert_true(len(selected_areas) > 0, "SelectedAreas is empty") + + old_current_area = NullValue + if self.check_pics("SEAR.S.A0003"): + old_current_area = await self.read_current_area(step=11) + + self.print_step("12", "") + if old_current_area is not NullValue: + await self.send_cmd_skip_area_expect_response(step=13, skipped_area=old_current_area, + expected_response=Clusters.ServiceArea.SkipAreaStatus.kSuccess) + if self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"): + test_step = "(Manual operation) wait for the device to skip the current area, and start operating at\ + the next one it should process, or stop operating" + self.print_step("14", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + if self.check_pics("SEAR.S.A0005"): + new_progress_list = await self.read_progress(step=15) + asserts.assert_true(len(new_progress_list) > 0, + f"len of Progress({len(new_progress_list)}) should not be zero)") + + prog_areas = [p.areaID for p in new_progress_list] + + asserts.assert_true(old_current_area in prog_areas, f"Progress should include area {old_current_area}") + + new_current_area = await self.read_current_area(step=16) + for p in new_progress_list: + if p.areaID == old_current_area: + asserts.assert_true(p.status == Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + "Progress for areaID({old_current_area}) should be Skipped") + break + test_step = "Indicate whether the device has stopped operating (y/n)" + ret = self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + # Verify that if the device hasn't stopped operating, the `new_progress_list`'s entry matching `new_current_area` shows the Operating status + if ret != "y": + for p in new_progress_list: + if p.areaID == new_current_area: + asserts.assert_true(p.status == Clusters.ServiceArea.OperationalStatusEnum.kOperating, + "Progress for areaID({new_current_area}) should be Operating") + break + + # next, we need to check for something else (so the condition of the 'if' above becomes part of the 'then' statement below): + # if before skipping all areas, except the current one, were Skipped or Completed, the device MUST have stopped operating + was_only_skipped_or_completed = True + for p in old_progress_list: + if p.areaID != old_current_area: + if p.status not in (Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + Clusters.ServiceArea.OperationalStatusEnum.kCompleted): + was_only_skipped_or_completed = False + break + if was_only_skipped_or_completed: + asserts.assert_true(ret == "y", "The device should not be operating") + + self.print_step("17", "") + return + + if not self.check_pics("SEAR.S.A0005"): + return + + if self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"): + test_step = "Manually intervene to put the device in a state that allows it to execute the SkipArea command" + self.print_step("18", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + self.print_step("19", "") + if len(old_progress_list) == 0: + return + + area_to_skip = NullValue + self.print_step("20", "") + for p in old_progress_list: + if p.status in (Clusters.ServiceArea.OperationalStatusEnum.kPending, + Clusters.ServiceArea.OperationalStatusEnum.kOperating): + area_to_skip = p.areaID + break + + if area_to_skip is NullValue: + return + + await self.send_cmd_skip_area_expect_response(step=21, skipped_area=area_to_skip, + expected_response=Clusters.ServiceArea.SkipAreaStatus.kSuccess) + + if self.check_pics("SEAR.S.M.HAS_MANUAL_SKIP_STATE_CONTROL"): + test_step = "(Manual operation) wait for the device to update Progress or to stop operating" + self.print_step("22", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + new_progress_list = await self.read_progress(step=23) + asserts.assert_true(len(new_progress_list) > 0, f"len of Progress({len(new_progress_list)}) should not be zero)") + + for p in new_progress_list: + if p.areaID == area_to_skip: + asserts.assert_true(p.status == Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + "Progress for areaID({new_current_area}) should be Skipped") + break + + test_step = "Indicate whether the device has stopped operating (y/n)" + ret = self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + was_only_skipped_or_completed = True + for p in old_progress_list: + if p.areaID != area_to_skip: + if p.status not in (Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + Clusters.ServiceArea.OperationalStatusEnum.kCompleted): + was_only_skipped_or_completed = False + break + if was_only_skipped_or_completed: + asserts.assert_true(ret == "y", "The device should not be operating") + for p in new_progress_list: + if p.areaID == old_current_area: + asserts.assert_true(p.status == Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + "Progress for areaID({old_current_area}) should be Skipped") + break + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_SEAR_1_6.py b/src/python_testing/TC_SEAR_1_6.py new file mode 100644 index 00000000000000..02a0fcdd33133a --- /dev/null +++ b/src/python_testing/TC_SEAR_1_6.py @@ -0,0 +1,148 @@ +# +# 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. +# + +# TODO - this was copied/pasted from abother test, it needs to be reviewed and updated +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${CHIP_RVC_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS examples/rvc-app/rvc-common/pics/rvc-app-pics-values --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging +from time import sleep + +import chip.clusters as Clusters +from chip.clusters.Types import NullValue +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_SEAR_1_6(MatterBaseTest): + def __init__(self, *args): + super().__init__(*args) + self.endpoint = None + self.is_ci = False + self.app_pipe = "/tmp/chip_rvc_fifo_" + + async def read_sear_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.ServiceArea + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + async def read_supported_areas(self, step): + self.print_step(step, "Read SupportedAreas attribute") + supported_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SupportedAreas) + logging.info("SupportedAreas: %s" % (supported_areas)) + + return [a.areaID for a in supported_areas] + + async def read_selected_areas(self, step): + self.print_step(step, "Read SelectedAreas attribute") + selected_areas = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.SelectedAreas) + logging.info(f"SelectedAreas {selected_areas}") + + return selected_areas + + async def read_progress(self, step): + self.print_step(step, "Read Progress attribute") + progress = await self.read_sear_attribute_expect_success( + endpoint=self.endpoint, attribute=Clusters.ServiceArea.Attributes.Progress) + logging.info(f"Progress {progress}") + + return progress + + # Sends and out-of-band command to the rvc-app + def write_to_app_pipe(self, command): + with open(self.app_pipe, "w") as app_pipe: + app_pipe.write(command + "\n") + # Allow some time for the command to take effect. + # This removes the test flakyness which is very annoying for everyone in CI. + sleep(0.001) + + def TC_SEAR_1_6(self) -> list[str]: + return ["SEAR.S", "SEAR.S.A0005", "SEAR.S.A0000", "SEAR.S.A0002", "SEAR.S.M.HAS_MANUAL_OPERATING_STATE_CONTROL"] + + @async_test_body + async def test_TC_SEAR_1_6(self): + self.endpoint = self.matter_test_config.endpoint + asserts.assert_false(self.endpoint is None, "--endpoint must be included on the command line in.") + self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") + if self.is_ci: + app_pid = self.matter_test_config.app_pid + if app_pid == 0: + asserts.fail("The --app-pid flag must be set when PICS_SDK_CI_ONLY is set") + self.app_pipe = self.app_pipe + str(app_pid) + + self.print_step(1, "Commissioning, already done") + + # Ensure that the device is in the correct state + if self.is_ci: + self.write_to_app_pipe('{"Name": "Reset"}') + + test_step = "Manually intervene to put the device in the idle state and ensure SupportedAreas and SelectedAreas are not empty" + self.print_step("2", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + supported_area_ids = await self.read_supported_areas(step=3) + asserts.assert_true(len(supported_area_ids) > 0, "SupportedAreas is empty") + + selected_areas = await self.read_selected_areas(step=4) + asserts.assert_true(len(selected_areas) > 0, "SelectedAreas is empty") + + test_step = "Manually intervene to put the device in the operating state" + self.print_step("5", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + progress_list_operating = await self.read_progress(step=6) + asserts.assert_true(len(selected_areas) == len(progress_list_operating), + f"len of SelectedAreas({len(selected_areas)}) should be equal to len of Progress({len(progress_list_operating)})") + + for p in progress_list_operating: + asserts.assert_true(p.areaID in selected_areas, f"Progress entry with unknown AreaID({p.areaID})") + asserts.assert_true(p.status in (Clusters.ServiceArea.OperationalStatusEnum.kPending, + Clusters.ServiceArea.OperationalStatusEnum.kOperating), + f"Progress entry with unexpected Status({p.status})") + asserts.assert_true(p.TotalOperationalTime is NullValue, "Progress entry with non-null TotalOperationalTime") + + test_step = "While all entries in Progress show the Pending or Operating status (i.e. \ + before any area is skipped or completed), manually intervene to put the device \ + in the idle state, by ending the operation unexpectedly (e.g. force an error)" + self.print_step("7", test_step) + if not self.is_ci: + self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n") + + progress_list_idle = await self.read_progress(step=8) + asserts.assert_true(len(selected_areas) == len(progress_list_idle), + f"len of SelectedAreas({len(selected_areas)}) should be equal to len of Progress({len(progress_list_idle)})") + + for p in progress_list_idle: + asserts.assert_true(p.areaID in selected_areas, f"Progress entry with unknown AreaID({p.areaID})") + asserts.assert_true(p.status == Clusters.ServiceArea.OperationalStatusEnum.kSkipped, + f"Progress entry with unexpected Status({p.status})") + + +if __name__ == "__main__": + default_matter_test_main() From 7a129d8334c6a3304b97a1129b48e8c8d11bb5a8 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:49:12 -0700 Subject: [PATCH 13/40] Remove manual tests for Thermostat presets (#34679) --- .../certification/Test_TC_TSTAT_4_2.yaml | 2228 ----------------- 1 file changed, 2228 deletions(-) delete mode 100644 src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml deleted file mode 100644 index b813eafd402606..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_4_2.yaml +++ /dev/null @@ -1,2228 +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: 42.4.2. [TC-TSTAT-4.2] Preset Test Cases with server as DUT - -PICS: - - TSTAT.S - -config: - nodeId: 0x12344321 - cluster: "Thermostat" - endpoint: 1 - -tests: - - label: "Step 1: Commission DUT to TH" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 2: Test Harness writes to the Presets attribute without calling - the StartPresetsSchedulesEditRequest" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #2 Test Harness Client attempts to write Presets and gets an INVALID_IN_STATE error since the client didn't send a request to edit the presets by calling StartPresetsSchedulesEditRequest command. - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": null, "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a INVALID_IN_STATE (0xCB) - - [1722285385.263] [53729:5380292] [DMG] WriteClient moving to [AwaitingDe] - [1722285385.263] [53729:5380292] [TOO] Response Failure: IM Error 0x000005CB: General error: 0xcb (INVALID_IN_STATE) - [1722285385.263] [53729:5380292] [EM] <<< [E:42658i S:21691 M:14088666 (Ack:20978215)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722285385.263] [53729:5380292] [EM] Flushed pending ack for MessageCounter:20978215 on exchange 42658i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 3a: Test Harness writes to the Presets attribute after calling - the StartPresetsSchedulesEditRequest command" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #3a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 3b: Test Harness writes to the Presets attribute adding 3 - presets for Sleep, Wake and GoingToSleep" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #3b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": null, "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": null, "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": null, "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286250.503] [54321:5397545] [DMG] WriteClient moving to [ResponseRe] - [1722286250.503] [54321:5397545] [DMG] WriteResponseMessage = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] AttributeStatusIBs = - [1722286250.503] [54321:5397545] [DMG] [ - [1722286250.503] [54321:5397545] [DMG] AttributeStatusIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] AttributePathIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] Endpoint = 0x1, - [1722286250.503] [54321:5397545] [DMG] Cluster = 0x201, - [1722286250.503] [54321:5397545] [DMG] Attribute = 0x0000_0050, - [1722286250.503] [54321:5397545] [DMG] } - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] StatusIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] status = 0x00 (SUCCESS), - [1722286250.503] [54321:5397545] [DMG] }, - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] }, - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] AttributeStatusIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] AttributePathIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] Endpoint = 0x1, - [1722286250.503] [54321:5397545] [DMG] Cluster = 0x201, - [1722286250.503] [54321:5397545] [DMG] Attribute = 0x0000_0050, - [1722286250.503] [54321:5397545] [DMG] ListIndex = Null, - [1722286250.503] [54321:5397545] [DMG] } - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] StatusIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] status = 0x00 (SUCCESS), - [1722286250.503] [54321:5397545] [DMG] }, - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] }, - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] AttributeStatusIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] AttributePathIB = - [1722286250.503] [54321:5397545] [DMG] { - [1722286250.503] [54321:5397545] [DMG] Endpoint = 0x1, - [1722286250.503] [54321:5397545] [DMG] Cluster = 0x201, - [1722286250.503] [54321:5397545] [DMG] Attribute = 0x0000_0050, - [1722286250.503] [54321:5397545] [DMG] ListIndex = Null, - [1722286250.503] [54321:5397545] [DMG] } - [1722286250.503] [54321:5397545] [DMG] - [1722286250.503] [54321:5397545] [DMG] StatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] AttributeStatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] AttributePathIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] Endpoint = 0x1, - [1722286250.504] [54321:5397545] [DMG] Cluster = 0x201, - [1722286250.504] [54321:5397545] [DMG] Attribute = 0x0000_0050, - [1722286250.504] [54321:5397545] [DMG] ListIndex = Null, - [1722286250.504] [54321:5397545] [DMG] } - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] StatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] AttributeStatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] AttributePathIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] Endpoint = 0x1, - [1722286250.504] [54321:5397545] [DMG] Cluster = 0x201, - [1722286250.504] [54321:5397545] [DMG] Attribute = 0x0000_0050, - [1722286250.504] [54321:5397545] [DMG] ListIndex = Null, - [1722286250.504] [54321:5397545] [DMG] } - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] StatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] AttributeStatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] AttributePathIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] Endpoint = 0x1, - [1722286250.504] [54321:5397545] [DMG] Cluster = 0x201, - [1722286250.504] [54321:5397545] [DMG] Attribute = 0x0000_0050, - [1722286250.504] [54321:5397545] [DMG] ListIndex = Null, - [1722286250.504] [54321:5397545] [DMG] } - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] StatusIB = - [1722286250.504] [54321:5397545] [DMG] { - [1722286250.504] [54321:5397545] [DMG] status = 0x00 (SUCCESS), - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] }, - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] ], - [1722286250.504] [54321:5397545] [DMG] - [1722286250.504] [54321:5397545] [DMG] InteractionModelRevision = 11 - [1722286250.504] [54321:5397545] [DMG] } - [1722286250.504] [54321:5397545] [DMG] WriteClient moving to [AwaitingDe] - [1722286250.504] [54321:5397545] [EM] <<< [E:14426i S:42250 M:116961408 (Ack:156984778)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286250.504] [54321:5397545] [EM] Flushed pending ack for MessageCounter:156984778 on exchange 14426i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 3c: Test Harness reads the Presets attribute without calling - the CommitPresetsSchedulesRequest command" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #3c Test Harness Client reads Presets attribute but the new additions are not committed since the client didn't call the CommitPresetsSchedulesRequest command - - ./chip-tool thermostat read presets 0x12344321 1 - On TH(chip-tool) verify that DUT successfully read Presets (but without the new changes) - [1722286701.424] [54699:5406692] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0050 DataVersion: 3807987049 - [1722286701.425] [54699:5406692] [TOO] Presets: 2 entries - [1722286701.425] [54699:5406692] [TOO] [1]: { - [1722286701.425] [54699:5406692] [TOO] PresetHandle: 01 - [1722286701.425] [54699:5406692] [TOO] PresetScenario: 1 - [1722286701.425] [54699:5406692] [TOO] CoolingSetpoint: 2500 - [1722286701.425] [54699:5406692] [TOO] HeatingSetpoint: 2100 - [1722286701.426] [54699:5406692] [TOO] BuiltIn: TRUE - [1722286701.426] [54699:5406692] [TOO] } - [1722286701.426] [54699:5406692] [TOO] [2]: { - [1722286701.426] [54699:5406692] [TOO] PresetHandle: 02 - [1722286701.426] [54699:5406692] [TOO] PresetScenario: 2 - [1722286701.426] [54699:5406692] [TOO] CoolingSetpoint: 2600 - [1722286701.426] [54699:5406692] [TOO] HeatingSetpoint: 2000 - [1722286701.426] [54699:5406692] [TOO] BuiltIn: TRUE - [1722286701.426] [54699:5406692] [TOO] } - [1722286701.426] [54699:5406692] [EM] <<< [E:49759i S:37002 M:67372150 (Ack:254131025)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 3d: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #3d Test Harness Client calls CommitPresetsSchedulesRequest command - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722287841.505] [55282:5425045] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x0 - [1722287841.505] [55282:5425045] [DMG] ICR moving to [AwaitingDe] - [1722287841.505] [55282:5425045] [EM] <<< [E:46441i S:57071 M:61366563 (Ack:138534230)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 3e: Test Harness reads the Presets attribute after calling the - CommitPresetsSchedulesRequest command" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #3e Test Harness Client reads Presets attribute and can see the added Presets. - - ./chip-tool thermostat read presets 0x12344321 1 - On TH(chip-tool) verify that DUT successfully read Presets (with the new changes) - [1722288101.757] [55446:5430009] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0050 DataVersion: 3807987055 - [1722288101.757] [55446:5430009] [TOO] Presets: 5 entries - [1722288101.758] [55446:5430009] [TOO] [1]: { - [1722288101.759] [55446:5430009] [TOO] PresetHandle: 01 - [1722288101.759] [55446:5430009] [TOO] PresetScenario: 1 - [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2500 - [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2600 - [1722288101.759] [55446:5430009] [TOO] BuiltIn: TRUE - [1722288101.759] [55446:5430009] [TOO] } - [1722288101.759] [55446:5430009] [TOO] [2]: { - [1722288101.759] [55446:5430009] [TOO] PresetHandle: 02 - [1722288101.759] [55446:5430009] [TOO] PresetScenario: 2 - [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2600 - [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2500 - [1722288101.759] [55446:5430009] [TOO] BuiltIn: TRUE - [1722288101.759] [55446:5430009] [TOO] } - [1722288101.759] [55446:5430009] [TOO] [3]: { - [1722288101.759] [55446:5430009] [TOO] PresetHandle: 03 - [1722288101.759] [55446:5430009] [TOO] PresetScenario: 3 - [1722288101.759] [55446:5430009] [TOO] Name: Sleep - [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2500 - [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2600 - [1722288101.759] [55446:5430009] [TOO] BuiltIn: FALSE - [1722288101.759] [55446:5430009] [TOO] } - [1722288101.759] [55446:5430009] [TOO] [4]: { - [1722288101.759] [55446:5430009] [TOO] PresetHandle: 04 - [1722288101.759] [55446:5430009] [TOO] PresetScenario: 4 - [1722288101.759] [55446:5430009] [TOO] Name: Wake - [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2200 - [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2900 - [1722288101.759] [55446:5430009] [TOO] BuiltIn: FALSE - [1722288101.759] [55446:5430009] [TOO] } - [1722288101.759] [55446:5430009] [TOO] [5]: { - [1722288101.759] [55446:5430009] [TOO] PresetHandle: 06 - [1722288101.759] [55446:5430009] [TOO] PresetScenario: 6 - [1722288101.759] [55446:5430009] [TOO] Name: GoingToSleep - [1722288101.759] [55446:5430009] [TOO] CoolingSetpoint: 2100 - [1722288101.759] [55446:5430009] [TOO] HeatingSetpoint: 2500 - [1722288101.759] [55446:5430009] [TOO] BuiltIn: FALSE - [1722288101.759] [55446:5430009] [TOO] } - [1722288101.759] [55446:5430009] [EM] <<< [E:64397i S:21821 M:262922240 (Ack:37271345)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722288101.760] [55446:5430009] [EM] Flushed pending ack for MessageCounter:37271345 on exchange 64397i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 4a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #4a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 4b: Test Harness writes to the Presets attribute with a - built-in preset having preset handle hex:01 removed" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #4b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722288460.741] [55752:5437815] [DMG] WriteClient moving to [ResponseRe] - [1722288460.741] [55752:5437815] [DMG] WriteResponseMessage = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] AttributeStatusIBs = - [1722288460.741] [55752:5437815] [DMG] [ - [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] AttributePathIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] Endpoint = 0x1, - [1722288460.741] [55752:5437815] [DMG] Cluster = 0x201, - [1722288460.741] [55752:5437815] [DMG] Attribute = 0x0000_0050, - [1722288460.741] [55752:5437815] [DMG] } - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] StatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] status = 0x00 (SUCCESS), - [1722288460.741] [55752:5437815] [DMG] }, - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] }, - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] AttributePathIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] Endpoint = 0x1, - [1722288460.741] [55752:5437815] [DMG] Cluster = 0x201, - [1722288460.741] [55752:5437815] [DMG] Attribute = 0x0000_0050, - [1722288460.741] [55752:5437815] [DMG] ListIndex = Null, - [1722288460.741] [55752:5437815] [DMG] } - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] StatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] status = 0x00 (SUCCESS), - [1722288460.741] [55752:5437815] [DMG] }, - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] }, - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] AttributePathIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] Endpoint = 0x1, - [1722288460.741] [55752:5437815] [DMG] Cluster = 0x201, - [1722288460.741] [55752:5437815] [DMG] Attribute = 0x0000_0050, - [1722288460.741] [55752:5437815] [DMG] ListIndex = Null, - [1722288460.741] [55752:5437815] [DMG] } - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] StatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] status = 0x00 (SUCCESS), - [1722288460.741] [55752:5437815] [DMG] }, - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] }, - [1722288460.741] [55752:5437815] [DMG] - [1722288460.741] [55752:5437815] [DMG] AttributeStatusIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.741] [55752:5437815] [DMG] AttributePathIB = - [1722288460.741] [55752:5437815] [DMG] { - [1722288460.742] [55752:5437815] [DMG] Endpoint = 0x1, - [1722288460.742] [55752:5437815] [DMG] Cluster = 0x201, - [1722288460.742] [55752:5437815] [DMG] Attribute = 0x0000_0050, - [1722288460.742] [55752:5437815] [DMG] ListIndex = Null, - [1722288460.742] [55752:5437815] [DMG] } - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] StatusIB = - [1722288460.742] [55752:5437815] [DMG] { - [1722288460.742] [55752:5437815] [DMG] status = 0x00 (SUCCESS), - [1722288460.742] [55752:5437815] [DMG] }, - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] }, - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] AttributeStatusIB = - [1722288460.742] [55752:5437815] [DMG] { - [1722288460.742] [55752:5437815] [DMG] AttributePathIB = - [1722288460.742] [55752:5437815] [DMG] { - [1722288460.742] [55752:5437815] [DMG] Endpoint = 0x1, - [1722288460.742] [55752:5437815] [DMG] Cluster = 0x201, - [1722288460.742] [55752:5437815] [DMG] Attribute = 0x0000_0050, - [1722288460.742] [55752:5437815] [DMG] ListIndex = Null, - [1722288460.742] [55752:5437815] [DMG] } - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] StatusIB = - [1722288460.742] [55752:5437815] [DMG] { - [1722288460.742] [55752:5437815] [DMG] status = 0x00 (SUCCESS), - [1722288460.742] [55752:5437815] [DMG] }, - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] }, - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] ], - [1722288460.742] [55752:5437815] [DMG] - [1722288460.742] [55752:5437815] [DMG] InteractionModelRevision = 11 - [1722288460.742] [55752:5437815] [DMG] } - [1722288460.742] [55752:5437815] [DMG] WriteClient moving to [AwaitingDe] - [1722288460.742] [55752:5437815] [EM] <<< [E:10991i S:19292 M:9249657 (Ack:153811994)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 4c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #4c Test Harness Client calls CommitPresetsSchedulesRequest command and gets UNSUPPORTED_ACCESS since a built-in preset was attempted to be removed. - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error - [1722288464.392] [55754:5437857] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e - [1722288464.392] [55754:5437857] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) - [1722288464.392] [55754:5437857] [DMG] ICR moving to [AwaitingDe] - [1722288464.392] [55754:5437857] [EM] <<< [E:45905i S:14600 M:175519796 (Ack:248690311)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 5a: Test Harness calls the SetActivePresetRequest command to - set the active preset handle" - PICS: TSTAT.S.F08 && TSTAT.S.C06.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #5a Test Harness Client calls SetActivePresetRequest command to set the active preset handle - - ./chip-tool thermostat set-active-preset-request "hex:03" 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722292538.299] [58873:5523668] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_004E DataVersion: 3470253931 - [1722292538.300] [58873:5523668] [TOO] ActivePresetHandle: 03 - [1722292538.300] [58873:5523668] [EM] <<< [E:63772i S:58620 M:79797990 (Ack:248773669)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 5b: Test Harness reads the ActivePresetHandle attribute" - PICS: TSTAT.S.F08 && TSTAT.S.A004e - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #5b Test Harness Client reads ActivePresetHandle attribute - - ./chip-tool thermostat read active-preset-handle 0x12344321 1 - On TH(chip-tool) verify that DUT successfully read ActivePresetHandle - [1722299898.382] [62999:5632512] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_004E DataVersion: 3098962545 - [1722299898.382] [62999:5632512] [TOO] ActivePresetHandle: 03 - [1722299898.382] [62999:5632512] [EM] <<< [E:27648i S:55804 M:2686999 (Ack:191947351)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 5c: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #5b Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 5d: Test Harness writes to the Presets attribute without the - preset with handle hex:03 matching the ActivePresetHandle attribute - removed" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #5c Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets ./out/debug/chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 5e: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #5e Test Harness Client calls CommitPresetsSchedulesRequest command ans gets INVALID_IN_STATE since the preset with its handle matching the active preset handle was attempted to be removed. - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an INVALID_IN_STATE (0xCB) error - [1722293312.795] [59386:5538858] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0xcb - [1722293312.795] [59386:5538858] [TOO] Error: IM Error 0x000005CB: General error: 0xcb (INVALID_IN_STATE) - [1722293312.795] [59386:5538858] [DMG] ICR moving to [AwaitingDe] - [1722293312.795] [59386:5538858] [EM] <<< [E:4647i S:21966 M:58651952 (Ack:80870764)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 6a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #6a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 6b: Test Harness writes to the Presets attribute with a - built-in preset having preset handle hex:01 modified to be not - built-in." - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #6b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 6c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #6c Test Harness Client calls CommitPresetsSchedulesRequest command gets UNSUPPORTED_ACCESS since a built-in preset was attempted to be modified to a non built-in preset - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error - [1722289468.881] [56642:5458641] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e - [1722289468.881] [56642:5458641] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) - [1722289468.881] [56642:5458641] [DMG] ICR moving to [AwaitingDe] - [1722289468.881] [56642:5458641] [EM] <<< [E:20464i S:35105 M:91065475 (Ack:114933900)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 7a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #6a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 7b: Test Harness writes to the Presets attribute with a new - preset having builtIn set to true" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #7b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": null, "name": "Vacation", "presetScenario": 5, "coolingSetpoint": 2900, "heatingSetpoint": 2000, "builtIn": true }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 7c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #6c Test Harness Client calls CommitPresetsSchedulesRequest command and gets CONSTRAINT_ERROR since a new preset was attempted to be added as a built-in preset. - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an CONSTRAINT_ERROR (0x87) error - [1722289998.305] [56996:5468872] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x87 - [1722289998.305] [56996:5468872] [TOO] Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1722289998.305] [56996:5468872] [DMG] ICR moving to [AwaitingDe] - [1722289998.305] [56996:5468872] [EM] <<< [E:44500i S:62829 M:76436393 (Ack:145233702)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 8a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #8a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 8b: Test Harness writes to the Presets attribute with a preset - having preset handle hex:08 that doesn't exist in the Presets - attribute" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #8b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:08", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 8c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #8c Test Harness Client calls CommitPresetsSchedulesRequest command gets NOT_FOUND since an existing preset was attempted to be added with a preset handle that doesn't exist in the Presets attribute - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an NOT_FOUND (0x8B) error - [1722290436.980] [57434:5479429] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x8b - [1722290436.980] [57434:5479429] [TOO] Error: IM Error 0x0000058B: General error: 0x8b (NOT_FOUND) - [1722290436.980] [57434:5479429] [DMG] ICR moving to [AwaitingDe] - [1722290436.980] [57434:5479429] [EM] <<< [E:54210i S:10110 M:158287615 (Ack:73923062)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 9a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #9a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: "Step 9b: Test Harness writes to the Presets attribute" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #8b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 9c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #8c Test Harness Client calls CommitPresetsSchedulesRequest command gets CONSTRAINT_ERROR since preset with preset handle hex:03 is duplicated - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends a CONSTRAINT_ERROR (0x87) error - [1722302289.994] [63677:5670818] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x87 - [1722302289.994] [63677:5670818] [TOO] Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1722302289.994] [63677:5670818] [DMG] ICR moving to [AwaitingDe] - [1722302289.994] [63677:5670818] [EM] <<< [E:25209i S:7768 M:264197735 (Ack:106550461)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 10a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #10a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 10b: Test Harness writes to the Presets attribute wherein a - built-in preset is modified to a non built-in preset" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #10b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 10c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #10c Test Harness Client calls CommitPresetsSchedulesRequest command gets UNSUPPORTED_ACCESS since built-in preset with handle hex:01 was attempted to be modified to a not built-in preset - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error - [1722289468.881] [56642:5458641] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e - [1722289468.881] [56642:5458641] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) - [1722289468.881] [56642:5458641] [DMG] ICR moving to [AwaitingDe] - [1722289468.881] [56642:5458641] [EM] <<< [E:20464i S:35105 M:91065475 (Ack:114933900)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 11a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #11a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 11b: Test Harness writes to the Presets attribute wherein a non - built-in preset is modified to a built-in preset" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #11b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 11c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #11c Test Harness Client calls CommitPresetsSchedulesRequest command gets UNSUPPORTED_ACCESS since non built-in preset with handle hex:03 was attempted to be modified to be built-in - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an UNSUPPORTED_ACCESS (0x7E) error - [1722297542.066] [60654:5591651] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x7e - [1722297542.066] [60654:5591651] [TOO] Error: IM Error 0x0000057E: General error: 0x7e (UNSUPPORTED_ACCESS) - [1722297542.066] [60654:5591651] [DMG] ICR moving to [AwaitingDe] - [1722297542.066] [60654:5591651] [EM] <<< [E:11999i S:35595 M:148057801 (Ack:14642826)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 12a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #12a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 12b: Test Harness writes to the Presets attribute with a preset - that doesn't support names in the PresetTypeFeatures bitmap but has a - name" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #11b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "name": "Occupied", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "hex:03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }, {"presetHandle": "hex:06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 2100, "heatingSetpoint": 2500, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722289461.377] [56636:5458560] [EM] <<< [E:23635i S:58282 M:220756286 (Ack:5366080)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 12c: Test Harness calls the CommitPresetsSchedulesRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C09.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #11c Test Harness Client calls CommitPresetsSchedulesRequest command gets CONSTRAINT_ERROR since we attempted to add a name to a preset with handle hex:01 that doesn't support names. - - ./chip-tool thermostat commit-presets-schedules-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends an CONSTRAINT_ERROR (0x87) error - [1722298150.233] [60910:5602100] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x87 - [1722298150.233] [60910:5602100] [TOO] Error: IM Error 0x00000587: General error: 0x87 (CONSTRAINT_ERROR) - [1722298150.233] [60910:5602100] [DMG] ICR moving to [AwaitingDe] - [1722298150.233] [60910:5602100] [EM] <<< [E:44287i S:42687 M:5072557 (Ack:66989213)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - #TODO: Add tests for the total number of Presets exceeds the NumberOfPresets supported. Also Add tests for adding presets with preset scenario not present in PresetTypes. - - - label: - "Step 13a: Test Harness calls the StartPresetsSchedulesEditRequest - command to edit presets" - PICS: TSTAT.S.F08 && TSTAT.S.C07.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #13a Test Harness Client calls StartPresetsSchedulesEditRequest command - - ./chip-tool thermostat start-presets-schedules-edit-request 180 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722286001.805] [54149:5392862] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0007 Status=0x0 - [1722286001.805] [54149:5392862] [DMG] ICR moving to [AwaitingDe] - [1722286001.805] [54149:5392862] [EM] <<< [E:7545i S:16937 M:144975449 (Ack:93571372)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286001.806] [54149:5392862] [EM] Flushed pending ack for MessageCounter:93571372 on exchange 7545i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 13b: Test Harness writes to the Presets attribute but calls - CancelPresetsSchedulesEditRequest command to cancel the edit request" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #13b Test Harness Client attempts to write Presets and gets SUCCESS - - ./chip-tool thermostat write presets '[ {"presetHandle": "hex:01", "presetScenario": 1, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": true }, {"presetHandle": "hex:02", "presetScenario": 2, "coolingSetpoint": 2600, "heatingSetpoint": 2500, "builtIn": true }, {"presetHandle": "03", "name": "Sleep", "presetScenario": 3, "coolingSetpoint": 2500, "heatingSetpoint": 2600, "builtIn": false }, {"presetHandle": "04", "name": "Wake", "presetScenario": 4, "coolingSetpoint": 2200, "heatingSetpoint": 2900, "builtIn": false }, {"presetHandle": null, "name": "Vacation", "presetScenario": 5, "coolingSetpoint": 2900, "heatingSetpoint": 2000, "builtIn": false }, {"presetHandle": "06", "name": "GoingToSleep", "presetScenario": 6, "coolingSetpoint": 3000, "heatingSetpoint": 1900, "builtIn": false }]' 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722289461.376] [56636:5458560] [DMG] WriteClient moving to [ResponseRe] - [1722289461.376] [56636:5458560] [DMG] WriteResponseMessage = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIBs = - [1722289461.376] [56636:5458560] [DMG] [ - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.376] [56636:5458560] [DMG] } - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] StatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] }, - [1722289461.376] [56636:5458560] [DMG] - [1722289461.376] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] AttributePathIB = - [1722289461.376] [56636:5458560] [DMG] { - [1722289461.376] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.376] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.376] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.376] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] AttributeStatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] AttributePathIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] Endpoint = 0x1, - [1722289461.377] [56636:5458560] [DMG] Cluster = 0x201, - [1722289461.377] [56636:5458560] [DMG] Attribute = 0x0000_0050, - [1722289461.377] [56636:5458560] [DMG] ListIndex = Null, - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] StatusIB = - [1722289461.377] [56636:5458560] [DMG] { - [1722289461.377] [56636:5458560] [DMG] status = 0x00 (SUCCESS), - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] }, - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] ], - [1722289461.377] [56636:5458560] [DMG] - [1722289461.377] [56636:5458560] [DMG] InteractionModelRevision = 11 - [1722289461.377] [56636:5458560] [DMG] } - [1722289461.377] [56636:5458560] [DMG] WriteClient moving to [AwaitingDe] - [1722286250.504] [54321:5397545] [EM] <<< [E:14426i S:42250 M:116961408 (Ack:156984778)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - [1722286250.504] [54321:5397545] [EM] Flushed pending ack for MessageCounter:156984778 on exchange 14426i - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 13c: Test Harness calls the CancelPresetsSchedulesEditRequest - command" - PICS: TSTAT.S.F08 && TSTAT.S.C08.Rsp - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #13c Test Harness Client calls CancelPresetsSchedulesEditRequest command - - ./chip-tool thermostat cancel-presets-schedules-edit-request 0x12344321 1 - On TH(chip-tool) verify that DUT sends a success response - [1722287841.505] [55282:5425045] [DMG] Received Command Response Status for Endpoint=1 Cluster=0x0000_0201 Command=0x0000_0009 Status=0x0 - [1722287841.505] [55282:5425045] [DMG] ICR moving to [AwaitingDe] - [1722287841.505] [55282:5425045] [EM] <<< [E:46441i S:57071 M:61366563 (Ack:138534230)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" - - - label: - "Step 13d: Test Harness reads the Presets attribute after calling the - CancelPresetsSchedulesEditRequest command" - PICS: TSTAT.S.F08 && TSTAT.S.A0050 - verification: | - Optional Attribute - If it is supported, then in TH log it will results in displaying the value, else it will display UNSUPPORTED_ATTRIBUTE. Below is the log of RPI the result may be vary on the basis of dut implementation. - - #3c Test Harness Client reads Presets attribute - - ./chip-tool thermostat read presets 0x12344321 1 - On TH(chip-tool) verify that DUT successfully read Presets (but without the Vacation preset added) - [1722299465.497] [62905:5625656] [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0050 DataVersion: 3098962545 - [1722299465.497] [62905:5625656] [TOO] Presets: 5 entries - [1722299465.498] [62905:5625656] [TOO] [1]: { - [1722299465.498] [62905:5625656] [TOO] PresetHandle: 01 - [1722299465.498] [62905:5625656] [TOO] PresetScenario: 1 - [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2500 - [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2600 - [1722299465.498] [62905:5625656] [TOO] BuiltIn: TRUE - [1722299465.498] [62905:5625656] [TOO] } - [1722299465.498] [62905:5625656] [TOO] [2]: { - [1722299465.498] [62905:5625656] [TOO] PresetHandle: 02 - [1722299465.498] [62905:5625656] [TOO] PresetScenario: 2 - [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2600 - [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2500 - [1722299465.498] [62905:5625656] [TOO] BuiltIn: TRUE - [1722299465.498] [62905:5625656] [TOO] } - [1722299465.498] [62905:5625656] [TOO] [3]: { - [1722299465.498] [62905:5625656] [TOO] PresetHandle: 03 - [1722299465.498] [62905:5625656] [TOO] PresetScenario: 3 - [1722299465.498] [62905:5625656] [TOO] Name: Sleep - [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2500 - [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2600 - [1722299465.498] [62905:5625656] [TOO] BuiltIn: FALSE - [1722299465.498] [62905:5625656] [TOO] } - [1722299465.498] [62905:5625656] [TOO] [4]: { - [1722299465.498] [62905:5625656] [TOO] PresetHandle: 04 - [1722299465.498] [62905:5625656] [TOO] PresetScenario: 4 - [1722299465.498] [62905:5625656] [TOO] Name: Wake - [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2200 - [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2900 - [1722299465.498] [62905:5625656] [TOO] BuiltIn: FALSE - [1722299465.498] [62905:5625656] [TOO] } - [1722299465.498] [62905:5625656] [TOO] [5]: { - [1722299465.498] [62905:5625656] [TOO] PresetHandle: 06 - [1722299465.498] [62905:5625656] [TOO] PresetScenario: 6 - [1722299465.498] [62905:5625656] [TOO] Name: Vacationleep - [1722299465.498] [62905:5625656] [TOO] CoolingSetpoint: 2100 - [1722299465.498] [62905:5625656] [TOO] HeatingSetpoint: 2500 - [1722299465.498] [62905:5625656] [TOO] BuiltIn: FALSE - [1722299465.498] [62905:5625656] [TOO] } - [1722299465.498] [62905:5625656] [EM] <<< [E:53084i S:11903 M:249395534 (Ack:245071987)] (S) Msg TX to 1:000000000000006E [FEC4] [UDP:[fe80::1%lo0]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) (B:34) - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' after success" - - name: "expectedValue" - value: "y" From 6c0923661c312db4923404f91c6603bbfa1d5898 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:28:53 +1200 Subject: [PATCH 14/40] Dump details about leaked ExchangeContexts before aborting (#34617) * Dump details about leaked ExchangeContexts before aborting This is implemented via a VerifyOrDieWithObject() variant of the existing VerifyOrDie() macro that calls a DumpToLog() method on the provided object if it exists (otherwise this is simply a no-op). If CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE is not enabled, VerifyOrDieWithObject() simply behaves like a plain VerifyOrDie(). DumpToLog() implementations can use ChipLogFormatRtti to log type information about an object (usually a delegate); if RTTI is disabled this simply outputs whether the object was null or not. * Address review comments * Make gcc happy and improve documentation * Remove unused include * Fix compile error without CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE * Avoid unused parameter warning --- src/lib/support/BUILD.gn | 6 ++- src/lib/support/CodeUtils.h | 16 +++++++ src/lib/support/Compiler.h | 24 ++++++++++ src/lib/support/ObjectDump.h | 57 +++++++++++++++++++++++ src/lib/support/Pool.h | 29 +++++++++++- src/lib/support/logging/TextOnlyLogging.h | 20 ++++++++ src/messaging/ExchangeContext.cpp | 8 ++-- src/messaging/ExchangeContext.h | 8 +++- src/messaging/tests/TestExchange.cpp | 12 +++++ 9 files changed, 172 insertions(+), 8 deletions(-) create mode 100644 src/lib/support/Compiler.h create mode 100644 src/lib/support/ObjectDump.h diff --git a/src/lib/support/BUILD.gn b/src/lib/support/BUILD.gn index 27f52465858b1d..0b1d353821dabf 100644 --- a/src/lib/support/BUILD.gn +++ b/src/lib/support/BUILD.gn @@ -68,6 +68,7 @@ source_set("logging_constants") { source_set("attributes") { sources = [ + "Compiler.h", "DLLUtil.h", "EnforceFormat.h", ] @@ -132,7 +133,10 @@ source_set("text_only_logging") { } source_set("verifymacros") { - sources = [ "CodeUtils.h" ] + sources = [ + "CodeUtils.h", + "ObjectDump.h", + ] public_deps = [ ":attributes", diff --git a/src/lib/support/CodeUtils.h b/src/lib/support/CodeUtils.h index 800123aa456851..fb659c47939afd 100644 --- a/src/lib/support/CodeUtils.h +++ b/src/lib/support/CodeUtils.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -547,6 +548,21 @@ inline void chipDie(void) #define VerifyOrDie(aCondition) VerifyOrDieWithoutLogging(aCondition) #endif // CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE +/** + * @def VerifyOrDieWithObject(aCondition, aObject) + * + * Like VerifyOrDie(), but calls DumpObjectToLog() + * on the provided object on failure before aborting + * if CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE is enabled. + */ +#if CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE +#define VerifyOrDieWithObject(aCondition, aObject) \ + nlABORT_ACTION(aCondition, ::chip::DumpObjectToLog(aObject); \ + ChipLogError(Support, "VerifyOrDie failure at %s:%d: %s", __FILE__, __LINE__, #aCondition)) +#else // CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE +#define VerifyOrDieWithObject(aCondition, aObject) VerifyOrDieWithoutLogging(aCondition) +#endif // CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE + /** * @def VerifyOrDieWithMsg(aCondition, aModule, aMessage, ...) * diff --git a/src/lib/support/Compiler.h b/src/lib/support/Compiler.h new file mode 100644 index 00000000000000..0c26e185a23349 --- /dev/null +++ b/src/lib/support/Compiler.h @@ -0,0 +1,24 @@ +/* + * 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. + */ + +// CHIP_HAVE_RTTI: Is C++ RTTI enabled? +#if defined(__clang__) +#define CHIP_HAVE_RTTI __has_feature(cxx_rtti) +#elif defined(__GNUC__) && defined(__GXX_RTTI) +#define CHIP_HAVE_RTTI 1 +#else +#define CHIP_HAVE_RTTI 0 +#endif diff --git a/src/lib/support/ObjectDump.h b/src/lib/support/ObjectDump.h new file mode 100644 index 00000000000000..d297cd5b590141 --- /dev/null +++ b/src/lib/support/ObjectDump.h @@ -0,0 +1,57 @@ +/* + * + * 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 + +namespace chip { + +/** + * A dumpable object that can log some useful state for debugging in fatal + * error scenarios by exposing a `void DumpToLog() const` method. The method + * should log key details about the state of object using ChipLogError(). + */ +template +struct IsDumpable : std::false_type +{ +}; +template +struct IsDumpable().DumpToLog())>> : std::true_type +{ +}; + +struct DumpableTypeExample +{ + void DumpToLog() const {}; +}; +static_assert(IsDumpable::value); + +/** + * Calls DumpToLog() on the object, if supported. + */ +template +void DumpObjectToLog([[maybe_unused]] const T * object) +{ + if constexpr (IsDumpable::value) + { + object->DumpToLog(); + } +} + +} // namespace chip diff --git a/src/lib/support/Pool.h b/src/lib/support/Pool.h index e4fb31769f4193..3ab4b8db6713ba 100644 --- a/src/lib/support/Pool.h +++ b/src/lib/support/Pool.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -263,7 +264,7 @@ class BitMapObjectPool : public internal::StaticAllocatorBitmap { public: BitMapObjectPool() : StaticAllocatorBitmap(mData.mMemory, mUsage, N, sizeof(T)) {} - ~BitMapObjectPool() { VerifyOrDie(Allocated() == 0); } + ~BitMapObjectPool() { VerifyOrDieWithObject(Allocated() == 0, this); } BitmapActiveObjectIterator begin() { return BitmapActiveObjectIterator(this, FirstActiveIndex()); } BitmapActiveObjectIterator end() { return BitmapActiveObjectIterator(this, N); } @@ -323,6 +324,18 @@ class BitMapObjectPool : public internal::StaticAllocatorBitmap return ForEachActiveObjectInner(&proxy, &internal::LambdaProxy::ConstCall); } + void DumpToLog() const + { + ChipLogError(Support, "BitMapObjectPool: %lu allocated", static_cast(Allocated())); + if constexpr (IsDumpable::value) + { + ForEachActiveObject([](const T * object) { + object->DumpToLog(); + return Loop::Continue; + }); + } + } + private: static Loop ReleaseObject(void * context, void * object) { @@ -389,7 +402,7 @@ class HeapObjectPool : public internal::Statistics, public HeapObjectPoolExitHan if (!sIgnoringLeaksOnExit) { // Verify that no live objects remain, to prevent potential use-after-free. - VerifyOrDie(Allocated() == 0); + VerifyOrDieWithObject(Allocated() == 0, this); } #endif // __SANITIZE_ADDRESS__ } @@ -570,6 +583,18 @@ class HeapObjectPool : public internal::Statistics, public HeapObjectPoolExitHan return mObjects.ForEachNode(&proxy, &internal::LambdaProxy::ConstCall); } + void DumpToLog() const + { + ChipLogError(Support, "HeapObjectPool: %lu allocated", static_cast(Allocated())); + if constexpr (IsDumpable::value) + { + ForEachActiveObject([](const T * object) { + object->DumpToLog(); + return Loop::Continue; + }); + } + } + private: static Loop ReleaseObject(void * context, void * object) { diff --git a/src/lib/support/logging/TextOnlyLogging.h b/src/lib/support/logging/TextOnlyLogging.h index dd9e73d0f5aeed..903624183a7d6c 100644 --- a/src/lib/support/logging/TextOnlyLogging.h +++ b/src/lib/support/logging/TextOnlyLogging.h @@ -36,6 +36,7 @@ #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include #include +#include #if CHIP_SYSTEM_CONFIG_PLATFORM_LOG && defined(CHIP_SYSTEM_CONFIG_PLATFORM_LOG_INCLUDE) #include CHIP_SYSTEM_CONFIG_PLATFORM_LOG_INCLUDE @@ -292,6 +294,24 @@ using LogRedirectCallback_t = void (*)(const char * module, uint8_t category, co #define ChipLogValueExchangeIdFromReceivedHeader(payloadHeader) \ ChipLogValueExchangeId((payloadHeader).GetExchangeID(), !(payloadHeader).IsInitiator()) +/** + * Logging helpers for logging the dynamic type of an object, if possible. + * + * Primarily useful when logging the type of delegates or similar objects when + * performing logging for a fatal error in DumpToLog(). + * + * Example: + * @code + * ChipLogError(Foo, "Delegate=" ChipLogFormatRtti, ChipLogValueRtti(mDelegate)); + * @endcode + */ +#define ChipLogFormatRtti "%s" +#if CHIP_HAVE_RTTI +#define ChipLogValueRtti(ptr) ((ptr) != nullptr ? typeid(*(ptr)).name() : "null") +#else +#define ChipLogValueRtti(ptr) ((ptr) != nullptr ? "?" : "null") +#endif + /** * Logging helpers for protocol ids. A protocol id is a (vendor-id, * protocol-id) pair. diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 554e5fbce9482d..62c5206f7b272e 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -294,7 +294,7 @@ ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, cons mDispatch(GetMessageDispatch(isEphemeralExchange, delegate)), mSession(*this) { - VerifyOrDie(mExchangeMgr == nullptr); + VerifyOrDieWithObject(mExchangeMgr == nullptr, this); mExchangeMgr = em; mExchangeId = ExchangeId; @@ -334,12 +334,12 @@ ExchangeContext::ExchangeContext(ExchangeManager * em, uint16_t ExchangeId, cons ExchangeContext::~ExchangeContext() { - VerifyOrDie(mExchangeMgr != nullptr && GetReferenceCount() == 0); + VerifyOrDieWithObject(mExchangeMgr != nullptr && GetReferenceCount() == 0, this); // // Ensure that DoClose has been called by the time we get here. If not, we have a leak somewhere. // - VerifyOrDie(mFlags.Has(Flags::kFlagClosed)); + VerifyOrDieWithObject(mFlags.Has(Flags::kFlagClosed), this); #if CHIP_CONFIG_ENABLE_ICD_SERVER // TODO(#33075) : Add check for group context to not a req since it serves no purpose @@ -666,7 +666,7 @@ void ExchangeContext::AbortAllOtherCommunicationOnFabric() void ExchangeContext::ExchangeSessionHolder::GrabExpiredSession(const SessionHandle & session) { - VerifyOrDie(session->AsSecureSession()->IsPendingEviction()); + VerifyOrDieWithObject(session->AsSecureSession()->IsPendingEviction(), this); GrabUnchecked(session); } diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 47cf0ddbef2783..e10ef84ce911be 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -158,7 +158,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, SessionHandle GetSessionHandle() const { - VerifyOrDie(mSession); + VerifyOrDieWithObject(mSession, this); auto sessionHandle = mSession.Get(); return std::move(sessionHandle.Value()); } @@ -238,6 +238,12 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, void ClearInjectedFailures() { mInjectedFailures.ClearAll(); } #endif + void DumpToLog() const + { + ChipLogError(ExchangeManager, "ExchangeContext: " ChipLogFormatExchangeId " delegate=" ChipLogFormatRtti, + ChipLogValueExchangeId(GetExchangeId(), IsInitiator()), ChipLogValueRtti(mDelegate)); + } + private: #if CONFIG_BUILD_FOR_HOST_UNIT_TEST BitFlags mInjectedFailures; diff --git a/src/messaging/tests/TestExchange.cpp b/src/messaging/tests/TestExchange.cpp index f221c999ac4e22..20df66f9d143d9 100644 --- a/src/messaging/tests/TestExchange.cpp +++ b/src/messaging/tests/TestExchange.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -219,4 +220,15 @@ TEST_F(TestExchange, CheckBasicExchangeMessageDispatch) }); } } + +// A crude test to exercise VerifyOrDieWithObject() in ObjectPool and +// the resulting DumpToLog() call on the ExchangeContext. +// TODO: Find a way to automate this test without killing the process. +// TEST_F(TestExchange, DumpExchangePoolToLog) +// { +// MockExchangeDelegate delegate; +// ObjectPool pool; +// pool.CreateObject(&GetExchangeManager(), static_cast(1234), GetSessionAliceToBob(), true, &delegate); +// } + } // namespace From b74eadbbef7ff9c5c2cf7f52dda8943281fcb03a Mon Sep 17 00:00:00 2001 From: Anu Biradar <104591549+abiradarti@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:21:21 -0500 Subject: [PATCH 15/40] [TI] CC13x4_26x4 build fixes (#34682) * lwip pbuf, map file, and hex creation when OTA is disabled * added cc13x4 family define around the non OTA hex creation * whitespace fix * reversed custom factoy data flash with cc13x4 check * more whitespace fixes --- examples/all-clusters-app/cc13x4_26x4/README.md | 2 +- .../all-clusters-app/cc13x4_26x4/main/AppTask.cpp | 8 +++++++- examples/lighting-app/cc13x4_26x4/README.md | 2 +- examples/lighting-app/cc13x4_26x4/src/AppTask.cpp | 8 +++++++- examples/lock-app/cc13x4_26x4/README.md | 2 +- examples/lock-app/cc13x4_26x4/src/AppTask.cpp | 11 ++++++++++- examples/pump-app/cc13x4_26x4/README.md | 2 +- examples/pump-app/cc13x4_26x4/main/AppTask.cpp | 10 +++++++++- examples/pump-controller-app/cc13x4_26x4/README.md | 2 +- .../pump-controller-app/cc13x4_26x4/main/AppTask.cpp | 11 ++++++++++- examples/shell/cc13x4_26x4/README.md | 2 +- src/lwip/cc13xx_26xx/lwipopts.h | 2 +- .../ti_simplelink_sdk/ti_simplelink_executable.gni | 3 +++ 13 files changed, 53 insertions(+), 12 deletions(-) diff --git a/examples/all-clusters-app/cc13x4_26x4/README.md b/examples/all-clusters-app/cc13x4_26x4/README.md index be6a38277edafc..b90e3933c351e5 100644 --- a/examples/all-clusters-app/cc13x4_26x4/README.md +++ b/examples/all-clusters-app/cc13x4_26x4/README.md @@ -109,7 +109,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" ``` ## Programming diff --git a/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp b/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp index 98926214c4cb36..88099f009f2dac 100644 --- a/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp @@ -76,8 +76,10 @@ AppTask AppTask::sAppTask; constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs); void CancelTimer(void); +#endif uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; @@ -100,9 +102,9 @@ void InitializeOTARequestor(void) sDownloader.SetImageProcessorDelegate(&sImageProcessor); sRequestorUser.Init(&sRequestorCore, &sImageProcessor); } -#endif TimerHandle_t sOTAInitTimer = 0; +#endif // The OTA Init Timer is only started upon the first Thread State Change // detected if the device is already on a Thread Network, or during the AppTask @@ -176,10 +178,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) #endif } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void OTAInitTimerEventHandler(TimerHandle_t xTimer) { InitializeOTARequestor(); } +#endif int AppTask::StartAppTask() { @@ -224,6 +228,7 @@ int AppTask::Init() ; } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Create FreeRTOS sw timer for OTA timer. sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS) @@ -240,6 +245,7 @@ int AppTask::Init() { PLAT_LOG("sOTAInitTimer timer created successfully "); } +#endif ret = ThreadStackMgr().InitThreadStack(); if (ret != CHIP_NO_ERROR) diff --git a/examples/lighting-app/cc13x4_26x4/README.md b/examples/lighting-app/cc13x4_26x4/README.md index 73718a0bf76a86..5a6f6efb6a53ae 100644 --- a/examples/lighting-app/cc13x4_26x4/README.md +++ b/examples/lighting-app/cc13x4_26x4/README.md @@ -108,7 +108,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" ``` ## Programming diff --git a/examples/lighting-app/cc13x4_26x4/src/AppTask.cpp b/examples/lighting-app/cc13x4_26x4/src/AppTask.cpp index aa9bdbccefa3c3..6c4ffacdda2565 100644 --- a/examples/lighting-app/cc13x4_26x4/src/AppTask.cpp +++ b/examples/lighting-app/cc13x4_26x4/src/AppTask.cpp @@ -126,9 +126,9 @@ void InitializeOTARequestor(void) sDownloader.SetImageProcessorDelegate(&sImageProcessor); sRequestorUser.Init(&sRequestorCore, &sImageProcessor); } -#endif TimerHandle_t sOTAInitTimer = 0; +#endif // The OTA Init Timer is only started upon the first Thread State Change // detected if the device is already on a Thread Network, or during the AppTask @@ -215,10 +215,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void OTAInitTimerEventHandler(TimerHandle_t xTimer) { InitializeOTARequestor(); } +#endif int AppTask::Init() { @@ -239,6 +241,7 @@ int AppTask::Init() ; } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Create FreeRTOS sw timer for OTA timer. sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS) @@ -255,6 +258,7 @@ int AppTask::Init() { PLAT_LOG("sOTAInitTimer timer created successfully "); } +#endif ret = ThreadStackMgr().InitThreadStack(); if (ret != CHIP_NO_ERROR) @@ -371,6 +375,7 @@ void AppTask::AppTaskMain(void * pvParameter) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs) { PLAT_LOG("Start OTA Init Timer") @@ -396,6 +401,7 @@ void CancelTimer(void) PLAT_LOG("sOTAInitTimer stop() failed"); } } +#endif void AppTask::ActionInitiated(LightingManager::Action_t aAction, int32_t aActor) { diff --git a/examples/lock-app/cc13x4_26x4/README.md b/examples/lock-app/cc13x4_26x4/README.md index 7ff622a8e14f90..c7d15dcc8533fe 100644 --- a/examples/lock-app/cc13x4_26x4/README.md +++ b/examples/lock-app/cc13x4_26x4/README.md @@ -109,7 +109,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" ``` ## Programming diff --git a/examples/lock-app/cc13x4_26x4/src/AppTask.cpp b/examples/lock-app/cc13x4_26x4/src/AppTask.cpp index b26bd6ae43f8c1..f210aaf1a6e1de 100644 --- a/examples/lock-app/cc13x4_26x4/src/AppTask.cpp +++ b/examples/lock-app/cc13x4_26x4/src/AppTask.cpp @@ -94,8 +94,10 @@ void uiLocked(void); void uiUnlocking(void); void uiUnlocked(void); +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs); void CancelTimer(void); +#endif uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; @@ -118,10 +120,11 @@ void InitializeOTARequestor(void) sDownloader.SetImageProcessorDelegate(&sImageProcessor); sRequestorUser.Init(&sRequestorCore, &sImageProcessor); } -#endif TimerHandle_t sOTAInitTimer = 0; +#endif + // The OTA Init Timer is only started upon the first Thread State Change // detected if the device is already on a Thread Network, or during the AppTask // Init sequence if the device is not yet on a Thread Network. Once the timer @@ -207,10 +210,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void OTAInitTimerEventHandler(TimerHandle_t xTimer) { InitializeOTARequestor(); } +#endif int AppTask::Init() { @@ -230,6 +235,7 @@ int AppTask::Init() ; } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Create FreeRTOS sw timer for OTA timer. sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS) @@ -246,6 +252,7 @@ int AppTask::Init() { PLAT_LOG("sOTAInitTimer timer created successfully "); } +#endif ret = ThreadStackMgr().InitThreadStack(); if (ret != CHIP_NO_ERROR) @@ -418,6 +425,7 @@ void AppTask::AppTaskMain(void * pvParameter) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs) { PLAT_LOG("Start OTA Init Timer") @@ -443,6 +451,7 @@ void CancelTimer(void) PLAT_LOG("sOTAInitTimer stop() failed"); } } +#endif void AppTask::ActionInitiated(LockManager::Action_t aAction) { diff --git a/examples/pump-app/cc13x4_26x4/README.md b/examples/pump-app/cc13x4_26x4/README.md index 1e7e0c33b2136a..5cd2e3c367be79 100644 --- a/examples/pump-app/cc13x4_26x4/README.md +++ b/examples/pump-app/cc13x4_26x4/README.md @@ -108,7 +108,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" ``` ## Programming diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp index 9ec109313d3ad1..9c409b09256d8b 100644 --- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp @@ -96,8 +96,10 @@ AppTask AppTask::sAppTask; static DeviceCallbacks sDeviceCallbacks; +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs); void CancelTimer(void); +#endif uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; @@ -120,9 +122,9 @@ void InitializeOTARequestor(void) sDownloader.SetImageProcessorDelegate(&sImageProcessor); sRequestorUser.Init(&sRequestorCore, &sImageProcessor); } -#endif TimerHandle_t sOTAInitTimer = 0; +#endif // The OTA Init Timer is only started upon the first Thread State Change // detected if the device is already on a Thread Network, or during the AppTask @@ -171,10 +173,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void OTAInitTimerEventHandler(TimerHandle_t xTimer) { InitializeOTARequestor(); } +#endif int AppTask::StartAppTask() { @@ -217,6 +221,7 @@ int AppTask::Init() ; } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Create FreeRTOS sw timer for OTA timer. sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS) @@ -233,6 +238,7 @@ int AppTask::Init() { PLAT_LOG("sOTAInitTimer timer created successfully "); } +#endif ret = ThreadStackMgr().InitThreadStack(); if (ret != CHIP_NO_ERROR) @@ -353,6 +359,7 @@ void AppTask::PostEvent(const AppEvent * aEvent) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs) { PLAT_LOG("Start OTA Init Timer") @@ -378,6 +385,7 @@ void CancelTimer(void) PLAT_LOG("sOTAInitTimer stop() failed"); } } +#endif void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor) { diff --git a/examples/pump-controller-app/cc13x4_26x4/README.md b/examples/pump-controller-app/cc13x4_26x4/README.md index bd357fb25f2961..9b5eb0e693426d 100644 --- a/examples/pump-controller-app/cc13x4_26x4/README.md +++ b/examples/pump-controller-app/cc13x4_26x4/README.md @@ -110,7 +110,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" ``` ## Programming diff --git a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp index a8d1e1d88f5cd3..d437da1c06d304 100644 --- a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp @@ -83,8 +83,10 @@ static Button_Handle sAppRightHandle; AppTask AppTask::sAppTask; +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs); void CancelTimer(void); +#endif uint8_t sTestEventTriggerEnableKey[TestEventTriggerDelegate::kEnableKeyLength] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; @@ -107,10 +109,11 @@ void InitializeOTARequestor(void) sDownloader.SetImageProcessorDelegate(&sImageProcessor); sRequestorUser.Init(&sRequestorCore, &sImageProcessor); } -#endif TimerHandle_t sOTAInitTimer = 0; +#endif + // The OTA Init Timer is only started upon the first Thread State Change // detected if the device is already on a Thread Network, or during the AppTask // Init sequence if the device is not yet on a Thread Network. Once the timer @@ -199,10 +202,12 @@ void DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void OTAInitTimerEventHandler(TimerHandle_t xTimer) { InitializeOTARequestor(); } +#endif int AppTask::Init() { @@ -222,6 +227,7 @@ int AppTask::Init() ; } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR // Create FreeRTOS sw timer for OTA timer. sOTAInitTimer = xTimerCreate("OTAInitTmr", // Just a text name, not used by the RTOS kernel OTAREQUESTOR_INIT_TIMER_DELAY_MS, // timer period (mS) @@ -238,6 +244,7 @@ int AppTask::Init() { PLAT_LOG("sOTAInitTimer timer created successfully "); } +#endif ret = ThreadStackMgr().InitThreadStack(); if (ret != CHIP_NO_ERROR) @@ -352,6 +359,7 @@ void AppTask::PostEvent(const AppEvent * aEvent) } } +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR void StartTimer(uint32_t aTimeoutMs) { PLAT_LOG("Start OTA Init Timer") @@ -377,6 +385,7 @@ void CancelTimer(void) PLAT_LOG("sOTAInitTimer stop() failed"); } } +#endif void AppTask::ActionInitiated(PumpManager::Action_t aAction, int32_t aActor) { diff --git a/examples/shell/cc13x4_26x4/README.md b/examples/shell/cc13x4_26x4/README.md index 3f1923f3db33af..2d5e53d5ec1b18 100644 --- a/examples/shell/cc13x4_26x4/README.md +++ b/examples/shell/cc13x4_26x4/README.md @@ -63,7 +63,7 @@ Ninja to build the executable. to the GN call. ``` - gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"]" + gn gen out/debug --args="ti_sysconfig_root=\"$HOME/ti/sysconfig_1.18.1\" target_defines=[\"CC13X4_26X4_ATTESTATION_CREDENTIALS=1\"] chip_generate_link_map_file=true" ``` ## Programming diff --git a/src/lwip/cc13xx_26xx/lwipopts.h b/src/lwip/cc13xx_26xx/lwipopts.h index d89c33afb5ed84..26a1bb6641cb00 100644 --- a/src/lwip/cc13xx_26xx/lwipopts.h +++ b/src/lwip/cc13xx_26xx/lwipopts.h @@ -89,7 +89,7 @@ #define MEMP_SEPARATE_POOLS (1) #define LWIP_PBUF_FROM_CUSTOM_POOLS (0) #define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (12) +#define PBUF_POOL_SIZE (18) #define PBUF_POOL_BUFSIZE (1280) #define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) #define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) diff --git a/third_party/ti_simplelink_sdk/ti_simplelink_executable.gni b/third_party/ti_simplelink_sdk/ti_simplelink_executable.gni index 3df24854297f49..76a59df16bc370 100644 --- a/third_party/ti_simplelink_sdk/ti_simplelink_executable.gni +++ b/third_party/ti_simplelink_sdk/ti_simplelink_executable.gni @@ -484,6 +484,9 @@ template("ti_simplelink_executable") { } else { # The executable is the final target. data_deps = [ ":${simplelink_target_name}.out" ] + if (ti_simplelink_device_family == "cc13x4_26x4" && custom_factory_data) { + data_deps += [ ":${simplelink_target_name}-and-factory-data.hex" ] + } } if (defined(invoker.data_deps)) { From d938a28d3b81d14c17ef40260302697c94a60dd8 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Wed, 31 Jul 2024 20:22:33 -0400 Subject: [PATCH 16/40] [ICD] Add missing polling function to NoWifi connectivity manager (#34684) * Add missing polling function to NoWifi connectivity manager * Update GenericConnectivityManagerImpl_NoWiFi.h Co-authored-by: Boris Zbarsky --------- Co-authored-by: Boris Zbarsky --- .../GenericConnectivityManagerImpl_NoWiFi.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h index e7d29ee4965a85..552603b492f115 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_NoWiFi.h @@ -78,6 +78,10 @@ class GenericConnectivityManagerImpl_NoWiFi static const char * _WiFiAPModeToStr(ConnectivityManager::WiFiAPMode mode); static const char * _WiFiStationStateToStr(ConnectivityManager::WiFiStationState state); static const char * _WiFiAPStateToStr(ConnectivityManager::WiFiAPState state); + // TODO ICD rework: ambiguous declaration of _SetPollingInterval when thread and no-wifi are both built together +#if CHIP_CONFIG_ENABLE_ICD_SERVER && !CHIP_DEVICE_CONFIG_ENABLE_THREAD + CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); +#endif private: ImplClass * Impl() { return static_cast(this); } @@ -221,6 +225,15 @@ inline const char * GenericConnectivityManagerImpl_NoWiFi::_WiFiAPSta return nullptr; } +#if CHIP_CONFIG_ENABLE_ICD_SERVER && !CHIP_DEVICE_CONFIG_ENABLE_THREAD +template +inline CHIP_ERROR +GenericConnectivityManagerImpl_NoWiFi::_SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) +{ + return CHIP_ERROR_NOT_IMPLEMENTED; +} +#endif + } // namespace Internal } // namespace DeviceLayer } // namespace chip From 43661ab85e1fa64427c05ebc94088f6ef2f10372 Mon Sep 17 00:00:00 2001 From: Rob Bultman Date: Wed, 31 Jul 2024 21:03:32 -0400 Subject: [PATCH 17/40] [OPSTATE] Add Q test script for CountdownTime (#34632) * Add Q test * Added test to test set * Remove unused var * Restyled by autopep8 * Restyled by isort * Fix name * Use pics over other method * Removed unused stuff * Added pipe commands * Fix reset * Get example to report appropriate changes. * WiP * Added some comments * Changes to make things work * Removed dev msgs * Missed some * Removed dev msgs * Straggler * Restyled by clang-format * Restyled by autopep8 * Restyled by isort * Commented unused var * Update examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp * Fix bug --------- Co-authored-by: Restyled.io --- .github/workflows/tests.yaml | 1 + .../include/operational-state-delegate-impl.h | 1 + .../src/operational-state-delegate-impl.cpp | 15 +++ .../linux/AllClustersCommandDelegate.cpp | 50 +++++++- .../linux/AllClustersCommandDelegate.h | 10 ++ src/python_testing/TC_OPSTATE_2_6.py | 62 ++++++++++ src/python_testing/TC_OpstateCommon.py | 112 +++++++++++++++++- 7 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 src/python_testing/TC_OPSTATE_2_6.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8284b5a9abd284..5e38c6c341bea6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -578,6 +578,7 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_3.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_4.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_5.py' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_6.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OVENOPSTATE_2_1.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OVENOPSTATE_2_2.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OVENOPSTATE_2_3.py' diff --git a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h index 60b6b09e9b6511..badadd68cd30a9 100644 --- a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h +++ b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h @@ -138,6 +138,7 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl }; Instance * GetOperationalStateInstance(); +OperationalStateDelegate * GetOperationalStateDelegate(); void Shutdown(); diff --git a/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp b/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp index d258b8261a1aed..d4a91cf259a2a7 100644 --- a/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp @@ -59,6 +59,7 @@ void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperat auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); if (error == CHIP_NO_ERROR) { + GetInstance()->UpdateCountdownTimeFromDelegate(); err.Set(to_underlying(ErrorStateEnum::kNoError)); } else @@ -73,6 +74,7 @@ void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOpera auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { + GetInstance()->UpdateCountdownTimeFromDelegate(); err.Set(to_underlying(ErrorStateEnum::kNoError)); } else @@ -96,6 +98,7 @@ void GenericOperationalStateDelegateImpl::HandleStartStateCallback(GenericOperat auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { + GetInstance()->UpdateCountdownTimeFromDelegate(); (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, this); err.Set(to_underlying(ErrorStateEnum::kNoError)); } @@ -113,6 +116,8 @@ void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperati { (void) DeviceLayer::SystemLayer().CancelTimer(onOperationalStateTimerTick, this); + GetInstance()->UpdateCountdownTimeFromDelegate(); + OperationalState::GenericOperationalError current_err(to_underlying(OperationalState::ErrorStateEnum::kNoError)); GetInstance()->GetCurrentOperationalError(current_err); @@ -152,6 +157,11 @@ static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data delegate->mPausedTime++; } } + else if (!countdown_time.IsNull() && countdown_time.Value() <= 0) + { + OperationalState::GenericOperationalError noError(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + delegate->HandleStopStateCallback(noError); + } if (state == OperationalState::OperationalStateEnum::kRunning || state == OperationalState::OperationalStateEnum::kPaused) { @@ -173,6 +183,11 @@ OperationalState::Instance * OperationalState::GetOperationalStateInstance() return gOperationalStateInstance; } +OperationalStateDelegate * OperationalState::GetOperationalStateDelegate() +{ + return gOperationalStateDelegate; +} + void OperationalState::Shutdown() { if (gOperationalStateInstance != nullptr) diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp index d620731e93dc5c..6c1467fc62a145 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp @@ -667,21 +667,65 @@ void AllClustersAppCommandHandler::OnModeChangeHandler(std::string device, std:: void AllClustersAppCommandHandler::OnOperationalStateChange(std::string device, std::string operation, Json::Value param) { - OperationalState::Instance * operationalStateInstance = nullptr; if (device == "Generic") { - operationalStateInstance = OperationalState::GetOperationalStateInstance(); + OnGenericOperationalStateChange(device, operation, param); } else if (device == "Oven") { - operationalStateInstance = OvenCavityOperationalState::GetOperationalStateInstance(); + OnOvenOperationalStateChange(device, operation, param); } else { ChipLogDetail(NotSpecified, "Invalid device type : %s", device.c_str()); return; } +} + +void AllClustersAppCommandHandler::OnGenericOperationalStateChange(std::string device, std::string operation, Json::Value param) +{ + OperationalState::Instance * operationalStateInstance = OperationalState::GetOperationalStateInstance(); + OperationalState::OperationalStateDelegate * operationalStateDelegate = OperationalState::GetOperationalStateDelegate(); + OperationalState::GenericOperationalError noError(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + OperationalState::OperationalStateEnum state = + static_cast(operationalStateInstance->GetCurrentOperationalState()); + if (operation == "Start") + { + operationalStateDelegate->HandleStartStateCallback(noError); + } + else if (operation == "Resume") + { + operationalStateDelegate->HandleResumeStateCallback(noError); + } + else if (operation == "Pause") + { + operationalStateDelegate->HandlePauseStateCallback(noError); + } + else if (operation == "Stop" && state == OperationalState::OperationalStateEnum::kRunning) + { + operationalStateDelegate->HandleStopStateCallback(noError); + } + else if (operation == "OnFault") + { + uint8_t event_id = to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation); + if (!param.isNull()) + { + event_id = to_underlying(static_cast(param.asUInt())); + } + OperationalState::GenericOperationalError err(event_id); + operationalStateInstance->OnOperationalErrorDetected(err); + } + else + { + ChipLogDetail(NotSpecified, "Invalid operation : %s", operation.c_str()); + return; + } +} + +void AllClustersAppCommandHandler::OnOvenOperationalStateChange(std::string device, std::string operation, Json::Value param) +{ + OperationalState::Instance * operationalStateInstance = OvenCavityOperationalState::GetOperationalStateInstance(); if (operation == "Start" || operation == "Resume") { operationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h index f097c539b54fb6..f1b873fc0d69c4 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h @@ -105,6 +105,16 @@ class AllClustersAppCommandHandler * Should be called when it is necessary to change the operational state as a manual operation. */ void OnOperationalStateChange(std::string device, std::string operation, Json::Value param); + + /** + * Should be called when it is necessary to change the operational state as a manual operation. + */ + void OnGenericOperationalStateChange(std::string device, std::string operation, Json::Value param); + + /** + * Should be called when it is necessary to change the operational state as a manual operation. + */ + void OnOvenOperationalStateChange(std::string device, std::string operation, Json::Value param); }; class AllClustersCommandDelegate : public NamedPipeCommandDelegate diff --git a/src/python_testing/TC_OPSTATE_2_6.py b/src/python_testing/TC_OPSTATE_2_6.py new file mode 100644 index 00000000000000..8560452b327712 --- /dev/null +++ b/src/python_testing/TC_OPSTATE_2_6.py @@ -0,0 +1,62 @@ +# +# 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. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from TC_OpstateCommon import TC_OPSTATE_BASE, TestInfo + + +class TC_OPSTATE_2_6(MatterBaseTest, TC_OPSTATE_BASE): + def __init__(self, *args): + super().__init__(*args) + + test_info = TestInfo( + pics_code="OPSTATE", + cluster=Clusters.OperationalState + ) + + super().setup_base(test_info=test_info) + + def steps_TC_OPSTATE_2_6(self) -> list[TestStep]: + return self.steps_TC_OPSTATE_BASE_2_6() + + def pics_TC_OPSTATE_2_6(self) -> list[str]: + return ["OPSTATE.S", "OPSTATE.S.A0002"] + + @async_test_body + async def test_TC_OPSTATE_2_6(self): + # endpoint = self.matter_test_config.endpoint + + # await self.TEST_TC_OPSTATE_BASE_2_6(endpoint=endpoint) + await self.TEST_TC_OPSTATE_BASE_2_6(endpoint=1) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index 09dc73e3344c1f..ece50ac90c65b6 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -28,7 +28,7 @@ from chip.clusters.Attribute import EventReadResult, SubscriptionTransaction from chip.clusters.Types import NullValue from chip.interaction_model import InteractionModelError, Status -from matter_testing_support import EventChangeCallback, TestStep +from matter_testing_support import ClusterAttributeChangeAccumulator, EventChangeCallback, TestStep from mobly import asserts @@ -1082,6 +1082,7 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1): # STEP 7: TH waits for initial-countdown-time self.step(7) + logging.info(f'Sleeping for {initial_countdown_time:.1f} seconds.') time.sleep(initial_countdown_time) # STEP 8: TH sends Stop command to the DUT @@ -1221,3 +1222,112 @@ async def TEST_TC_OPSTATE_BASE_2_5(self, endpoint=1): self.skip_step(20) self.skip_step(21) self.skip_step(22) + + ############################ + # TEST CASE 2.6 - Optional Reports with DUT as Server + ############################ + def steps_TC_OPSTATE_BASE_2_6(self) -> list[TestStep]: + steps = [TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep(2, "Subscribe to CountdownTime attribute"), + TestStep(3, "Manually put the DUT into a state where it will use the CountdownTime attribute, " + "the initial value of the CountdownTime is greater than 30, " + "and it will begin counting down the CountdownTime attribute."), + TestStep(4, "Over a period of 30 seconds, TH counts all report transactions with an attribute " + "report for the CountdownTime attribute in numberOfReportsReceived"), + TestStep(5, "Until the current operation finishes, TH counts all report transactions with " + "an attribute report for the CountdownTime attribute in numberOfReportsReceived and saves up to 5 such reports."), + TestStep(6, "Manually put the DUT into a state where it will use the CountdownTime attribute, " + "the initial value of the CountdownTime is greater than 30, and it will begin counting down the CountdownTime attribute."), + TestStep(7, "TH reads from the DUT the OperationalState attribute"), + TestStep(8, "Manually put the device in the Paused(0x02) operational state") + ] + return steps + + async def TEST_TC_OPSTATE_BASE_2_6(self, endpoint=1): + cluster = self.test_info.cluster + attributes = cluster.Attributes + + self.init_test() + + # commission + self.step(1) + + # Note that this does a subscribe-all instead of subscribing only to the CountdownTime attribute. + # To-Do: Update the TP to subscribe-all. + self.step(2) + sub_handler = ClusterAttributeChangeAccumulator(cluster) + await sub_handler.start(self.default_controller, self.dut_node_id, endpoint) + + self.step(3) + if self.pics_guard(self.check_pics(f"{self.test_info.pics_code}.S.M.ST_RUNNING")): + self.send_manual_or_pipe_command(name="OperationalStateChange", + device=self.device, + operation="Start") + time.sleep(1) + await self.read_and_expect_value(endpoint=endpoint, + attribute=attributes.OperationalState, + expected_value=cluster.Enums.OperationalStateEnum.kRunning) + count = sub_handler.attribute_report_counts[attributes.CountdownTime] + asserts.assert_greater(count, 0, "Did not receive any reports for CountdownTime") + else: + self.skip_step(3) + + sub_handler.reset() + self.step(4) + logging.info('Test will now collect data for 30 seconds') + time.sleep(30) + + count = sub_handler.attribute_report_counts[attributes.CountdownTime] + sub_handler.reset() + asserts.assert_less_equal(count, 5, "Received more than 5 reports for CountdownTime") + asserts.assert_greater_equal(count, 0, "Did not receive any reports for CountdownTime") + + attr_value = await self.read_expect_success( + endpoint=endpoint, + attribute=attributes.OperationalState) + if attr_value == cluster.Enums.OperationalStateEnum.kRunning: + self.step(5) + wait_count = 0 + while (attr_value != cluster.Enums.OperationalStateEnum.kStopped) and (wait_count < 20): + time.sleep(1) + wait_count = wait_count + 1 + attr_value = await self.read_expect_success( + endpoint=endpoint, + attribute=attributes.OperationalState) + count = sub_handler.attribute_report_counts[attributes.CountdownTime] + asserts.assert_less_equal(count, 5, "Received more than 5 reports for CountdownTime") + asserts.assert_greater(count, 0, "Did not receive any reports for CountdownTime") + else: + self.skip_step(5) + + sub_handler.reset() + self.step(6) + if self.pics_guard(self.check_pics(f"{self.test_info.pics_code}.S.M.ST_RUNNING")): + self.send_manual_or_pipe_command(name="OperationalStateChange", + device=self.device, + operation="Start") + time.sleep(1) + await self.read_and_expect_value(endpoint=endpoint, + attribute=attributes.OperationalState, + expected_value=cluster.Enums.OperationalStateEnum.kRunning) + count = sub_handler.attribute_report_counts[attributes.CountdownTime] + asserts.assert_greater(count, 0, "Did not receive any reports for CountdownTime") + else: + self.skip_step(6) + + self.step(7) + await self.read_and_expect_value(endpoint=endpoint, + attribute=attributes.OperationalState, + expected_value=cluster.Enums.OperationalStateEnum.kRunning) + + sub_handler.reset() + self.step(8) + if self.pics_guard(self.check_pics(f"{self.test_info.pics_code}.S.M.ST_PAUSED")): + self.send_manual_or_pipe_command(name="OperationalStateChange", + device=self.device, + operation="Pause") + time.sleep(1) + count = sub_handler.attribute_report_counts[attributes.CountdownTime] + asserts.assert_greater(count, 0, "Did not receive any reports for CountdownTime") + else: + self.skip_step(8) From d7872bc66b5c9d1a7896edfda9e5f3697d5cd487 Mon Sep 17 00:00:00 2001 From: Douglas Rocha Ferraz Date: Wed, 31 Jul 2024 21:09:23 -0400 Subject: [PATCH 18/40] YAML update to BRBINFO, ProductId (#34513) * Bridged Device Information Cluster, Attribute ProductID test reflects marking as O, not X * Update src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml Co-authored-by: Terence Hampson * corrected pics * corrected pics * WIP Bridged ICD, commissioning to both fabrics * wip testing sending KeepActive * update to bridged-device-basic-information.xml and zap generated files * removed unrelated file --------- Co-authored-by: Terence Hampson Co-authored-by: Andrei Litvin --- .../placeholder/linux/apps/app1/config.matter | 1 + .../placeholder/linux/apps/app2/config.matter | 1 + .../certification/Test_TC_BRBINFO_2_1.yaml | 22 ++--- .../chip/bridged-device-basic-information.xml | 1 + .../data_model/controller-clusters.matter | 1 + .../chip/devicecontroller/ChipClusters.java | 27 ++++++ .../devicecontroller/ClusterIDMapping.java | 1 + .../devicecontroller/ClusterReadMapping.java | 11 +++ .../BridgedDeviceBasicInformationCluster.kt | 91 +++++++++++++++++++ .../CHIPAttributeTLVValueDecoder.cpp | 16 ++++ .../python/chip/clusters/CHIPClusters.py | 6 ++ .../python/chip/clusters/Objects.py | 18 ++++ .../MTRAttributeSpecifiedCheck.mm | 3 + .../MTRAttributeTLVValueDecoder.mm | 11 +++ .../CHIP/zap-generated/MTRBaseClusters.h | 6 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 36 ++++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 1 + .../CHIP/zap-generated/MTRClusterNames.mm | 4 + .../CHIP/zap-generated/MTRClusters.h | 2 + .../CHIP/zap-generated/MTRClusters.mm | 5 + .../zap-generated/attributes/Accessors.cpp | 47 ++++++++++ .../zap-generated/attributes/Accessors.h | 6 ++ .../zap-generated/cluster-objects.cpp | 2 + .../zap-generated/cluster-objects.h | 13 +++ .../app-common/zap-generated/ids/Attributes.h | 4 + .../zap-generated/cluster/Commands.h | 5 + .../cluster/logging/DataModelLogger.cpp | 5 + .../zap-generated/cluster/Commands.h | 91 +++++++++++++++++++ 28 files changed, 423 insertions(+), 14 deletions(-) diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 665714e076ed91..d956aee9081628 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -2465,6 +2465,7 @@ cluster BridgedDeviceBasicInformation = 57 { readonly attribute optional char_string<32> vendorName = 1; readonly attribute optional vendor_id vendorID = 2; readonly attribute optional char_string<32> productName = 3; + readonly attribute optional int16u productID = 4; attribute optional char_string<32> nodeLabel = 5; readonly attribute optional int16u hardwareVersion = 7; readonly attribute optional char_string<64> hardwareVersionString = 8; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index d1fd025cef5bff..e892c7ebcf9e1e 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2422,6 +2422,7 @@ cluster BridgedDeviceBasicInformation = 57 { readonly attribute optional char_string<32> vendorName = 1; readonly attribute optional vendor_id vendorID = 2; readonly attribute optional char_string<32> productName = 3; + readonly attribute optional int16u productID = 4; attribute optional char_string<32> nodeLabel = 5; readonly attribute optional int16u hardwareVersion = 7; readonly attribute optional char_string<64> hardwareVersionString = 8; diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml index a0b87e6c3897b9..b869f2d99ee8f0 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_2_1.yaml @@ -140,21 +140,15 @@ tests: response: value: ProductNameValue - - label: - "Step 14: TH reads attribute ID 4 from the DUT (matches in ID to - ProductID in the parent cluster, but is absent on the - BridgedDeviceBasicInformation cluster)." - PICS: BRBINFO.S - cluster: "AnyCommands" - command: "ReadById" - arguments: - values: - - name: "ClusterId" - value: BRBINFO.ClusterId - - name: "AttributeId" - value: 0x0004 + - label: "Step 14: TH reads ProductID from the DUT" + PICS: BRBINFO.S.A0004 + command: "readAttribute" + attribute: "ProductID" response: - error: UNSUPPORTED_ATTRIBUTE + constraints: + type: int16u + minValue: 1 + maxValue: 65534 - label: "Step 17: TH reads NodeLabel from the DUT" PICS: BRBINFO.S.A0005 diff --git a/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml b/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml index 74f88bea39e623..b33ccb740f9a54 100644 --- a/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml +++ b/src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml @@ -80,6 +80,7 @@ limitations under the License. VendorName VendorID ProductName + ProductID NodeLabel HardwareVersion HardwareVersionString diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index eb9999da242c69..24a9e2fb45c2b0 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2348,6 +2348,7 @@ cluster BridgedDeviceBasicInformation = 57 { readonly attribute optional char_string<32> vendorName = 1; readonly attribute optional vendor_id vendorID = 2; readonly attribute optional char_string<32> productName = 3; + readonly attribute optional int16u productID = 4; attribute optional char_string<32> nodeLabel = 5; readonly attribute optional int16u hardwareVersion = 7; readonly attribute optional char_string<64> hardwareVersionString = 8; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 950e7f818d0db3..f7fc1ea6955305 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -15166,6 +15166,7 @@ public static class BridgedDeviceBasicInformationCluster extends BaseChipCluster private static final long VENDOR_NAME_ATTRIBUTE_ID = 1L; private static final long VENDOR_I_D_ATTRIBUTE_ID = 2L; private static final long PRODUCT_NAME_ATTRIBUTE_ID = 3L; + private static final long PRODUCT_I_D_ATTRIBUTE_ID = 4L; private static final long NODE_LABEL_ATTRIBUTE_ID = 5L; private static final long HARDWARE_VERSION_ATTRIBUTE_ID = 7L; private static final long HARDWARE_VERSION_STRING_ATTRIBUTE_ID = 8L; @@ -15314,6 +15315,32 @@ public void onSuccess(byte[] tlv) { }, PRODUCT_NAME_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readProductIDAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRODUCT_I_D_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PRODUCT_I_D_ATTRIBUTE_ID, true); + } + + public void subscribeProductIDAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRODUCT_I_D_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, PRODUCT_I_D_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readNodeLabelAttribute( CharStringAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NODE_LABEL_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 6c8fccf1cdeda1..37936a56fba6a6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -4460,6 +4460,7 @@ public enum Attribute { VendorName(1L), VendorID(2L), ProductName(3L), + ProductID(4L), NodeLabel(5L), HardwareVersion(7L), HardwareVersionString(8L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index c6a6f189ba36eb..417ecce949fdc9 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -4659,6 +4659,17 @@ private static Map readBridgedDeviceBasicInformationInt readBridgedDeviceBasicInformationProductNameCommandParams ); result.put("readProductNameAttribute", readBridgedDeviceBasicInformationProductNameAttributeInteractionInfo); + Map readBridgedDeviceBasicInformationProductIDCommandParams = new LinkedHashMap(); + InteractionInfo readBridgedDeviceBasicInformationProductIDAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.BridgedDeviceBasicInformationCluster) cluster).readProductIDAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readBridgedDeviceBasicInformationProductIDCommandParams + ); + result.put("readProductIDAttribute", readBridgedDeviceBasicInformationProductIDAttributeInteractionInfo); Map readBridgedDeviceBasicInformationNodeLabelCommandParams = new LinkedHashMap(); InteractionInfo readBridgedDeviceBasicInformationNodeLabelAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt index 64742323eec50c..8e56362d8da349 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BridgedDeviceBasicInformationCluster.kt @@ -395,6 +395,97 @@ class BridgedDeviceBasicInformationCluster( } } + suspend fun readProductIDAttribute(): UShort? { + val ATTRIBUTE_ID: UInt = 4u + + 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) { "Productid attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + return decodedValue + } + + suspend fun subscribeProductIDAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 4u + 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( + UShortSubscriptionState.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) { "Productid attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getUShort(AnonymousTag) + } else { + null + } + + decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + suspend fun readNodeLabelAttribute(): String? { val ATTRIBUTE_ID: UInt = 5u diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 49af03e873c702..33c041e5bbe85f 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -10140,6 +10140,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } case Attributes::NodeLabel::Id: { using TypeInfo = Attributes::NodeLabel::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 275e2e6b63f099..588c3da4f020eb 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -3324,6 +3324,12 @@ class ChipClusters: "type": "str", "reportable": True, }, + 0x00000004: { + "attributeName": "ProductID", + "attributeId": 0x00000004, + "type": "int", + "reportable": True, + }, 0x00000005: { "attributeName": "NodeLabel", "attributeId": 0x00000005, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 9ef896538fb595..b84ad31879c1d5 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -11660,6 +11660,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="vendorName", Tag=0x00000001, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="vendorID", Tag=0x00000002, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="productName", Tag=0x00000003, Type=typing.Optional[str]), + ClusterObjectFieldDescriptor(Label="productID", Tag=0x00000004, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="nodeLabel", Tag=0x00000005, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="hardwareVersion", Tag=0x00000007, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="hardwareVersionString", Tag=0x00000008, Type=typing.Optional[str]), @@ -11684,6 +11685,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: vendorName: 'typing.Optional[str]' = None vendorID: 'typing.Optional[uint]' = None productName: 'typing.Optional[str]' = None + productID: 'typing.Optional[uint]' = None nodeLabel: 'typing.Optional[str]' = None hardwareVersion: 'typing.Optional[uint]' = None hardwareVersionString: 'typing.Optional[str]' = None @@ -11830,6 +11832,22 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[str]' = None + @dataclass + class ProductID(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000039 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000004 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + @dataclass class NodeLabel(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 241c006a7074fd..d214e061ec9f65 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -1530,6 +1530,9 @@ static BOOL AttributeIsSpecifiedInBridgedDeviceBasicInformationCluster(Attribute case Attributes::ProductName::Id: { return YES; } + case Attributes::ProductID::Id: { + return YES; + } case Attributes::NodeLabel::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index a13bd2f3f40433..7920a04dc597b1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -4450,6 +4450,17 @@ static id _Nullable DecodeAttributeValueForBridgedDeviceBasicInformationCluster( } return value; } + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } case Attributes::NodeLabel::Id: { using TypeInfo = Attributes::NodeLabel::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 615dbceadcdf57..bdd3bcf1f78a2f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -3744,6 +3744,12 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) reportHandler:(void (^)(NSString * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributeProductNameWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)readAttributeProductIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeProductIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeProductIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeNodeLabelWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index ddbcc431e5dd86..e2bb0e376dffe1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -31056,6 +31056,42 @@ + (void)readAttributeProductNameWithClusterStateCache:(MTRClusterStateCacheConta completion:completion]; } +- (void)readAttributeProductIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = BridgedDeviceBasicInformation::Attributes::ProductID::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeProductIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = BridgedDeviceBasicInformation::Attributes::ProductID::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeProductIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = BridgedDeviceBasicInformation::Attributes::ProductID::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeNodeLabelWithCompletion:(void (^)(NSString * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = BridgedDeviceBasicInformation::Attributes::NodeLabel::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index caec13ea1b284f..98ca2f96263d50 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -1945,6 +1945,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeVendorNameID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000001, MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeVendorIDID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000002, MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeProductNameID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, + MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeProductIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeNodeLabelID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000005, MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeHardwareVersionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000007, MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeHardwareVersionStringID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000008, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index a46ab76ca9cc17..5f9d1b8e510ed6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -2391,6 +2391,10 @@ result = @"ProductName"; break; + case MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeProductIDID: + result = @"ProductID"; + break; + case MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeNodeLabelID: result = @"NodeLabel"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index eb27ead337eda9..8da2b1f2ec4f2b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -1722,6 +1722,8 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (NSDictionary * _Nullable)readAttributeProductNameWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (NSDictionary * _Nullable)readAttributeProductIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeNodeLabelWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeNodeLabelWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index fe261fb6825dc8..ec6f0c49b74d73 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -5070,6 +5070,11 @@ - (void)keepActiveWithParams:(MTRBridgedDeviceBasicInformationClusterKeepActiveP return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBridgedDeviceBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeProductNameID) params:params]; } +- (NSDictionary * _Nullable)readAttributeProductIDWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBridgedDeviceBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeProductIDID) params:params]; +} + - (NSDictionary * _Nullable)readAttributeNodeLabelWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBridgedDeviceBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBridgedDeviceBasicInformationAttributeNodeLabelID) 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 81744d5c6994ff..1ba55467d670af 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 @@ -7697,6 +7697,53 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpa } // namespace ProductName +namespace ProductID { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::BridgedDeviceBasicInformation::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(chip::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(endpoint, Clusters::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, + markDirty); +} + +Protocols::InteractionModel::Status Set(chip::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::BridgedDeviceBasicInformation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ProductID + namespace NodeLabel { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & 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 cd73287e99b4ca..53e24c079fc4bd 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 @@ -1225,6 +1225,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpa Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); } // namespace ProductName +namespace ProductID { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ProductID + namespace NodeLabel { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::CharSpan value); 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 881ec25faa191d..af49e0617caa1f 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 @@ -8228,6 +8228,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, vendorID); case Attributes::ProductName::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, productName); + case Attributes::ProductID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, productID); case Attributes::NodeLabel::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, nodeLabel); case Attributes::HardwareVersion::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 c52692f1ad4591..25ded74c85a287 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 @@ -11134,6 +11134,18 @@ struct TypeInfo static constexpr size_t MaxLength() { return 32; } }; } // namespace ProductName +namespace ProductID { +struct TypeInfo +{ + using Type = uint16_t; + using DecodableType = uint16_t; + using DecodableArgType = uint16_t; + + static constexpr ClusterId GetClusterId() { return Clusters::BridgedDeviceBasicInformation::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ProductID::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ProductID namespace NodeLabel { struct TypeInfo { @@ -11348,6 +11360,7 @@ struct TypeInfo Attributes::VendorName::TypeInfo::DecodableType vendorName; Attributes::VendorID::TypeInfo::DecodableType vendorID = static_cast(0); Attributes::ProductName::TypeInfo::DecodableType productName; + Attributes::ProductID::TypeInfo::DecodableType productID = static_cast(0); Attributes::NodeLabel::TypeInfo::DecodableType nodeLabel; Attributes::HardwareVersion::TypeInfo::DecodableType hardwareVersion = static_cast(0); Attributes::HardwareVersionString::TypeInfo::DecodableType hardwareVersionString; 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 b6e3a64e1bcfc7..0a144da9030e42 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 @@ -1894,6 +1894,10 @@ namespace ProductName { static constexpr AttributeId Id = 0x00000003; } // namespace ProductName +namespace ProductID { +static constexpr AttributeId Id = 0x00000004; +} // namespace ProductID + namespace NodeLabel { static constexpr AttributeId Id = 0x00000005; } // namespace NodeLabel diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 01d9f7edc46758..9367f844d3c16b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -3489,6 +3489,7 @@ class TimeSynchronizationSetDefaultNTP : public ClusterCommand | * VendorName | 0x0001 | | * VendorID | 0x0002 | | * ProductName | 0x0003 | +| * ProductID | 0x0004 | | * NodeLabel | 0x0005 | | * HardwareVersion | 0x0007 | | * HardwareVersionString | 0x0008 | @@ -18274,6 +18275,7 @@ void registerClusterBridgedDeviceBasicInformation(Commands & commands, Credentia make_unique(Id, "vendor-name", Attributes::VendorName::Id, credsIssuerConfig), // make_unique(Id, "vendor-id", Attributes::VendorID::Id, credsIssuerConfig), // make_unique(Id, "product-name", Attributes::ProductName::Id, credsIssuerConfig), // + make_unique(Id, "product-id", Attributes::ProductID::Id, credsIssuerConfig), // make_unique(Id, "node-label", Attributes::NodeLabel::Id, credsIssuerConfig), // make_unique(Id, "hardware-version", Attributes::HardwareVersion::Id, credsIssuerConfig), // make_unique(Id, "hardware-version-string", Attributes::HardwareVersionString::Id, credsIssuerConfig), // @@ -18300,6 +18302,8 @@ void registerClusterBridgedDeviceBasicInformation(Commands & commands, Credentia WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "product-name", Attributes::ProductName::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "product-id", 0, UINT16_MAX, Attributes::ProductID::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "node-label", Attributes::NodeLabel::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "hardware-version", 0, UINT16_MAX, Attributes::HardwareVersion::Id, @@ -18344,6 +18348,7 @@ void registerClusterBridgedDeviceBasicInformation(Commands & commands, Credentia make_unique(Id, "vendor-name", Attributes::VendorName::Id, credsIssuerConfig), // make_unique(Id, "vendor-id", Attributes::VendorID::Id, credsIssuerConfig), // make_unique(Id, "product-name", Attributes::ProductName::Id, credsIssuerConfig), // + make_unique(Id, "product-id", Attributes::ProductID::Id, credsIssuerConfig), // make_unique(Id, "node-label", Attributes::NodeLabel::Id, credsIssuerConfig), // make_unique(Id, "hardware-version", Attributes::HardwareVersion::Id, credsIssuerConfig), // make_unique(Id, "hardware-version-string", Attributes::HardwareVersionString::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 d34bbe31914c4a..fb156dee2d45dc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -11066,6 +11066,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ProductName", 1, value); } + case BridgedDeviceBasicInformation::Attributes::ProductID::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ProductID", 1, value); + } case BridgedDeviceBasicInformation::Attributes::NodeLabel::Id: { chip::CharSpan value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); 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 59410234dd7589..d31a6b22803f88 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -40149,6 +40149,7 @@ class SubscribeAttributeTimeSynchronizationClusterRevision : public SubscribeAtt | * VendorName | 0x0001 | | * VendorID | 0x0002 | | * ProductName | 0x0003 | +| * ProductID | 0x0004 | | * NodeLabel | 0x0005 | | * HardwareVersion | 0x0007 | | * HardwareVersionString | 0x0008 | @@ -40477,6 +40478,92 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductName : public Subscr } }; +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ProductID + */ +class ReadBridgedDeviceBasicInformationProductID : public ReadAttribute { +public: + ReadBridgedDeviceBasicInformationProductID() + : ReadAttribute("product-id") + { + } + + ~ReadBridgedDeviceBasicInformationProductID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::BridgedDeviceBasicInformation::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductID::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); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasicInformation alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeProductIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BridgedDeviceBasicInformation.ProductID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("BridgedDeviceBasicInformation ProductID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeBridgedDeviceBasicInformationProductID : public SubscribeAttribute { +public: + SubscribeAttributeBridgedDeviceBasicInformationProductID() + : SubscribeAttribute("product-id") + { + } + + ~SubscribeAttributeBridgedDeviceBasicInformationProductID() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::BridgedDeviceBasicInformation::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::BridgedDeviceBasicInformation::Attributes::ProductID::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); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasicInformation 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 subscribeAttributeProductIDWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"BridgedDeviceBasicInformation.ProductID 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 + /* * Attribute NodeLabel */ @@ -192407,6 +192494,10 @@ void registerClusterBridgedDeviceBasicInformation(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // From 9a55b3eddac9c9cdb4dda75ab41ee803ca7eb3e8 Mon Sep 17 00:00:00 2001 From: Shao Ling Tan <161761051+shaoltan-amazon@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:25:28 -0700 Subject: [PATCH 19/40] Fix simplified Linux tv-casting-app gn build error. (#34692) --- examples/tv-casting-app/linux/BUILD.gn | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/tv-casting-app/linux/BUILD.gn b/examples/tv-casting-app/linux/BUILD.gn index 0e4b9820538412..3a6cfb1e6f82f6 100644 --- a/examples/tv-casting-app/linux/BUILD.gn +++ b/examples/tv-casting-app/linux/BUILD.gn @@ -58,10 +58,12 @@ executable("chip-tv-casting-app") { if (chip_build_libshell) { defines += [ "ENABLE_CHIP_SHELL" ] - sources += [ - "CastingShellCommands.cpp", - "CastingShellCommands.h", - ] + if (!chip_casting_simplified) { + sources += [ + "CastingShellCommands.cpp", + "CastingShellCommands.h", + ] + } } output_dir = root_out_dir From 27501d48fd4f1dbc8bbb49ae7a767fe46429af6f Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 1 Aug 2024 04:27:52 +0200 Subject: [PATCH 20/40] adding parallel execution to restyle-diff (#34663) * adding parallel execution to restyle-diff * using xargs to call restyle-paths * fixing Copyright year * restyle the restyler --- scripts/helpers/restyle-diff.sh | 66 +++++++++++++++++---------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/scripts/helpers/restyle-diff.sh b/scripts/helpers/restyle-diff.sh index 5cc9ffa6b081fc..5f37c69762e281 100755 --- a/scripts/helpers/restyle-diff.sh +++ b/scripts/helpers/restyle-diff.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020-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. @@ -21,57 +21,54 @@ # you've written is kosher to CI # # Usage: -# restyle-diff.sh [-d] [ref] +# restyle-diff.sh [-d] [-p] [ref] # # if unspecified, ref defaults to upstream/master (or master) # -d sets container's log level to DEBUG, if unspecified the default log level will remain (info level) +# -p pulls the Docker image before running the restyle paths # here=${0%/*} set -e +MAX_ARGS=256 +pull_image=0 + CHIP_ROOT=$(cd "$here/../.." && pwd) cd "$CHIP_ROOT" -docker_run() { - if [ -t 0 ]; then - exec docker run --tty "$@" - - else - exec docker run "$@" - - fi -} - restyle-paths() { - image=restyled/restyler:edge - for path in "$@"; do - ( - docker_run --tty --interactive --rm \ - --env LOG_LEVEL \ - --env LOG_DESTINATION \ - --env LOG_FORMAT \ - --env LOG_COLOR \ - --env HOST_DIRECTORY="$PWD" \ - --env UNRESTRICTED=1 \ - --volume "$PWD":/code \ - --volume /tmp:/tmp \ - --volume /var/run/docker.sock:/var/run/docker.sock \ - --entrypoint restyle-path \ - "$image" "$path" - ) - done + docker run \ + --env LOG_LEVEL \ + --env LOG_DESTINATION \ + --env LOG_FORMAT \ + --env LOG_COLOR \ + --env HOST_DIRECTORY="$PWD" \ + --env UNRESTRICTED=1 \ + --volume "$PWD":/code \ + --volume /tmp:/tmp \ + --volume /var/run/docker.sock:/var/run/docker.sock \ + --entrypoint restyle-path \ + "$image" "$@" + } +#This was added to be able to use xargs to call the function restyle-paths +export -f restyle-paths + while [[ $# -gt 0 ]]; do case "$1" in -d) export LOG_LEVEL="DEBUG" shift ;; + -p) + pull_image=1 + shift + ;; *) ref="$1" shift @@ -81,8 +78,13 @@ done if [[ -z "$ref" ]]; then ref="master" - git remote | grep -qxF upstream && ref="upstream/master" + git remote | grep -qxF upstream && ref="upstream/master" && git fetch upstream fi -mapfile -t paths < <(git diff --ignore-submodules --name-only --merge-base "$ref") -restyle-paths "${paths[@]}" +if [[ $pull_image -eq 1 ]]; then + docker pull restyled/restyler:edge +fi + +paths=$(git diff --ignore-submodules --name-only --merge-base "$ref") + +echo "$paths" | xargs -n "$MAX_ARGS" bash -c 'restyle-paths "$@"' From 22c65cbb5d3b22b23242fa1c71c97e7744c11cc9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 31 Jul 2024 22:29:18 -0400 Subject: [PATCH 21/40] Add some bits to exercise global structs/enums to Unit Testing cluster. (#34540) * Adds things to the Unit Testing cluster XML. * This requires those things to be enabled in all-clusters-app, all-clusters-minimal-app, and one of the chef contact sensors to pass CI. * That requires an implementation in test-cluster-server * At which point might as well add a YAML test to exercise it all. --- .../all-clusters-app.matter | 25 + .../all-clusters-common/all-clusters-app.zap | 80 ++ .../all-clusters-minimal-app.matter | 25 + .../all-clusters-minimal-app.zap | 80 ++ .../rootnode_contactsensor_27f76aeaf5.matter | 25 + .../rootnode_contactsensor_27f76aeaf5.zap | 80 ++ .../test-cluster-server.cpp | 66 ++ src/app/tests/suites/TestCluster.yaml | 75 +- .../zcl/data-model/chip/test-cluster.xml | 29 + .../zcl/zcl-with-test-extensions.json | 4 +- src/app/zap-templates/zcl/zcl.json | 4 +- .../data_model/controller-clusters.matter | 19 + .../chip/devicecontroller/ChipClusters.java | 201 ++++ .../chip/devicecontroller/ChipStructs.java | 114 ++- .../devicecontroller/ClusterIDMapping.java | 22 + .../devicecontroller/ClusterInfoMapping.java | 109 +++ .../devicecontroller/ClusterReadMapping.java | 22 + .../devicecontroller/ClusterWriteMapping.java | 44 + .../chip/devicecontroller/cluster/files.gni | 1 + .../structs/UnitTestingClusterNestedStruct.kt | 18 +- .../structs/UnitTestingClusterSimpleStruct.kt | 16 +- .../UnitTestingClusterTestGlobalStruct.kt | 92 ++ .../cluster/clusters/UnitTestingCluster.kt | 866 +++++++++++++++--- .../java/matter/controller/cluster/files.gni | 1 + .../structs/UnitTestingClusterNestedStruct.kt | 18 +- .../structs/UnitTestingClusterSimpleStruct.kt | 16 +- .../UnitTestingClusterTestGlobalStruct.kt | 92 ++ .../cluster/ChipClusterEventStructTest.kt | 25 +- .../cluster/ChipClusterStructTest.kt | 120 ++- .../CHIPAttributeTLVValueDecoder.cpp | 336 ++++++- .../CHIPEventTLVValueDecoder.cpp | 47 +- .../python/chip/clusters/CHIPClusters.py | 36 + .../python/chip/clusters/Objects.py | 112 +++ .../CHIP/templates/availability.yaml | 37 +- .../MTRAttributeSpecifiedCheck.mm | 12 + .../MTRAttributeTLVValueDecoder.mm | 122 +++ .../CHIP/zap-generated/MTRBaseClusters.h | 39 + .../CHIP/zap-generated/MTRBaseClusters.mm | 344 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 6 + .../CHIP/zap-generated/MTRClusterNames.mm | 16 + .../CHIP/zap-generated/MTRClusters.h | 17 + .../CHIP/zap-generated/MTRClusters.mm | 91 ++ .../zap-generated/MTRCommandPayloadsObjc.h | 53 ++ .../zap-generated/MTRCommandPayloadsObjc.mm | 314 +++++++ .../MTRCommandPayloads_Internal.h | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 10 + .../CHIP/zap-generated/MTRStructsObjc.h | 2 + .../CHIP/zap-generated/MTRStructsObjc.mm | 10 +- .../zap-generated/attributes/Accessors.cpp | 139 +++ .../zap-generated/attributes/Accessors.h | 23 + .../app-common/zap-generated/callback.h | 6 + .../zap-generated/cluster-objects.cpp | 96 ++ .../zap-generated/cluster-objects.h | 139 ++- .../app-common/zap-generated/ids/Attributes.h | 16 + .../app-common/zap-generated/ids/Commands.h | 8 + .../zap-generated/cluster/Commands.h | 64 ++ .../cluster/ComplexArgumentParser.cpp | 92 +- .../cluster/ComplexArgumentParser.h | 10 +- .../cluster/logging/DataModelLogger.cpp | 116 ++- .../cluster/logging/DataModelLogger.h | 8 +- .../zap-generated/cluster/Commands.h | 815 +++++++++++++++- 61 files changed, 5155 insertions(+), 282 deletions(-) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt 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 3dd2b0f99fb439..f69ed20583379c 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 @@ -6949,6 +6949,7 @@ internal cluster UnitTesting = 4294048773 { SimpleBitmap f = 5; single g = 6; double h = 7; + optional TestGlobalEnum i = 8; } fabric_scoped struct TestFabricScoped { @@ -6981,6 +6982,7 @@ internal cluster UnitTesting = 4294048773 { int8u a = 0; boolean b = 1; SimpleStruct c = 2; + optional TestGlobalStruct d = 3; } struct NestedStructList { @@ -7066,6 +7068,8 @@ internal cluster UnitTesting = 4294048773 { timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; + attribute TestGlobalEnum globalEnum = 51; + attribute TestGlobalStruct globalStruct = 52; attribute optional boolean unsupported = 255; attribute nullable boolean nullableBoolean = 16384; attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385; @@ -7101,6 +7105,8 @@ internal cluster UnitTesting = 4294048773 { attribute nullable int16u nullableRangeRestrictedInt16u = 16424; attribute nullable int16s nullableRangeRestrictedInt16s = 16425; attribute optional int8u writeOnlyInt8u = 16426; + attribute nullable TestGlobalEnum nullableGlobalEnum = 16435; + attribute nullable TestGlobalStruct nullableGlobalStruct = 16436; attribute int8u meiInt8u = 4294070017; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -7252,6 +7258,11 @@ internal cluster UnitTesting = 4294048773 { SimpleEnum arg2 = 1; } + response struct GlobalEchoResponse = 14 { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestNullableOptionalRequestRequest { optional nullable int8u arg1 = 0; } @@ -7305,6 +7316,11 @@ internal cluster UnitTesting = 4294048773 { octet_string payload = 0; } + request struct GlobalEchoRequestRequest { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestDifferentVendorMeiRequestRequest { int8u arg1 = 0; } @@ -7388,6 +7404,9 @@ internal cluster UnitTesting = 4294048773 { the string back. If the string is large then it would require a session that supports large payloads. */ command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24; + /** Command that takes arguments that are global structs/enums and the + response just echoes them back. */ + command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25; /** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */ command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962; } @@ -9283,6 +9302,8 @@ endpoint 1 { ram attribute timedWriteBoolean; callback attribute generalErrorBoolean; callback attribute clusterErrorBoolean; + ram attribute globalEnum; + callback attribute globalStruct; ram attribute nullableBoolean default = false; ram attribute nullableBitmap8 default = 0; ram attribute nullableBitmap16 default = 0; @@ -9317,6 +9338,8 @@ endpoint 1 { ram attribute nullableRangeRestrictedInt16u default = 200; ram attribute nullableRangeRestrictedInt16s default = -100; callback attribute writeOnlyInt8u default = 0; + ram attribute nullableGlobalEnum; + callback attribute nullableGlobalStruct; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; ram attribute meiInt8u default = 0; @@ -9342,6 +9365,7 @@ endpoint 1 { handle command TestListInt8UReverseRequest; handle command StringEchoResponse; handle command TestEnumsRequest; + handle command GlobalEchoResponse; handle command TestNullableOptionalRequest; handle command SimpleStructEchoRequest; handle command TimedInvokeRequest; @@ -9351,6 +9375,7 @@ endpoint 1 { handle command TestBatchHelperRequest; handle command TestSecondBatchHelperRequest; handle command StringEchoRequest; + handle command GlobalEchoRequest; handle command TestDifferentVendorMeiRequest; handle command TestDifferentVendorMeiResponse; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index a052433002d237..7b3ccf977dbc2b 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -22341,6 +22341,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "GlobalEchoResponse", + "code": 14, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, { "name": "TestNullableOptionalRequest", "code": 15, @@ -22413,6 +22421,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "GlobalEchoRequest", + "code": 25, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, { "name": "TestDifferentVendorMeiRequest", "code": 4294049962, @@ -23183,6 +23199,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "global_enum", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "TestGlobalEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "global_struct", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "TestGlobalStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_boolean", "code": 16384, @@ -23727,6 +23775,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_global_enum", + "code": 16435, + "mfgCode": null, + "side": "server", + "type": "TestGlobalEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_global_struct", + "code": 16436, + "mfgCode": null, + "side": "server", + "type": "TestGlobalStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 4bf0d15e54f799..7db7a1c97c61b0 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -5540,6 +5540,7 @@ internal cluster UnitTesting = 4294048773 { SimpleBitmap f = 5; single g = 6; double h = 7; + optional TestGlobalEnum i = 8; } fabric_scoped struct TestFabricScoped { @@ -5572,6 +5573,7 @@ internal cluster UnitTesting = 4294048773 { int8u a = 0; boolean b = 1; SimpleStruct c = 2; + optional TestGlobalStruct d = 3; } struct NestedStructList { @@ -5657,6 +5659,8 @@ internal cluster UnitTesting = 4294048773 { timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; + attribute TestGlobalEnum globalEnum = 51; + attribute TestGlobalStruct globalStruct = 52; attribute optional boolean unsupported = 255; attribute nullable boolean nullableBoolean = 16384; attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385; @@ -5692,6 +5696,8 @@ internal cluster UnitTesting = 4294048773 { attribute nullable int16u nullableRangeRestrictedInt16u = 16424; attribute nullable int16s nullableRangeRestrictedInt16s = 16425; attribute optional int8u writeOnlyInt8u = 16426; + attribute nullable TestGlobalEnum nullableGlobalEnum = 16435; + attribute nullable TestGlobalStruct nullableGlobalStruct = 16436; attribute int8u meiInt8u = 4294070017; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -5843,6 +5849,11 @@ internal cluster UnitTesting = 4294048773 { SimpleEnum arg2 = 1; } + response struct GlobalEchoResponse = 14 { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestNullableOptionalRequestRequest { optional nullable int8u arg1 = 0; } @@ -5896,6 +5907,11 @@ internal cluster UnitTesting = 4294048773 { octet_string payload = 0; } + request struct GlobalEchoRequestRequest { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestDifferentVendorMeiRequestRequest { int8u arg1 = 0; } @@ -5979,6 +5995,9 @@ internal cluster UnitTesting = 4294048773 { the string back. If the string is large then it would require a session that supports large payloads. */ command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24; + /** Command that takes arguments that are global structs/enums and the + response just echoes them back. */ + command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25; /** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */ command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962; } @@ -6840,6 +6859,8 @@ endpoint 1 { ram attribute timedWriteBoolean; callback attribute generalErrorBoolean; callback attribute clusterErrorBoolean; + ram attribute globalEnum; + callback attribute globalStruct; ram attribute nullableBoolean default = false; ram attribute nullableBitmap8 default = 0; ram attribute nullableBitmap16 default = 0; @@ -6874,6 +6895,8 @@ endpoint 1 { ram attribute nullableRangeRestrictedInt16u default = 200; ram attribute nullableRangeRestrictedInt16s default = -100; callback attribute writeOnlyInt8u default = 0; + ram attribute nullableGlobalEnum; + callback attribute nullableGlobalStruct; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; ram attribute meiInt8u default = 0; @@ -6899,6 +6922,7 @@ endpoint 1 { handle command TestListInt8UReverseRequest; handle command StringEchoResponse; handle command TestEnumsRequest; + handle command GlobalEchoResponse; handle command TestNullableOptionalRequest; handle command SimpleStructEchoRequest; handle command TimedInvokeRequest; @@ -6908,6 +6932,7 @@ endpoint 1 { handle command TestBatchHelperRequest; handle command TestSecondBatchHelperRequest; handle command StringEchoRequest; + handle command GlobalEchoRequest; handle command TestDifferentVendorMeiRequest; handle command TestDifferentVendorMeiResponse; } diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 57f2c0412fca55..560e95a7ec180a 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -9081,6 +9081,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "GlobalEchoResponse", + "code": 14, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, { "name": "TestNullableOptionalRequest", "code": 15, @@ -9153,6 +9161,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "GlobalEchoRequest", + "code": 25, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, { "name": "TestDifferentVendorMeiRequest", "code": 4294049962, @@ -9923,6 +9939,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "global_enum", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "TestGlobalEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "global_struct", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "TestGlobalStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_boolean", "code": 16384, @@ -10467,6 +10515,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_global_enum", + "code": 16435, + "mfgCode": null, + "side": "server", + "type": "TestGlobalEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_global_struct", + "code": 16436, + "mfgCode": null, + "side": "server", + "type": "TestGlobalStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 5735b2cf936ff4..6e7ce6b18132ea 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -1570,6 +1570,7 @@ internal cluster UnitTesting = 4294048773 { SimpleBitmap f = 5; single g = 6; double h = 7; + optional TestGlobalEnum i = 8; } fabric_scoped struct TestFabricScoped { @@ -1602,6 +1603,7 @@ internal cluster UnitTesting = 4294048773 { int8u a = 0; boolean b = 1; SimpleStruct c = 2; + optional TestGlobalStruct d = 3; } struct NestedStructList { @@ -1687,6 +1689,8 @@ internal cluster UnitTesting = 4294048773 { timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; + attribute TestGlobalEnum globalEnum = 51; + attribute TestGlobalStruct globalStruct = 52; attribute optional boolean unsupported = 255; attribute nullable boolean nullableBoolean = 16384; attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385; @@ -1722,6 +1726,8 @@ internal cluster UnitTesting = 4294048773 { attribute nullable int16u nullableRangeRestrictedInt16u = 16424; attribute nullable int16s nullableRangeRestrictedInt16s = 16425; attribute optional int8u writeOnlyInt8u = 16426; + attribute nullable TestGlobalEnum nullableGlobalEnum = 16435; + attribute nullable TestGlobalStruct nullableGlobalStruct = 16436; attribute int8u meiInt8u = 4294070017; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -1873,6 +1879,11 @@ internal cluster UnitTesting = 4294048773 { SimpleEnum arg2 = 1; } + response struct GlobalEchoResponse = 14 { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestNullableOptionalRequestRequest { optional nullable int8u arg1 = 0; } @@ -1926,6 +1937,11 @@ internal cluster UnitTesting = 4294048773 { octet_string payload = 0; } + request struct GlobalEchoRequestRequest { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestDifferentVendorMeiRequestRequest { int8u arg1 = 0; } @@ -2009,6 +2025,9 @@ internal cluster UnitTesting = 4294048773 { the string back. If the string is large then it would require a session that supports large payloads. */ command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24; + /** Command that takes arguments that are global structs/enums and the + response just echoes them back. */ + command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25; /** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */ command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962; } @@ -2332,6 +2351,8 @@ endpoint 1 { ram attribute timedWriteBoolean; callback attribute generalErrorBoolean; callback attribute clusterErrorBoolean; + ram attribute globalEnum; + callback attribute globalStruct; ram attribute nullableBoolean default = false; ram attribute nullableBitmap8 default = 0; ram attribute nullableBitmap16 default = 0; @@ -2366,6 +2387,8 @@ endpoint 1 { ram attribute nullableRangeRestrictedInt16u default = 200; ram attribute nullableRangeRestrictedInt16s default = -100; callback attribute writeOnlyInt8u default = 0; + ram attribute nullableGlobalEnum; + callback attribute nullableGlobalStruct; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; ram attribute meiInt8u default = 0; @@ -2390,6 +2413,7 @@ endpoint 1 { handle command TestListNestedStructListArgumentRequest; handle command TestListInt8UReverseRequest; handle command TestEnumsRequest; + handle command GlobalEchoResponse; handle command TestNullableOptionalRequest; handle command SimpleStructEchoRequest; handle command TimedInvokeRequest; @@ -2398,6 +2422,7 @@ endpoint 1 { handle command TestEmitTestFabricScopedEventRequest; handle command TestBatchHelperRequest; handle command TestSecondBatchHelperRequest; + handle command GlobalEchoRequest; handle command TestDifferentVendorMeiRequest; handle command TestDifferentVendorMeiResponse; } diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap index 590dea9f9f3c8e..02a553e03f9cd1 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap @@ -3252,6 +3252,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "GlobalEchoResponse", + "code": 14, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, { "name": "TestNullableOptionalRequest", "code": 15, @@ -3316,6 +3324,14 @@ "isIncoming": 1, "isEnabled": 1 }, + { + "name": "GlobalEchoRequest", + "code": 25, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, { "name": "TestDifferentVendorMeiRequest", "code": 4294049962, @@ -4086,6 +4102,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "global_enum", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "TestGlobalEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "global_struct", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "TestGlobalStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "nullable_boolean", "code": 16384, @@ -4630,6 +4678,38 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "nullable_global_enum", + "code": 16435, + "mfgCode": null, + "side": "server", + "type": "TestGlobalEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "nullable_global_struct", + "code": 16436, + "mfgCode": null, + "side": "server", + "type": "TestGlobalStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp index 4b6fc979336ab3..9bd925780524eb 100644 --- a/src/app/clusters/test-cluster-server/test-cluster-server.cpp +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -101,8 +101,12 @@ class TestAttrAccess : public AttributeAccessInterface AttributeValueDecoder & aDecoder); CHIP_ERROR ReadStructAttribute(AttributeValueEncoder & aEncoder); CHIP_ERROR WriteStructAttribute(AttributeValueDecoder & aDecoder); + CHIP_ERROR ReadGlobalStruct(AttributeValueEncoder & aEncoder); + CHIP_ERROR WriteGlobalStruct(AttributeValueDecoder & aDecoder); CHIP_ERROR ReadNullableStruct(AttributeValueEncoder & aEncoder); CHIP_ERROR WriteNullableStruct(AttributeValueDecoder & aDecoder); + CHIP_ERROR ReadNullableGlobalStruct(AttributeValueEncoder & aEncoder); + CHIP_ERROR WriteNullableGlobalStruct(AttributeValueDecoder & aDecoder); CHIP_ERROR ReadListFabricScopedAttribute(AttributeValueEncoder & aEncoder); CHIP_ERROR WriteListFabricScopedAttribute(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder); }; @@ -126,7 +130,9 @@ size_t gListLongOctetStringLen = kAttributeListLength; Structs::TestListStructOctet::Type listStructOctetStringData[kAttributeListLength]; OctetStringData gStructAttributeByteSpanData; Structs::SimpleStruct::Type gStructAttributeValue; +Globals::Structs::TestGlobalStruct::Type gGlobalStructAttributeValue; NullableStruct::TypeInfo::Type gNullableStructAttributeValue; +DataModel::Nullable gNullableGlobalStructAttributeValue; chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::Type gListFabricScopedAttributeValue[kAttributeListLength]; uint8_t gListFabricScoped_fabricSensitiveInt8uList[kAttributeListLength][kFabricSensitiveIntListLength]; @@ -198,6 +204,9 @@ CHIP_ERROR TestAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attribu case StructAttr::Id: { return ReadStructAttribute(aEncoder); } + case GlobalStruct::Id: { + return ReadGlobalStruct(aEncoder); + } case ListLongOctetString::Id: { return ReadListLongOctetStringAttribute(aEncoder); } @@ -207,6 +216,9 @@ CHIP_ERROR TestAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attribu case NullableStruct::Id: { return ReadNullableStruct(aEncoder); } + case NullableGlobalStruct::Id: { + return ReadNullableGlobalStruct(aEncoder); + } case GeneralErrorBoolean::Id: { return StatusIB(Protocols::InteractionModel::Status::InvalidDataType).ToChipError(); } @@ -249,9 +261,15 @@ CHIP_ERROR TestAttrAccess::Write(const ConcreteDataAttributePath & aPath, Attrib case StructAttr::Id: { return WriteStructAttribute(aDecoder); } + case GlobalStruct::Id: { + return WriteGlobalStruct(aDecoder); + } case NullableStruct::Id: { return WriteNullableStruct(aDecoder); } + case NullableGlobalStruct::Id: { + return WriteNullableGlobalStruct(aDecoder); + } case GeneralErrorBoolean::Id: { return StatusIB(Protocols::InteractionModel::Status::InvalidDataType).ToChipError(); } @@ -276,6 +294,26 @@ CHIP_ERROR TestAttrAccess::WriteNullableStruct(AttributeValueDecoder & aDecoder) return aDecoder.Decode(gNullableStructAttributeValue); } +CHIP_ERROR TestAttrAccess::ReadNullableGlobalStruct(AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(gNullableGlobalStructAttributeValue); +} + +CHIP_ERROR TestAttrAccess::WriteNullableGlobalStruct(AttributeValueDecoder & aDecoder) +{ + Attributes::NullableGlobalStruct::TypeInfo::DecodableType temp; + ReturnErrorOnFailure(aDecoder.Decode(temp)); + + if (!temp.IsNull()) + { + // We don't support a nonempty charspan here for now. + VerifyOrReturnError(temp.Value().name.empty(), CHIP_ERROR_BUFFER_TOO_SMALL); + } + + gNullableGlobalStructAttributeValue = temp; + return CHIP_NO_ERROR; +} + CHIP_ERROR TestAttrAccess::ReadListInt8uAttribute(AttributeValueEncoder & aEncoder) { return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { @@ -588,6 +626,23 @@ CHIP_ERROR TestAttrAccess::WriteStructAttribute(AttributeValueDecoder & aDecoder return CHIP_NO_ERROR; } +CHIP_ERROR TestAttrAccess::ReadGlobalStruct(AttributeValueEncoder & aEncoder) +{ + return aEncoder.Encode(gGlobalStructAttributeValue); +} + +CHIP_ERROR TestAttrAccess::WriteGlobalStruct(AttributeValueDecoder & aDecoder) +{ + // We don't support a nonempty charspan here for now. + Attributes::GlobalStruct::TypeInfo::DecodableType temp; + ReturnErrorOnFailure(aDecoder.Decode(temp)); + + VerifyOrReturnError(temp.name.empty(), CHIP_ERROR_BUFFER_TOO_SMALL); + + gGlobalStructAttributeValue = temp; + return CHIP_NO_ERROR; +} + CHIP_ERROR TestAttrAccess::ReadListFabricScopedAttribute(AttributeValueEncoder & aEncoder) { return aEncoder.EncodeList([](const auto & encoder) -> CHIP_ERROR { @@ -1114,6 +1169,17 @@ bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback( commandData.fillCharacter); } +bool emberAfUnitTestingClusterGlobalEchoRequestCallback(CommandHandler * commandObj, const ConcreteCommandPath & commandPath, + const Commands::GlobalEchoRequest::DecodableType & commandData) +{ + Commands::GlobalEchoResponse::Type response; + response.field1 = commandData.field1; + response.field2 = commandData.field2; + + commandObj->AddResponse(commandPath, response); + return true; +} + // ----------------------------------------------------------------------------- // Plugin initialization diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml index 308240a0dd537d..d2ff0cb2d0f27e 100644 --- a/src/app/tests/suites/TestCluster.yaml +++ b/src/app/tests/suites/TestCluster.yaml @@ -3912,6 +3912,7 @@ tests: 22, 23, 24, + 25, 4294049962, ] @@ -3919,7 +3920,7 @@ tests: command: "readAttribute" attribute: "GeneratedCommandList" response: - value: [0, 1, 4, 5, 6, 8, 9, 10, 11, 12, 13, 4294049979] + value: [0, 1, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 4294049979] - label: "Validate presence of MEI attribute" command: "readAttribute" @@ -3960,3 +3961,75 @@ tests: g: 1.5, h: 3.14159265358979, } + + # Globals testing + - label: "Write global-struct-typed attribute" + command: "writeAttribute" + attribute: "global_struct" + arguments: + value: + { + Name: "", + MyBitmap: 0x02, + MyEnum: TestGlobalEnum.SomeOtherValue, + } + + - label: "Read global-struct-typed attribute" + command: "readAttribute" + attribute: "global_struct" + response: + value: { + # Purposefully using non-symbolic values to make sure things work right. + Name: "", + MyBitmap: 0x02, + MyEnum: 1, + } + + - label: "Write nullable global-struct-typed attribute" + command: "writeAttribute" + attribute: "nullable_global_struct" + arguments: + value: { Name: "", MyBitmap: 0x01, MyEnum: TestGlobalEnum.SomeValue } + + - label: "Read nullable global-struct-typed attribute" + command: "readAttribute" + attribute: "nullable_global_struct" + response: + value: { Name: "", MyBitmap: 0x01, MyEnum: 0 } + + - label: "Write nullable global-struct-typed attribute as null" + command: "writeAttribute" + attribute: "nullable_global_struct" + arguments: + value: null + + - label: "Read nullable global-struct-typed attribute a second time" + command: "readAttribute" + attribute: "nullable_global_struct" + response: + value: null + + - label: "Send a command with global types" + command: "GlobalEchoRequest" + arguments: + values: + - name: "field1" + value: + { + Name: "", + MyBitmap: 0x02, + MyEnum: TestGlobalEnum.FinalValue, + } + - name: "field2" + value: TestGlobalEnum.SomeOtherValue + response: + values: + - name: "field1" + value: + { + Name: "", + MyBitmap: 0x02, + MyEnum: TestGlobalEnum.FinalValue, + } + - name: "field2" + value: TestGlobalEnum.SomeOtherValue diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index f010838f933b03..c289ee9f1c4338 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -58,6 +58,7 @@ limitations under the License. + @@ -65,6 +66,7 @@ limitations under the License. + @@ -198,6 +200,9 @@ limitations under the License. cluster_error_boolean + global_enum + global_struct + nullable_boolean nullable_bitmap8 nullable_bitmap16 @@ -232,8 +237,14 @@ limitations under the License. nullable_range_restricted_int16u nullable_range_restricted_int16s + write_only_int8u + nullable_global_enum + nullable_global_struct + mei_int8u @@ -474,6 +485,16 @@ limitations under the License. + + + Command that takes arguments that are global structs/enums and the + response just echoes them back. + + + + + @@ -622,6 +643,14 @@ limitations under the License. + + + Response to GlobalEchoRequest. + + + + + Response to TestDifferentVendorMeiRequest, which is a command having a different MEI vendor ID than the cluster. diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 4c5a59200e7d49..44de496f06f544 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -299,7 +299,9 @@ "struct_attr", "nullable_struct", "general_error_boolean", - "cluster_error_boolean" + "cluster_error_boolean", + "global_struct", + "nullable_global_struct" ], "Thread Border Router Management": [ "BorderRouterName", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 777847fb7f06ad..a72b44ee03084a 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -297,7 +297,9 @@ "struct_attr", "nullable_struct", "general_error_boolean", - "cluster_error_boolean" + "cluster_error_boolean", + "global_struct", + "nullable_global_struct" ], "Thread Border Router Management": [ "BorderRouterName", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 24a9e2fb45c2b0..c0e1f7cb0f2eb7 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9747,6 +9747,7 @@ internal cluster UnitTesting = 4294048773 { SimpleBitmap f = 5; single g = 6; double h = 7; + optional TestGlobalEnum i = 8; } fabric_scoped struct TestFabricScoped { @@ -9779,6 +9780,7 @@ internal cluster UnitTesting = 4294048773 { int8u a = 0; boolean b = 1; SimpleStruct c = 2; + optional TestGlobalStruct d = 3; } struct NestedStructList { @@ -9864,6 +9866,8 @@ internal cluster UnitTesting = 4294048773 { timedwrite attribute boolean timedWriteBoolean = 48; attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; + attribute TestGlobalEnum globalEnum = 51; + attribute TestGlobalStruct globalStruct = 52; attribute optional boolean unsupported = 255; attribute nullable boolean nullableBoolean = 16384; attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385; @@ -9899,6 +9903,8 @@ internal cluster UnitTesting = 4294048773 { attribute nullable int16u nullableRangeRestrictedInt16u = 16424; attribute nullable int16s nullableRangeRestrictedInt16s = 16425; attribute optional int8u writeOnlyInt8u = 16426; + attribute nullable TestGlobalEnum nullableGlobalEnum = 16435; + attribute nullable TestGlobalStruct nullableGlobalStruct = 16436; attribute int8u meiInt8u = 4294070017; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -10050,6 +10056,11 @@ internal cluster UnitTesting = 4294048773 { SimpleEnum arg2 = 1; } + response struct GlobalEchoResponse = 14 { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestNullableOptionalRequestRequest { optional nullable int8u arg1 = 0; } @@ -10103,6 +10114,11 @@ internal cluster UnitTesting = 4294048773 { octet_string payload = 0; } + request struct GlobalEchoRequestRequest { + TestGlobalStruct field1 = 0; + TestGlobalEnum field2 = 1; + } + request struct TestDifferentVendorMeiRequestRequest { int8u arg1 = 0; } @@ -10186,6 +10202,9 @@ internal cluster UnitTesting = 4294048773 { the string back. If the string is large then it would require a session that supports large payloads. */ command StringEchoRequest(StringEchoRequestRequest): StringEchoResponse = 24; + /** Command that takes arguments that are global structs/enums and the + response just echoes them back. */ + command GlobalEchoRequest(GlobalEchoRequestRequest): GlobalEchoResponse = 25; /** Command having a different MEI vendor ID than the cluster. Also emits TestDifferentVendorMeiEvent. */ command TestDifferentVendorMeiRequest(TestDifferentVendorMeiRequestRequest): TestDifferentVendorMeiResponse = 4294049962; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index f7fc1ea6955305..e8ba5badd39616 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -65210,6 +65210,8 @@ public static class UnitTestingCluster extends BaseChipCluster { private static final long TIMED_WRITE_BOOLEAN_ATTRIBUTE_ID = 48L; private static final long GENERAL_ERROR_BOOLEAN_ATTRIBUTE_ID = 49L; private static final long CLUSTER_ERROR_BOOLEAN_ATTRIBUTE_ID = 50L; + private static final long GLOBAL_ENUM_ATTRIBUTE_ID = 51L; + private static final long GLOBAL_STRUCT_ATTRIBUTE_ID = 52L; private static final long UNSUPPORTED_ATTRIBUTE_ID = 255L; private static final long NULLABLE_BOOLEAN_ATTRIBUTE_ID = 16384L; private static final long NULLABLE_BITMAP8_ATTRIBUTE_ID = 16385L; @@ -65245,6 +65247,8 @@ public static class UnitTestingCluster extends BaseChipCluster { private static final long NULLABLE_RANGE_RESTRICTED_INT16U_ATTRIBUTE_ID = 16424L; private static final long NULLABLE_RANGE_RESTRICTED_INT16S_ATTRIBUTE_ID = 16425L; private static final long WRITE_ONLY_INT8U_ATTRIBUTE_ID = 16426L; + private static final long NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID = 16435L; + private static final long NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID = 16436L; private static final long MEI_INT8U_ATTRIBUTE_ID = 4294070017L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; @@ -66288,6 +66292,47 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } + public void globalEchoRequest(GlobalEchoResponseCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2) { + globalEchoRequest(callback, field1, field2, 0); + } + + public void globalEchoRequest(GlobalEchoResponseCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2, int timedInvokeTimeoutMs) { + final long commandId = 25L; + + ArrayList elements = new ArrayList<>(); + final long field1FieldID = 0L; + BaseTLVType field1tlvValue = field1.encodeTlv(); + elements.add(new StructElement(field1FieldID, field1tlvValue)); + + final long field2FieldID = 1L; + BaseTLVType field2tlvValue = new UIntType(field2); + elements.add(new StructElement(field2FieldID, field2tlvValue)); + + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + final long field1FieldID = 0L; + ChipStructs.UnitTestingClusterTestGlobalStruct field1 = null; + final long field2FieldID = 1L; + Integer field2 = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == field1FieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + field1 = ChipStructs.UnitTestingClusterTestGlobalStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == field2FieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + field2 = castingValue.value(Integer.class); + } + } + } + callback.onSuccess(field1, field2); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + public void testDifferentVendorMeiRequest(TestDifferentVendorMeiResponseCallback callback, Integer arg1) { testDifferentVendorMeiRequest(callback, arg1, 0); } @@ -66381,6 +66426,10 @@ public interface StringEchoResponseCallback extends BaseClusterCallback { void onSuccess(byte[] payload); } + public interface GlobalEchoResponseCallback extends BaseClusterCallback { + void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2); + } + public interface TestDifferentVendorMeiResponseCallback extends BaseClusterCallback { void onSuccess(Integer arg1, Long eventNumber); } @@ -66413,6 +66462,10 @@ public interface ListFabricScopedAttributeCallback extends BaseAttributeCallback void onSuccess(List value); } + public interface GlobalStructAttributeCallback extends BaseAttributeCallback { + void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct value); + } + public interface NullableBooleanAttributeCallback extends BaseAttributeCallback { void onSuccess(@Nullable Boolean value); } @@ -66545,6 +66598,14 @@ public interface NullableRangeRestrictedInt16sAttributeCallback extends BaseAttr void onSuccess(@Nullable Integer value); } + public interface NullableGlobalEnumAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Integer value); + } + + public interface NullableGlobalStructAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value); + } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -68207,6 +68268,76 @@ public void onSuccess(byte[] tlv) { }, CLUSTER_ERROR_BOOLEAN_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readGlobalEnumAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_ENUM_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GLOBAL_ENUM_ATTRIBUTE_ID, true); + } + + public void writeGlobalEnumAttribute(DefaultClusterCallback callback, Integer value) { + writeGlobalEnumAttribute(callback, value, 0); + } + + public void writeGlobalEnumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), GLOBAL_ENUM_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeGlobalEnumAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_ENUM_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GLOBAL_ENUM_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGlobalStructAttribute( + GlobalStructAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_STRUCT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GLOBAL_STRUCT_ATTRIBUTE_ID, true); + } + + public void writeGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value) { + writeGlobalStructAttribute(callback, value, 0); + } + + public void writeGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value.encodeTlv(); + writeAttribute(new WriteAttributesCallbackImpl(callback), GLOBAL_STRUCT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeGlobalStructAttribute( + GlobalStructAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GLOBAL_STRUCT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GLOBAL_STRUCT_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readUnsupportedAttribute( BooleanAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, UNSUPPORTED_ATTRIBUTE_ID); @@ -69432,6 +69563,76 @@ public void onSuccess(byte[] tlv) { }, WRITE_ONLY_INT8U_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readNullableGlobalEnumAttribute( + NullableGlobalEnumAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID, true); + } + + public void writeNullableGlobalEnumAttribute(DefaultClusterCallback callback, Integer value) { + writeNullableGlobalEnumAttribute(callback, value, 0); + } + + public void writeNullableGlobalEnumAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value != null ? new UIntType(value) : new NullType(); + writeAttribute(new WriteAttributesCallbackImpl(callback), NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeNullableGlobalEnumAttribute( + NullableGlobalEnumAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NULLABLE_GLOBAL_ENUM_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readNullableGlobalStructAttribute( + NullableGlobalStructAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID, true); + } + + public void writeNullableGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value) { + writeNullableGlobalStructAttribute(callback, value, 0); + } + + public void writeNullableGlobalStructAttribute(DefaultClusterCallback callback, ChipStructs.UnitTestingClusterTestGlobalStruct value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value != null ? value.encodeTlv() : new NullType(); + writeAttribute(new WriteAttributesCallbackImpl(callback), NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeNullableGlobalStructAttribute( + NullableGlobalStructAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, NULLABLE_GLOBAL_STRUCT_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readMeiInt8uAttribute( IntegerAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEI_INT8U_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index df78372f96c945..5ab4c29beb623b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12899,6 +12899,7 @@ public static class UnitTestingClusterSimpleStruct { public Integer f; public Float g; public Double h; + public Optional i; private static final long A_ID = 0L; private static final long B_ID = 1L; private static final long C_ID = 2L; @@ -12907,6 +12908,7 @@ public static class UnitTestingClusterSimpleStruct { private static final long F_ID = 5L; private static final long G_ID = 6L; private static final long H_ID = 7L; + private static final long I_ID = 8L; public UnitTestingClusterSimpleStruct( Integer a, @@ -12916,7 +12918,8 @@ public UnitTestingClusterSimpleStruct( String e, Integer f, Float g, - Double h + Double h, + Optional i ) { this.a = a; this.b = b; @@ -12926,6 +12929,7 @@ public UnitTestingClusterSimpleStruct( this.f = f; this.g = g; this.h = h; + this.i = i; } public StructType encodeTlv() { @@ -12938,6 +12942,7 @@ public StructType encodeTlv() { values.add(new StructElement(F_ID, new UIntType(f))); values.add(new StructElement(G_ID, new FloatType(g))); values.add(new StructElement(H_ID, new DoubleType(h))); + values.add(new StructElement(I_ID, i.map((nonOptionali) -> new UIntType(nonOptionali)).orElse(new EmptyType()))); return new StructType(values); } @@ -12954,6 +12959,7 @@ public static UnitTestingClusterSimpleStruct decodeTlv(BaseTLVType tlvValue) { Integer f = null; Float g = null; Double h = null; + Optional i = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == A_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -12995,6 +13001,11 @@ public static UnitTestingClusterSimpleStruct decodeTlv(BaseTLVType tlvValue) { DoubleType castingValue = element.value(DoubleType.class); h = castingValue.value(Double.class); } + } else if (element.contextTagNum() == I_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + i = Optional.of(castingValue.value(Integer.class)); + } } } return new UnitTestingClusterSimpleStruct( @@ -13005,7 +13016,8 @@ public static UnitTestingClusterSimpleStruct decodeTlv(BaseTLVType tlvValue) { e, f, g, - h + h, + i ); } @@ -13037,6 +13049,9 @@ public String toString() { output.append("\th: "); output.append(h); output.append("\n"); + output.append("\ti: "); + output.append(i); + output.append("\n"); output.append("}\n"); return output.toString(); } @@ -13407,18 +13422,22 @@ public static class UnitTestingClusterNestedStruct { public Integer a; public Boolean b; public ChipStructs.UnitTestingClusterSimpleStruct c; + public Optional d; private static final long A_ID = 0L; private static final long B_ID = 1L; private static final long C_ID = 2L; + private static final long D_ID = 3L; public UnitTestingClusterNestedStruct( Integer a, Boolean b, - ChipStructs.UnitTestingClusterSimpleStruct c + ChipStructs.UnitTestingClusterSimpleStruct c, + Optional d ) { this.a = a; this.b = b; this.c = c; + this.d = d; } public StructType encodeTlv() { @@ -13426,6 +13445,7 @@ public StructType encodeTlv() { values.add(new StructElement(A_ID, new UIntType(a))); values.add(new StructElement(B_ID, new BooleanType(b))); values.add(new StructElement(C_ID, c.encodeTlv())); + values.add(new StructElement(D_ID, d.map((nonOptionald) -> nonOptionald.encodeTlv()).orElse(new EmptyType()))); return new StructType(values); } @@ -13437,6 +13457,7 @@ public static UnitTestingClusterNestedStruct decodeTlv(BaseTLVType tlvValue) { Integer a = null; Boolean b = null; ChipStructs.UnitTestingClusterSimpleStruct c = null; + Optional d = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == A_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -13453,12 +13474,18 @@ public static UnitTestingClusterNestedStruct decodeTlv(BaseTLVType tlvValue) { StructType castingValue = element.value(StructType.class); c = ChipStructs.UnitTestingClusterSimpleStruct.decodeTlv(castingValue); } + } else if (element.contextTagNum() == D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + d = Optional.of(ChipStructs.UnitTestingClusterTestGlobalStruct.decodeTlv(castingValue)); + } } } return new UnitTestingClusterNestedStruct( a, b, - c + c, + d ); } @@ -13475,6 +13502,9 @@ public String toString() { output.append("\tc: "); output.append(c); output.append("\n"); + output.append("\td: "); + output.append(d); + output.append("\n"); output.append("}\n"); return output.toString(); } @@ -13722,4 +13752,80 @@ public String toString() { return output.toString(); } } +public static class UnitTestingClusterTestGlobalStruct { + public String name; + public @Nullable Long myBitmap; + public @Nullable Optional myEnum; + private static final long NAME_ID = 0L; + private static final long MY_BITMAP_ID = 1L; + private static final long MY_ENUM_ID = 2L; + + public UnitTestingClusterTestGlobalStruct( + String name, + @Nullable Long myBitmap, + @Nullable Optional myEnum + ) { + this.name = name; + this.myBitmap = myBitmap; + this.myEnum = myEnum; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(NAME_ID, new StringType(name))); + values.add(new StructElement(MY_BITMAP_ID, myBitmap != null ? new UIntType(myBitmap) : new NullType())); + values.add(new StructElement(MY_ENUM_ID, myEnum != null ? myEnum.map((nonOptionalmyEnum) -> new UIntType(nonOptionalmyEnum)).orElse(new EmptyType()) : new NullType())); + + return new StructType(values); + } + + public static UnitTestingClusterTestGlobalStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String name = null; + @Nullable Long myBitmap = null; + @Nullable Optional myEnum = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = castingValue.value(String.class); + } + } else if (element.contextTagNum() == MY_BITMAP_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + myBitmap = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == MY_ENUM_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + myEnum = Optional.of(castingValue.value(Integer.class)); + } + } + } + return new UnitTestingClusterTestGlobalStruct( + name, + myBitmap, + myEnum + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("UnitTestingClusterTestGlobalStruct {\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("\tmyBitmap: "); + output.append(myBitmap); + output.append("\n"); + output.append("\tmyEnum: "); + output.append(myEnum); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 37936a56fba6a6..bad71209a40272 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -17755,6 +17755,8 @@ public enum Attribute { TimedWriteBoolean(48L), GeneralErrorBoolean(49L), ClusterErrorBoolean(50L), + GlobalEnum(51L), + GlobalStruct(52L), Unsupported(255L), NullableBoolean(16384L), NullableBitmap8(16385L), @@ -17790,6 +17792,8 @@ public enum Attribute { NullableRangeRestrictedInt16u(16424L), NullableRangeRestrictedInt16s(16425L), WriteOnlyInt8u(16426L), + NullableGlobalEnum(16435L), + NullableGlobalStruct(16436L), MeiInt8u(4294070017L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), @@ -17865,6 +17869,7 @@ public enum Command { TestBatchHelperRequest(22L), TestSecondBatchHelperRequest(23L), StringEchoRequest(24L), + GlobalEchoRequest(25L), TestDifferentVendorMeiRequest(4294049962L),; private final long id; Command(long id) { @@ -18223,6 +18228,23 @@ public static StringEchoRequestCommandField value(int id) throws NoSuchFieldErro } throw new NoSuchFieldError(); } + }public enum GlobalEchoRequestCommandField {Field1(0),Field2(1),; + private final int id; + GlobalEchoRequestCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static GlobalEchoRequestCommandField value(int id) throws NoSuchFieldError { + for (GlobalEchoRequestCommandField field : GlobalEchoRequestCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } }public enum TestDifferentVendorMeiRequestCommandField {Arg1(0),; private final int id; TestDifferentVendorMeiRequestCommandField(int id) { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 2ba2e50bb11ee8..1d398ff42e2c9d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -20908,6 +20908,30 @@ public void onError(Exception error) { } } + public static class DelegatedUnitTestingClusterGlobalEchoResponseCallback implements ChipClusters.UnitTestingCluster.GlobalEchoResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct field1, Integer field2) { + Map responseValues = new LinkedHashMap<>(); + + // field1: Struct TestGlobalStruct + // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo field2ResponseValue = new CommandResponseInfo("field2", "Integer"); + responseValues.put(field2ResponseValue, field2); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + public static class DelegatedUnitTestingClusterTestDifferentVendorMeiResponseCallback implements ChipClusters.UnitTestingCluster.TestDifferentVendorMeiResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -21078,6 +21102,27 @@ public void onError(Exception ex) { } } + public static class DelegatedUnitTestingClusterGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.GlobalStructAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.UnitTestingClusterTestGlobalStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedUnitTestingClusterNullableBooleanAttributeCallback implements ChipClusters.UnitTestingCluster.NullableBooleanAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -21771,6 +21816,48 @@ public void onError(Exception ex) { } } + public static class DelegatedUnitTestingClusterNullableGlobalEnumAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalEnumAttributeCallback, 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 DelegatedUnitTestingClusterNullableGlobalStructAttributeCallback implements ChipClusters.UnitTestingCluster.NullableGlobalStructAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.UnitTestingClusterTestGlobalStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.UnitTestingClusterTestGlobalStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedUnitTestingClusterGeneratedCommandListAttributeCallback implements ChipClusters.UnitTestingCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -29576,6 +29663,28 @@ public Map> getCommandMap() { ); unitTestingClusterInteractionInfoMap.put("stringEchoRequest", unitTestingstringEchoRequestInteractionInfo); + Map unitTestingglobalEchoRequestCommandParams = new LinkedHashMap(); + + + CommandParameterInfo unitTestingglobalEchoRequestfield2CommandParameterInfo = new CommandParameterInfo("field2", Integer.class, Integer.class); + unitTestingglobalEchoRequestCommandParams.put("field2",unitTestingglobalEchoRequestfield2CommandParameterInfo); + InteractionInfo unitTestingglobalEchoRequestInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.UnitTestingCluster) cluster) + .globalEchoRequest((ChipClusters.UnitTestingCluster.GlobalEchoResponseCallback) callback + , (ChipStructs.UnitTestingClusterTestGlobalStruct) + commandArguments.get("field1") + + , (Integer) + commandArguments.get("field2") + + ); + }, + () -> new DelegatedUnitTestingClusterGlobalEchoResponseCallback(), + unitTestingglobalEchoRequestCommandParams + ); + unitTestingClusterInteractionInfoMap.put("globalEchoRequest", unitTestingglobalEchoRequestInteractionInfo); + Map unitTestingtestDifferentVendorMeiRequestCommandParams = new LinkedHashMap(); CommandParameterInfo unitTestingtestDifferentVendorMeiRequestarg1CommandParameterInfo = new CommandParameterInfo("arg1", Integer.class, Integer.class); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 417ecce949fdc9..32d3d4f1a51756 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -20846,6 +20846,17 @@ private static Map readUnitTestingInteractionInfo() { readUnitTestingClusterErrorBooleanCommandParams ); result.put("readClusterErrorBooleanAttribute", readUnitTestingClusterErrorBooleanAttributeInteractionInfo); + Map readUnitTestingGlobalEnumCommandParams = new LinkedHashMap(); + InteractionInfo readUnitTestingGlobalEnumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.UnitTestingCluster) cluster).readGlobalEnumAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readUnitTestingGlobalEnumCommandParams + ); + result.put("readGlobalEnumAttribute", readUnitTestingGlobalEnumAttributeInteractionInfo); Map readUnitTestingUnsupportedCommandParams = new LinkedHashMap(); InteractionInfo readUnitTestingUnsupportedAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -21220,6 +21231,17 @@ private static Map readUnitTestingInteractionInfo() { readUnitTestingWriteOnlyInt8uCommandParams ); result.put("readWriteOnlyInt8uAttribute", readUnitTestingWriteOnlyInt8uAttributeInteractionInfo); + Map readUnitTestingNullableGlobalEnumCommandParams = new LinkedHashMap(); + InteractionInfo readUnitTestingNullableGlobalEnumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.UnitTestingCluster) cluster).readNullableGlobalEnumAttribute( + (ChipClusters.UnitTestingCluster.NullableGlobalEnumAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedUnitTestingClusterNullableGlobalEnumAttributeCallback(), + readUnitTestingNullableGlobalEnumCommandParams + ); + result.put("readNullableGlobalEnumAttribute", readUnitTestingNullableGlobalEnumAttributeInteractionInfo); Map readUnitTestingMeiInt8uCommandParams = new LinkedHashMap(); InteractionInfo readUnitTestingMeiInt8uAttributeInteractionInfo = 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 32759bb97af64c..93a48d76bf61dc 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -4827,6 +4827,28 @@ public Map> getWriteAttributeMap() { writeUnitTestingClusterErrorBooleanCommandParams ); writeUnitTestingInteractionInfo.put("writeClusterErrorBooleanAttribute", writeUnitTestingClusterErrorBooleanAttributeInteractionInfo); + Map writeUnitTestingGlobalEnumCommandParams = new LinkedHashMap(); + CommandParameterInfo unitTestingglobalEnumCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeUnitTestingGlobalEnumCommandParams.put( + "value", + unitTestingglobalEnumCommandParameterInfo + ); + InteractionInfo writeUnitTestingGlobalEnumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.UnitTestingCluster) cluster).writeGlobalEnumAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeUnitTestingGlobalEnumCommandParams + ); + writeUnitTestingInteractionInfo.put("writeGlobalEnumAttribute", writeUnitTestingGlobalEnumAttributeInteractionInfo); Map writeUnitTestingUnsupportedCommandParams = new LinkedHashMap(); CommandParameterInfo unitTestingunsupportedCommandParameterInfo = new CommandParameterInfo( @@ -5575,6 +5597,28 @@ public Map> getWriteAttributeMap() { writeUnitTestingWriteOnlyInt8uCommandParams ); writeUnitTestingInteractionInfo.put("writeWriteOnlyInt8uAttribute", writeUnitTestingWriteOnlyInt8uAttributeInteractionInfo); + Map writeUnitTestingNullableGlobalEnumCommandParams = new LinkedHashMap(); + CommandParameterInfo unitTestingnullableGlobalEnumCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeUnitTestingNullableGlobalEnumCommandParams.put( + "value", + unitTestingnullableGlobalEnumCommandParameterInfo + ); + InteractionInfo writeUnitTestingNullableGlobalEnumAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.UnitTestingCluster) cluster).writeNullableGlobalEnumAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeUnitTestingNullableGlobalEnumCommandParams + ); + writeUnitTestingInteractionInfo.put("writeNullableGlobalEnumAttribute", writeUnitTestingNullableGlobalEnumAttributeInteractionInfo); Map writeUnitTestingMeiInt8uCommandParams = new LinkedHashMap(); CommandParameterInfo unitTestingmeiInt8uCommandParameterInfo = new CommandParameterInfo( diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index e101562093412c..3cbd5cb52ce17a 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -151,6 +151,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestFabricScoped.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestListStructOctet.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UserLabelClusterLabelStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/WaterHeaterModeClusterModeOptionStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt index 6ec856c422029a..74cfa88e79291f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterNestedStruct.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader @@ -26,12 +27,14 @@ class UnitTestingClusterNestedStruct( val a: UInt, val b: Boolean, val c: UnitTestingClusterSimpleStruct, + val d: Optional, ) { override fun toString(): String = buildString { append("UnitTestingClusterNestedStruct {\n") append("\ta : $a\n") append("\tb : $b\n") append("\tc : $c\n") + append("\td : $d\n") append("}\n") } @@ -41,6 +44,10 @@ class UnitTestingClusterNestedStruct( put(ContextSpecificTag(TAG_A), a) put(ContextSpecificTag(TAG_B), b) c.toTlv(ContextSpecificTag(TAG_C), this) + if (d.isPresent) { + val optd = d.get() + optd.toTlv(ContextSpecificTag(TAG_D), this) + } endStructure() } } @@ -49,16 +56,25 @@ class UnitTestingClusterNestedStruct( private const val TAG_A = 0 private const val TAG_B = 1 private const val TAG_C = 2 + private const val TAG_D = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStruct { tlvReader.enterStructure(tlvTag) val a = tlvReader.getUInt(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader) + val d = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_D))) { + Optional.of( + UnitTestingClusterTestGlobalStruct.fromTlv(ContextSpecificTag(TAG_D), tlvReader) + ) + } else { + Optional.empty() + } tlvReader.exitContainer() - return UnitTestingClusterNestedStruct(a, b, c) + return UnitTestingClusterNestedStruct(a, b, c, d) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt index 24f06fb8752b6c..8a6d89c228c11d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterSimpleStruct.kt @@ -17,6 +17,7 @@ package chip.devicecontroller.cluster.structs import chip.devicecontroller.cluster.* +import java.util.Optional import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader @@ -31,6 +32,7 @@ class UnitTestingClusterSimpleStruct( val f: UInt, val g: Float, val h: Double, + val i: Optional, ) { override fun toString(): String = buildString { append("UnitTestingClusterSimpleStruct {\n") @@ -42,6 +44,7 @@ class UnitTestingClusterSimpleStruct( append("\tf : $f\n") append("\tg : $g\n") append("\th : $h\n") + append("\ti : $i\n") append("}\n") } @@ -56,6 +59,10 @@ class UnitTestingClusterSimpleStruct( put(ContextSpecificTag(TAG_F), f) put(ContextSpecificTag(TAG_G), g) put(ContextSpecificTag(TAG_H), h) + if (i.isPresent) { + val opti = i.get() + put(ContextSpecificTag(TAG_I), opti) + } endStructure() } } @@ -69,6 +76,7 @@ class UnitTestingClusterSimpleStruct( private const val TAG_F = 5 private const val TAG_G = 6 private const val TAG_H = 7 + private const val TAG_I = 8 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterSimpleStruct { tlvReader.enterStructure(tlvTag) @@ -80,10 +88,16 @@ class UnitTestingClusterSimpleStruct( val f = tlvReader.getUInt(ContextSpecificTag(TAG_F)) val g = tlvReader.getFloat(ContextSpecificTag(TAG_G)) val h = tlvReader.getDouble(ContextSpecificTag(TAG_H)) + val i = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_I))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_I))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h) + return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h, i) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt new file mode 100644 index 00000000000000..aa66049b549524 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 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. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import java.util.Optional +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class UnitTestingClusterTestGlobalStruct( + val name: String, + val myBitmap: ULong?, + val myEnum: Optional?, +) { + override fun toString(): String = buildString { + append("UnitTestingClusterTestGlobalStruct {\n") + append("\tname : $name\n") + append("\tmyBitmap : $myBitmap\n") + append("\tmyEnum : $myEnum\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + if (myBitmap != null) { + put(ContextSpecificTag(TAG_MY_BITMAP), myBitmap) + } else { + putNull(ContextSpecificTag(TAG_MY_BITMAP)) + } + if (myEnum != null) { + if (myEnum.isPresent) { + val optmyEnum = myEnum.get() + put(ContextSpecificTag(TAG_MY_ENUM), optmyEnum) + } + } else { + putNull(ContextSpecificTag(TAG_MY_ENUM)) + } + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_MY_BITMAP = 1 + private const val TAG_MY_ENUM = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterTestGlobalStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val myBitmap = + if (!tlvReader.isNull()) { + tlvReader.getULong(ContextSpecificTag(TAG_MY_BITMAP)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MY_BITMAP)) + null + } + val myEnum = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MY_ENUM))) { + Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_MY_ENUM))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MY_ENUM)) + null + } + + tlvReader.exitContainer() + + return UnitTestingClusterTestGlobalStruct(name, myBitmap, myEnum) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt index b50ab4468820d1..74402b19dcfdf3 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/UnitTestingCluster.kt @@ -123,6 +123,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e class StringEchoResponse(val payload: ByteArray) + class GlobalEchoResponse(val field1: UnitTestingClusterTestGlobalStruct, val field2: UByte) + class TestDifferentVendorMeiResponse(val arg1: UByte, val eventNumber: ULong) class ListInt8uAttribute(val value: List) @@ -203,6 +205,17 @@ class UnitTestingCluster(private val controller: MatterController, private val e object SubscriptionEstablished : ListFabricScopedAttributeSubscriptionState() } + class GlobalStructAttribute(val value: UnitTestingClusterTestGlobalStruct) + + sealed class GlobalStructAttributeSubscriptionState { + data class Success(val value: UnitTestingClusterTestGlobalStruct) : + GlobalStructAttributeSubscriptionState() + + data class Error(val exception: Exception) : GlobalStructAttributeSubscriptionState() + + object SubscriptionEstablished : GlobalStructAttributeSubscriptionState() + } + class NullableBooleanAttribute(val value: Boolean?) sealed class NullableBooleanAttributeSubscriptionState { @@ -541,6 +554,27 @@ class UnitTestingCluster(private val controller: MatterController, private val e object SubscriptionEstablished : NullableRangeRestrictedInt16sAttributeSubscriptionState() } + class NullableGlobalEnumAttribute(val value: UByte?) + + sealed class NullableGlobalEnumAttributeSubscriptionState { + data class Success(val value: UByte?) : NullableGlobalEnumAttributeSubscriptionState() + + data class Error(val exception: Exception) : NullableGlobalEnumAttributeSubscriptionState() + + object SubscriptionEstablished : NullableGlobalEnumAttributeSubscriptionState() + } + + class NullableGlobalStructAttribute(val value: UnitTestingClusterTestGlobalStruct?) + + sealed class NullableGlobalStructAttributeSubscriptionState { + data class Success(val value: UnitTestingClusterTestGlobalStruct?) : + NullableGlobalStructAttributeSubscriptionState() + + data class Error(val exception: Exception) : NullableGlobalStructAttributeSubscriptionState() + + object SubscriptionEstablished : NullableGlobalStructAttributeSubscriptionState() + } + class GeneratedCommandListAttribute(val value: List) sealed class GeneratedCommandListAttributeSubscriptionState { @@ -2386,6 +2420,68 @@ class UnitTestingCluster(private val controller: MatterController, private val e return StringEchoResponse(payload_decoded) } + suspend fun globalEchoRequest( + field1: UnitTestingClusterTestGlobalStruct, + field2: UByte, + timedInvokeTimeout: Duration? = null, + ): GlobalEchoResponse { + val commandId: UInt = 25u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + + val TAG_FIELD1_REQ: Int = 0 + field1.toTlv(ContextSpecificTag(TAG_FIELD1_REQ), tlvWriter) + + val TAG_FIELD2_REQ: Int = 1 + tlvWriter.put(ContextSpecificTag(TAG_FIELD2_REQ), field2) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_FIELD1: Int = 0 + var field1_decoded: UnitTestingClusterTestGlobalStruct? = null + + val TAG_FIELD2: Int = 1 + var field2_decoded: UByte? = null + + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag + + if (tag == ContextSpecificTag(TAG_FIELD1)) { + field1_decoded = UnitTestingClusterTestGlobalStruct.fromTlv(tag, tlvReader) + } + + if (tag == ContextSpecificTag(TAG_FIELD2)) { + field2_decoded = tlvReader.getUByte(tag) + } else { + tlvReader.skipElement() + } + } + + if (field1_decoded == null) { + throw IllegalStateException("field1 not found in TLV") + } + + if (field2_decoded == null) { + throw IllegalStateException("field2 not found in TLV") + } + + tlvReader.exitContainer() + + return GlobalEchoResponse(field1_decoded, field2_decoded) + } + suspend fun testDifferentVendorMeiRequest( arg1: UByte, timedInvokeTimeout: Duration? = null, @@ -8305,8 +8401,8 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun readUnsupportedAttribute(): Boolean? { - val ATTRIBUTE_ID: UInt = 255u + suspend fun readGlobalEnumAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 51u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8327,22 +8423,17 @@ class UnitTestingCluster(private val controller: MatterController, private val e it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Unsupported attribute not found in response" } + requireNotNull(attributeData) { "Globalenum attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getBoolean(AnonymousTag) - } else { - null - } + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) return decodedValue } - suspend fun writeUnsupportedAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 255u + suspend fun writeGlobalEnumAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 51u val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8381,11 +8472,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun subscribeUnsupportedAttribute( + suspend fun subscribeGlobalEnumAttribute( minInterval: Int, maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 255u + ): Flow { + val ATTRIBUTE_ID: UInt = 51u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8403,7 +8494,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - BooleanSubscriptionState.Error( + UByteSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -8416,28 +8507,23 @@ class UnitTestingCluster(private val controller: MatterController, private val e .filterIsInstance() .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Unsupported attribute not found in Node State update" } + requireNotNull(attributeData) { "Globalenum attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getBoolean(AnonymousTag) - } else { - null - } + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } + emit(UByteSubscriptionState.Success(decodedValue)) } SubscriptionState.SubscriptionEstablished -> { - emit(BooleanSubscriptionState.SubscriptionEstablished) + emit(UByteSubscriptionState.SubscriptionEstablished) } } } } - suspend fun readNullableBooleanAttribute(): NullableBooleanAttribute { - val ATTRIBUTE_ID: UInt = 16384u + suspend fun readGlobalStructAttribute(): GlobalStructAttribute { + val ATTRIBUTE_ID: UInt = 52u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8458,26 +8544,24 @@ class UnitTestingCluster(private val controller: MatterController, private val e it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Nullableboolean attribute not found in response" } + requireNotNull(attributeData) { "Globalstruct attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (!tlvReader.isNull()) { - tlvReader.getBoolean(AnonymousTag) - } else { - tlvReader.getNull(AnonymousTag) - null - } + val decodedValue: UnitTestingClusterTestGlobalStruct = + UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader) - return NullableBooleanAttribute(decodedValue) + return GlobalStructAttribute(decodedValue) } - suspend fun writeNullableBooleanAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 16384u + suspend fun writeGlobalStructAttribute( + value: UnitTestingClusterTestGlobalStruct, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 52u val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) + value.toTlv(AnonymousTag, tlvWriter) val writeRequests: WriteRequests = WriteRequests( @@ -8513,11 +8597,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun subscribeNullableBooleanAttribute( + suspend fun subscribeGlobalStructAttribute( minInterval: Int, maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 16384u + ): Flow { + val ATTRIBUTE_ID: UInt = 52u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8535,7 +8619,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - NullableBooleanAttributeSubscriptionState.Error( + GlobalStructAttributeSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -8548,31 +8632,24 @@ class UnitTestingCluster(private val controller: MatterController, private val e .filterIsInstance() .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { - "Nullableboolean attribute not found in Node State update" - } + requireNotNull(attributeData) { "Globalstruct attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (!tlvReader.isNull()) { - tlvReader.getBoolean(AnonymousTag) - } else { - tlvReader.getNull(AnonymousTag) - null - } + val decodedValue: UnitTestingClusterTestGlobalStruct = + UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader) - decodedValue?.let { emit(NullableBooleanAttributeSubscriptionState.Success(it)) } + emit(GlobalStructAttributeSubscriptionState.Success(decodedValue)) } SubscriptionState.SubscriptionEstablished -> { - emit(NullableBooleanAttributeSubscriptionState.SubscriptionEstablished) + emit(GlobalStructAttributeSubscriptionState.SubscriptionEstablished) } } } } - suspend fun readNullableBitmap8Attribute(): NullableBitmap8Attribute { - val ATTRIBUTE_ID: UInt = 16385u + suspend fun readUnsupportedAttribute(): Boolean? { + val ATTRIBUTE_ID: UInt = 255u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8593,23 +8670,22 @@ class UnitTestingCluster(private val controller: MatterController, private val e it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Nullablebitmap8 attribute not found in response" } + requireNotNull(attributeData) { "Unsupported attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (!tlvReader.isNull()) { - tlvReader.getUByte(AnonymousTag) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) } else { - tlvReader.getNull(AnonymousTag) null } - return NullableBitmap8Attribute(decodedValue) + return decodedValue } - suspend fun writeNullableBitmap8Attribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 16385u + suspend fun writeUnsupportedAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 255u val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8648,11 +8724,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun subscribeNullableBitmap8Attribute( + suspend fun subscribeUnsupportedAttribute( minInterval: Int, maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 16385u + ): Flow { + val ATTRIBUTE_ID: UInt = 255u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8670,7 +8746,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - NullableBitmap8AttributeSubscriptionState.Error( + BooleanSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -8683,31 +8759,28 @@ class UnitTestingCluster(private val controller: MatterController, private val e .filterIsInstance() .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { - "Nullablebitmap8 attribute not found in Node State update" - } + requireNotNull(attributeData) { "Unsupported 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()) { - tlvReader.getUByte(AnonymousTag) + val decodedValue: Boolean? = + if (tlvReader.isNextTag(AnonymousTag)) { + tlvReader.getBoolean(AnonymousTag) } else { - tlvReader.getNull(AnonymousTag) null } - decodedValue?.let { emit(NullableBitmap8AttributeSubscriptionState.Success(it)) } + decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } } SubscriptionState.SubscriptionEstablished -> { - emit(NullableBitmap8AttributeSubscriptionState.SubscriptionEstablished) + emit(BooleanSubscriptionState.SubscriptionEstablished) } } } } - suspend fun readNullableBitmap16Attribute(): NullableBitmap16Attribute { - val ATTRIBUTE_ID: UInt = 16386u + suspend fun readNullableBooleanAttribute(): NullableBooleanAttribute { + val ATTRIBUTE_ID: UInt = 16384u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8728,23 +8801,23 @@ class UnitTestingCluster(private val controller: MatterController, private val e it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Nullablebitmap16 attribute not found in response" } + requireNotNull(attributeData) { "Nullableboolean attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = + val decodedValue: Boolean? = if (!tlvReader.isNull()) { - tlvReader.getUShort(AnonymousTag) + tlvReader.getBoolean(AnonymousTag) } else { tlvReader.getNull(AnonymousTag) null } - return NullableBitmap16Attribute(decodedValue) + return NullableBooleanAttribute(decodedValue) } - suspend fun writeNullableBitmap16Attribute(value: UShort, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 16386u + suspend fun writeNullableBooleanAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 16384u val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8783,11 +8856,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun subscribeNullableBitmap16Attribute( + suspend fun subscribeNullableBooleanAttribute( minInterval: Int, maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 16386u + ): Flow { + val ATTRIBUTE_ID: UInt = 16384u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8805,7 +8878,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - NullableBitmap16AttributeSubscriptionState.Error( + NullableBooleanAttributeSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -8819,30 +8892,30 @@ class UnitTestingCluster(private val controller: MatterController, private val e .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } requireNotNull(attributeData) { - "Nullablebitmap16 attribute not found in Node State update" + "Nullableboolean attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = + val decodedValue: Boolean? = if (!tlvReader.isNull()) { - tlvReader.getUShort(AnonymousTag) + tlvReader.getBoolean(AnonymousTag) } else { tlvReader.getNull(AnonymousTag) null } - decodedValue?.let { emit(NullableBitmap16AttributeSubscriptionState.Success(it)) } + decodedValue?.let { emit(NullableBooleanAttributeSubscriptionState.Success(it)) } } SubscriptionState.SubscriptionEstablished -> { - emit(NullableBitmap16AttributeSubscriptionState.SubscriptionEstablished) + emit(NullableBooleanAttributeSubscriptionState.SubscriptionEstablished) } } } } - suspend fun readNullableBitmap32Attribute(): NullableBitmap32Attribute { - val ATTRIBUTE_ID: UInt = 16387u + suspend fun readNullableBitmap8Attribute(): NullableBitmap8Attribute { + val ATTRIBUTE_ID: UInt = 16385u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8863,23 +8936,23 @@ class UnitTestingCluster(private val controller: MatterController, private val e it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Nullablebitmap32 attribute not found in response" } + requireNotNull(attributeData) { "Nullablebitmap8 attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = + val decodedValue: UByte? = if (!tlvReader.isNull()) { - tlvReader.getUInt(AnonymousTag) + tlvReader.getUByte(AnonymousTag) } else { tlvReader.getNull(AnonymousTag) null } - return NullableBitmap32Attribute(decodedValue) + return NullableBitmap8Attribute(decodedValue) } - suspend fun writeNullableBitmap32Attribute(value: UInt, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 16387u + suspend fun writeNullableBitmap8Attribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 16385u val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -8918,11 +8991,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun subscribeNullableBitmap32Attribute( + suspend fun subscribeNullableBitmap8Attribute( minInterval: Int, maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 16387u + ): Flow { + val ATTRIBUTE_ID: UInt = 16385u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8940,7 +9013,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - NullableBitmap32AttributeSubscriptionState.Error( + NullableBitmap8AttributeSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -8954,30 +9027,30 @@ class UnitTestingCluster(private val controller: MatterController, private val e .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } requireNotNull(attributeData) { - "Nullablebitmap32 attribute not found in Node State update" + "Nullablebitmap8 attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = + val decodedValue: UByte? = if (!tlvReader.isNull()) { - tlvReader.getUInt(AnonymousTag) + tlvReader.getUByte(AnonymousTag) } else { tlvReader.getNull(AnonymousTag) null } - decodedValue?.let { emit(NullableBitmap32AttributeSubscriptionState.Success(it)) } + decodedValue?.let { emit(NullableBitmap8AttributeSubscriptionState.Success(it)) } } SubscriptionState.SubscriptionEstablished -> { - emit(NullableBitmap32AttributeSubscriptionState.SubscriptionEstablished) + emit(NullableBitmap8AttributeSubscriptionState.SubscriptionEstablished) } } } } - suspend fun readNullableBitmap64Attribute(): NullableBitmap64Attribute { - val ATTRIBUTE_ID: UInt = 16388u + suspend fun readNullableBitmap16Attribute(): NullableBitmap16Attribute { + val ATTRIBUTE_ID: UInt = 16386u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -8998,23 +9071,23 @@ class UnitTestingCluster(private val controller: MatterController, private val e it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Nullablebitmap64 attribute not found in response" } + requireNotNull(attributeData) { "Nullablebitmap16 attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: ULong? = + val decodedValue: UShort? = if (!tlvReader.isNull()) { - tlvReader.getULong(AnonymousTag) + tlvReader.getUShort(AnonymousTag) } else { tlvReader.getNull(AnonymousTag) null } - return NullableBitmap64Attribute(decodedValue) + return NullableBitmap16Attribute(decodedValue) } - suspend fun writeNullableBitmap64Attribute(value: ULong, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 16388u + suspend fun writeNullableBitmap16Attribute(value: UShort, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 16386u val tlvWriter = TlvWriter() tlvWriter.put(AnonymousTag, value) @@ -9053,11 +9126,11 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } - suspend fun subscribeNullableBitmap64Attribute( + suspend fun subscribeNullableBitmap16Attribute( minInterval: Int, maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 16388u + ): Flow { + val ATTRIBUTE_ID: UInt = 16386u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -9075,7 +9148,7 @@ class UnitTestingCluster(private val controller: MatterController, private val e when (subscriptionState) { is SubscriptionState.SubscriptionErrorNotification -> { emit( - NullableBitmap64AttributeSubscriptionState.Error( + NullableBitmap16AttributeSubscriptionState.Error( Exception( "Subscription terminated with error code: ${subscriptionState.terminationCause}" ) @@ -9089,12 +9162,282 @@ class UnitTestingCluster(private val controller: MatterController, private val e .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } requireNotNull(attributeData) { - "Nullablebitmap64 attribute not found in Node State update" + "Nullablebitmap16 attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) - val decodedValue: ULong? = + val decodedValue: UShort? = + if (!tlvReader.isNull()) { + tlvReader.getUShort(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NullableBitmap16AttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NullableBitmap16AttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNullableBitmap32Attribute(): NullableBitmap32Attribute { + val ATTRIBUTE_ID: UInt = 16387u + + 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) { "Nullablebitmap32 attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NullableBitmap32Attribute(decodedValue) + } + + suspend fun writeNullableBitmap32Attribute(value: UInt, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 16387u + + 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 subscribeNullableBitmap32Attribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 16387u + 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( + NullableBitmap32AttributeSubscriptionState.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) { + "Nullablebitmap32 attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt? = + if (!tlvReader.isNull()) { + tlvReader.getUInt(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NullableBitmap32AttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NullableBitmap32AttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNullableBitmap64Attribute(): NullableBitmap64Attribute { + val ATTRIBUTE_ID: UInt = 16388u + + 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) { "Nullablebitmap64 attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ULong? = + if (!tlvReader.isNull()) { + tlvReader.getULong(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NullableBitmap64Attribute(decodedValue) + } + + suspend fun writeNullableBitmap64Attribute(value: ULong, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 16388u + + 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 subscribeNullableBitmap64Attribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 16388u + 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( + NullableBitmap64AttributeSubscriptionState.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) { + "Nullablebitmap64 attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: ULong? = if (!tlvReader.isNull()) { tlvReader.getULong(AnonymousTag) } else { @@ -13051,6 +13394,279 @@ class UnitTestingCluster(private val controller: MatterController, private val e } } + suspend fun readNullableGlobalEnumAttribute(): NullableGlobalEnumAttribute { + val ATTRIBUTE_ID: UInt = 16435u + + 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) { "Nullableglobalenum attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte? = + if (!tlvReader.isNull()) { + tlvReader.getUByte(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NullableGlobalEnumAttribute(decodedValue) + } + + suspend fun writeNullableGlobalEnumAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 16435u + + 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 subscribeNullableGlobalEnumAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 16435u + 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( + NullableGlobalEnumAttributeSubscriptionState.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) { + "Nullableglobalenum 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()) { + tlvReader.getUByte(AnonymousTag) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NullableGlobalEnumAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NullableGlobalEnumAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readNullableGlobalStructAttribute(): NullableGlobalStructAttribute { + val ATTRIBUTE_ID: UInt = 16436u + + 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) { "Nullableglobalstruct attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UnitTestingClusterTestGlobalStruct? = + if (!tlvReader.isNull()) { + UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return NullableGlobalStructAttribute(decodedValue) + } + + suspend fun writeNullableGlobalStructAttribute( + value: UnitTestingClusterTestGlobalStruct, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 16436u + + val tlvWriter = TlvWriter() + value.toTlv(AnonymousTag, tlvWriter) + + 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 subscribeNullableGlobalStructAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 16436u + 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( + NullableGlobalStructAttributeSubscriptionState.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) { + "Nullableglobalstruct attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UnitTestingClusterTestGlobalStruct? = + if (!tlvReader.isNull()) { + UnitTestingClusterTestGlobalStruct.fromTlv(AnonymousTag, tlvReader) + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(NullableGlobalStructAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(NullableGlobalStructAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + suspend fun readMeiInt8uAttribute(): UByte { val ATTRIBUTE_ID: UInt = 4294070017u diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index dc0b4b09ec96f6..021d82d5e5b25a 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -151,6 +151,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNullablesAndOptionalsStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestFabricScoped.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestListStructOctet.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/UserLabelClusterLabelStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/WaterHeaterModeClusterModeOptionStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt index 3552ec2a5fc075..d57a0432a7c7ed 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterNestedStruct.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.structs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -26,12 +27,14 @@ class UnitTestingClusterNestedStruct( val a: UByte, val b: Boolean, val c: UnitTestingClusterSimpleStruct, + val d: Optional, ) { override fun toString(): String = buildString { append("UnitTestingClusterNestedStruct {\n") append("\ta : $a\n") append("\tb : $b\n") append("\tc : $c\n") + append("\td : $d\n") append("}\n") } @@ -41,6 +44,10 @@ class UnitTestingClusterNestedStruct( put(ContextSpecificTag(TAG_A), a) put(ContextSpecificTag(TAG_B), b) c.toTlv(ContextSpecificTag(TAG_C), this) + if (d.isPresent) { + val optd = d.get() + optd.toTlv(ContextSpecificTag(TAG_D), this) + } endStructure() } } @@ -49,16 +56,25 @@ class UnitTestingClusterNestedStruct( private const val TAG_A = 0 private const val TAG_B = 1 private const val TAG_C = 2 + private const val TAG_D = 3 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterNestedStruct { tlvReader.enterStructure(tlvTag) val a = tlvReader.getUByte(ContextSpecificTag(TAG_A)) val b = tlvReader.getBoolean(ContextSpecificTag(TAG_B)) val c = UnitTestingClusterSimpleStruct.fromTlv(ContextSpecificTag(TAG_C), tlvReader) + val d = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_D))) { + Optional.of( + UnitTestingClusterTestGlobalStruct.fromTlv(ContextSpecificTag(TAG_D), tlvReader) + ) + } else { + Optional.empty() + } tlvReader.exitContainer() - return UnitTestingClusterNestedStruct(a, b, c) + return UnitTestingClusterNestedStruct(a, b, c, d) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt index 864a28ffd7defc..722445efea8504 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterSimpleStruct.kt @@ -16,6 +16,7 @@ */ package matter.controller.cluster.structs +import java.util.Optional import matter.controller.cluster.* import matter.tlv.ContextSpecificTag import matter.tlv.Tag @@ -31,6 +32,7 @@ class UnitTestingClusterSimpleStruct( val f: UByte, val g: Float, val h: Double, + val i: Optional, ) { override fun toString(): String = buildString { append("UnitTestingClusterSimpleStruct {\n") @@ -42,6 +44,7 @@ class UnitTestingClusterSimpleStruct( append("\tf : $f\n") append("\tg : $g\n") append("\th : $h\n") + append("\ti : $i\n") append("}\n") } @@ -56,6 +59,10 @@ class UnitTestingClusterSimpleStruct( put(ContextSpecificTag(TAG_F), f) put(ContextSpecificTag(TAG_G), g) put(ContextSpecificTag(TAG_H), h) + if (i.isPresent) { + val opti = i.get() + put(ContextSpecificTag(TAG_I), opti) + } endStructure() } } @@ -69,6 +76,7 @@ class UnitTestingClusterSimpleStruct( private const val TAG_F = 5 private const val TAG_G = 6 private const val TAG_H = 7 + private const val TAG_I = 8 fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterSimpleStruct { tlvReader.enterStructure(tlvTag) @@ -80,10 +88,16 @@ class UnitTestingClusterSimpleStruct( val f = tlvReader.getUByte(ContextSpecificTag(TAG_F)) val g = tlvReader.getFloat(ContextSpecificTag(TAG_G)) val h = tlvReader.getDouble(ContextSpecificTag(TAG_H)) + val i = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_I))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_I))) + } else { + Optional.empty() + } tlvReader.exitContainer() - return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h) + return UnitTestingClusterSimpleStruct(a, b, c, d, e, f, g, h, i) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt new file mode 100644 index 00000000000000..66caded2c08ab3 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/UnitTestingClusterTestGlobalStruct.kt @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 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. + */ +package matter.controller.cluster.structs + +import java.util.Optional +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class UnitTestingClusterTestGlobalStruct( + val name: String, + val myBitmap: UInt?, + val myEnum: Optional?, +) { + override fun toString(): String = buildString { + append("UnitTestingClusterTestGlobalStruct {\n") + append("\tname : $name\n") + append("\tmyBitmap : $myBitmap\n") + append("\tmyEnum : $myEnum\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_NAME), name) + if (myBitmap != null) { + put(ContextSpecificTag(TAG_MY_BITMAP), myBitmap) + } else { + putNull(ContextSpecificTag(TAG_MY_BITMAP)) + } + if (myEnum != null) { + if (myEnum.isPresent) { + val optmyEnum = myEnum.get() + put(ContextSpecificTag(TAG_MY_ENUM), optmyEnum) + } + } else { + putNull(ContextSpecificTag(TAG_MY_ENUM)) + } + endStructure() + } + } + + companion object { + private const val TAG_NAME = 0 + private const val TAG_MY_BITMAP = 1 + private const val TAG_MY_ENUM = 2 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): UnitTestingClusterTestGlobalStruct { + tlvReader.enterStructure(tlvTag) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + val myBitmap = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_MY_BITMAP)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MY_BITMAP)) + null + } + val myEnum = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(ContextSpecificTag(TAG_MY_ENUM))) { + Optional.of(tlvReader.getUByte(ContextSpecificTag(TAG_MY_ENUM))) + } else { + Optional.empty() + } + } else { + tlvReader.getNull(ContextSpecificTag(TAG_MY_ENUM)) + null + } + + tlvReader.exitContainer() + + return UnitTestingClusterTestGlobalStruct(name, myBitmap, myEnum) + } + } +} diff --git a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt index 55c880e02e4bf2..bfee37f38f5437 100644 --- a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt +++ b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterEventStructTest.kt @@ -19,6 +19,7 @@ package chip.devicecontroller.cluster import chip.devicecontroller.cluster.eventstructs.UnitTestingClusterTestEventEvent import chip.devicecontroller.cluster.eventstructs.UnitTestingClusterTestFabricScopedEventEvent import chip.devicecontroller.cluster.structs.UnitTestingClusterSimpleStruct +import java.util.Optional import matter.tlv.AnonymousTag import matter.tlv.TlvReader import matter.tlv.TlvWriter @@ -28,9 +29,29 @@ class ChipClusterEventStructTest { @Test fun testEventEventTlvTest() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val simpleStruct2 = - UnitTestingClusterSimpleStruct(8U, false, 9U, byteArrayOf(0x02, 0x03), "test2", 4U, 5.6f, 7.8) + UnitTestingClusterSimpleStruct( + 8U, + false, + 9U, + byteArrayOf(0x02, 0x03), + "test2", + 4U, + 5.6f, + 7.8, + Optional.empty() + ) val struct = UnitTestingClusterTestEventEvent( 1U, diff --git a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt index ffa0044569e0af..a38a71d63141ee 100644 --- a/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt +++ b/src/controller/java/tests/chip/devicecontroller/cluster/ChipClusterStructTest.kt @@ -35,9 +35,29 @@ class ChipClusterStructTest { @Test fun doubleNestedStructTlvTest() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val simpleStruct2 = - UnitTestingClusterSimpleStruct(8U, false, 9U, byteArrayOf(0x02, 0x03), "test2", 4U, 5.6f, 7.8) + UnitTestingClusterSimpleStruct( + 8U, + false, + 9U, + byteArrayOf(0x02, 0x03), + "test2", + 4U, + 5.6f, + 7.8, + Optional.empty() + ) val nestedStructList = UnitTestingClusterNestedStructList( 1U, @@ -82,7 +102,17 @@ class ChipClusterStructTest { @Test fun nullablesAndOptionalsStructTlvTest1() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterNullablesAndOptionalsStruct( 1U, @@ -121,7 +151,17 @@ class ChipClusterStructTest { // Optional Check - 1 fun nullablesAndOptionalsStructTlvTest2() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterNullablesAndOptionalsStruct( 1U, @@ -160,7 +200,17 @@ class ChipClusterStructTest { // Optional Check - 2 fun nullablesAndOptionalsStructTlvTest3() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterNullablesAndOptionalsStruct( 1U, @@ -199,7 +249,17 @@ class ChipClusterStructTest { // Nullable check - 1 fun nullablesAndOptionalsStructTlvTest4() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterNullablesAndOptionalsStruct( 1U, @@ -238,7 +298,17 @@ class ChipClusterStructTest { // Nullable check - 2 fun nullablesAndOptionalsStructTlvTest5() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterNullablesAndOptionalsStruct( null, @@ -276,7 +346,17 @@ class ChipClusterStructTest { @Test fun testFabricScopedTlvTest1() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterTestFabricScoped( 1U, @@ -309,7 +389,17 @@ class ChipClusterStructTest { @Test fun testFabricScopedTlvTest2() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterTestFabricScoped( 1U, @@ -342,7 +432,17 @@ class ChipClusterStructTest { @Test fun testFabricScopedTlvTest3() { val simpleStruct = - UnitTestingClusterSimpleStruct(1U, true, 2U, byteArrayOf(0x00, 0x01), "test", 3U, 4.5f, 6.7) + UnitTestingClusterSimpleStruct( + 1U, + true, + 2U, + byteArrayOf(0x00, 0x01), + "test", + 3U, + 4.5f, + 6.7, + Optional.empty() + ) val struct = UnitTestingClusterTestFabricScoped( 1U, diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 33c041e5bbe85f..81e24a4bc9dcd7 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -46578,6 +46578,25 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_nullableStruct_hClassName.c_str(), newElement_0_nullableStruct_hCtorSignature.c_str(), jninewElement_0_nullableStruct_h, newElement_0_nullableStruct_h); + jobject newElement_0_nullableStruct_i; + if (!entry_0.nullableStruct.Value().i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_nullableStruct_i); + } + else + { + jobject newElement_0_nullableStruct_iInsideOptional; + std::string newElement_0_nullableStruct_iInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_nullableStruct_iInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_nullableStruct_iInsideOptional = + static_cast(entry_0.nullableStruct.Value().i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_nullableStruct_iInsideOptionalClassName.c_str(), + newElement_0_nullableStruct_iInsideOptionalCtorSignature.c_str(), + jninewElement_0_nullableStruct_iInsideOptional, newElement_0_nullableStruct_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableStruct_iInsideOptional, + newElement_0_nullableStruct_i); + } jclass simpleStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -46592,7 +46611,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_3, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Float;Ljava/lang/Double;)V", + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_3); if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) { @@ -46604,7 +46623,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_nullableStruct_a, newElement_0_nullableStruct_b, newElement_0_nullableStruct_c, newElement_0_nullableStruct_d, newElement_0_nullableStruct_e, newElement_0_nullableStruct_f, newElement_0_nullableStruct_g, - newElement_0_nullableStruct_h); + newElement_0_nullableStruct_h, newElement_0_nullableStruct_i); } jobject newElement_0_optionalStruct; if (!entry_0.optionalStruct.HasValue()) @@ -46673,6 +46692,26 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_optionalStructInsideOptional_hClassName.c_str(), newElement_0_optionalStructInsideOptional_hCtorSignature.c_str(), jninewElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_h); + jobject newElement_0_optionalStructInsideOptional_i; + if (!entry_0.optionalStruct.Value().i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_optionalStructInsideOptional_i); + } + else + { + jobject newElement_0_optionalStructInsideOptional_iInsideOptional; + std::string newElement_0_optionalStructInsideOptional_iInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_optionalStructInsideOptional_iInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_optionalStructInsideOptional_iInsideOptional = + static_cast(entry_0.optionalStruct.Value().i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_optionalStructInsideOptional_iInsideOptionalClassName.c_str(), + newElement_0_optionalStructInsideOptional_iInsideOptionalCtorSignature.c_str(), + jninewElement_0_optionalStructInsideOptional_iInsideOptional, + newElement_0_optionalStructInsideOptional_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStructInsideOptional_iInsideOptional, + newElement_0_optionalStructInsideOptional_i); + } jclass simpleStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -46687,7 +46726,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_3, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/" - "lang/Float;Ljava/lang/Double;)V", + "lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_3); if (err != CHIP_NO_ERROR || simpleStructStructCtor_3 == nullptr) { @@ -46695,12 +46734,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } - newElement_0_optionalStructInsideOptional = - env->NewObject(simpleStructStructClass_3, simpleStructStructCtor_3, - newElement_0_optionalStructInsideOptional_a, newElement_0_optionalStructInsideOptional_b, - newElement_0_optionalStructInsideOptional_c, newElement_0_optionalStructInsideOptional_d, - newElement_0_optionalStructInsideOptional_e, newElement_0_optionalStructInsideOptional_f, - newElement_0_optionalStructInsideOptional_g, newElement_0_optionalStructInsideOptional_h); + newElement_0_optionalStructInsideOptional = env->NewObject( + simpleStructStructClass_3, simpleStructStructCtor_3, newElement_0_optionalStructInsideOptional_a, + newElement_0_optionalStructInsideOptional_b, newElement_0_optionalStructInsideOptional_c, + newElement_0_optionalStructInsideOptional_d, newElement_0_optionalStructInsideOptional_e, + newElement_0_optionalStructInsideOptional_f, newElement_0_optionalStructInsideOptional_g, + newElement_0_optionalStructInsideOptional_h, newElement_0_optionalStructInsideOptional_i); chip::JniReferences::GetInstance().CreateOptional(newElement_0_optionalStructInsideOptional, newElement_0_optionalStruct); } @@ -46790,6 +46829,29 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalStructInsideOptional_hCtorSignature.c_str(), jninewElement_0_nullableOptionalStructInsideOptional_h, newElement_0_nullableOptionalStructInsideOptional_h); + jobject newElement_0_nullableOptionalStructInsideOptional_i; + if (!entry_0.nullableOptionalStruct.Value().Value().i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, + newElement_0_nullableOptionalStructInsideOptional_i); + } + else + { + jobject newElement_0_nullableOptionalStructInsideOptional_iInsideOptional; + std::string newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalClassName = + "java/lang/Integer"; + std::string newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_nullableOptionalStructInsideOptional_iInsideOptional = + static_cast(entry_0.nullableOptionalStruct.Value().Value().i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalClassName.c_str(), + newElement_0_nullableOptionalStructInsideOptional_iInsideOptionalCtorSignature.c_str(), + jninewElement_0_nullableOptionalStructInsideOptional_iInsideOptional, + newElement_0_nullableOptionalStructInsideOptional_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional( + newElement_0_nullableOptionalStructInsideOptional_iInsideOptional, + newElement_0_nullableOptionalStructInsideOptional_i); + } jclass simpleStructStructClass_4; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -46804,7 +46866,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_4, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/" - "Integer;Ljava/lang/Float;Ljava/lang/Double;)V", + "Integer;Ljava/lang/Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_4); if (err != CHIP_NO_ERROR || simpleStructStructCtor_4 == nullptr) { @@ -46821,7 +46883,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_nullableOptionalStructInsideOptional_e, newElement_0_nullableOptionalStructInsideOptional_f, newElement_0_nullableOptionalStructInsideOptional_g, - newElement_0_nullableOptionalStructInsideOptional_h); + newElement_0_nullableOptionalStructInsideOptional_h, + newElement_0_nullableOptionalStructInsideOptional_i); } chip::JniReferences::GetInstance().CreateOptional(newElement_0_nullableOptionalStructInsideOptional, newElement_0_nullableOptionalStruct); @@ -47009,6 +47072,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jdouble jnivalue_h = static_cast(cppValue.h); chip::JniReferences::GetInstance().CreateBoxedObject(value_hClassName.c_str(), value_hCtorSignature.c_str(), jnivalue_h, value_h); + jobject value_i; + if (!cppValue.i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_i); + } + else + { + jobject value_iInsideOptional; + std::string value_iInsideOptionalClassName = "java/lang/Integer"; + std::string value_iInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_iInsideOptional = static_cast(cppValue.i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_iInsideOptionalClassName.c_str(), + value_iInsideOptionalCtorSignature.c_str(), + jnivalue_iInsideOptional, value_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i); + } jclass simpleStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -47023,7 +47102,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;)V", + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_0); if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) { @@ -47032,7 +47111,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } value = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_a, value_b, value_c, value_d, value_e, - value_f, value_g, value_h); + value_f, value_g, value_h, value_i); return value; } case Attributes::RangeRestrictedInt8u::Id: { @@ -47272,6 +47351,25 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricSensitiveStruct_hClassName.c_str(), newElement_0_fabricSensitiveStruct_hCtorSignature.c_str(), jninewElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_h); + jobject newElement_0_fabricSensitiveStruct_i; + if (!entry_0.fabricSensitiveStruct.i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_fabricSensitiveStruct_i); + } + else + { + jobject newElement_0_fabricSensitiveStruct_iInsideOptional; + std::string newElement_0_fabricSensitiveStruct_iInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_fabricSensitiveStruct_iInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_fabricSensitiveStruct_iInsideOptional = + static_cast(entry_0.fabricSensitiveStruct.i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_fabricSensitiveStruct_iInsideOptionalClassName.c_str(), + newElement_0_fabricSensitiveStruct_iInsideOptionalCtorSignature.c_str(), + jninewElement_0_fabricSensitiveStruct_iInsideOptional, newElement_0_fabricSensitiveStruct_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_fabricSensitiveStruct_iInsideOptional, + newElement_0_fabricSensitiveStruct_i); + } jclass simpleStructStructClass_2; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -47286,7 +47384,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;)V", + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_2); if (err != CHIP_NO_ERROR || simpleStructStructCtor_2 == nullptr) { @@ -47299,7 +47397,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricSensitiveStruct_b, newElement_0_fabricSensitiveStruct_c, newElement_0_fabricSensitiveStruct_d, newElement_0_fabricSensitiveStruct_e, newElement_0_fabricSensitiveStruct_f, newElement_0_fabricSensitiveStruct_g, - newElement_0_fabricSensitiveStruct_h); + newElement_0_fabricSensitiveStruct_h, newElement_0_fabricSensitiveStruct_i); jobject newElement_0_fabricSensitiveInt8uList; chip::JniReferences::GetInstance().CreateArrayList(newElement_0_fabricSensitiveInt8uList); @@ -47401,6 +47499,93 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jnivalue, value); return value; } + case Attributes::GlobalEnum::Id: { + using TypeInfo = Attributes::GlobalEnum::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::GlobalStruct::Id: { + using TypeInfo = Attributes::GlobalStruct::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.name, value_name)); + jobject value_myBitmap; + if (cppValue.myBitmap.IsNull()) + { + value_myBitmap = nullptr; + } + else + { + std::string value_myBitmapClassName = "java/lang/Long"; + std::string value_myBitmapCtorSignature = "(J)V"; + jlong jnivalue_myBitmap = static_cast(cppValue.myBitmap.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_myBitmapClassName.c_str(), value_myBitmapCtorSignature.c_str(), jnivalue_myBitmap, value_myBitmap); + } + jobject value_myEnum; + if (!cppValue.myEnum.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_myEnum); + } + else + { + jobject value_myEnumInsideOptional; + if (cppValue.myEnum.Value().IsNull()) + { + value_myEnumInsideOptional = nullptr; + } + else + { + std::string value_myEnumInsideOptionalClassName = "java/lang/Integer"; + std::string value_myEnumInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_myEnumInsideOptional = static_cast(cppValue.myEnum.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_myEnumInsideOptionalClassName.c_str(), value_myEnumInsideOptionalCtorSignature.c_str(), + jnivalue_myEnumInsideOptional, value_myEnumInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum); + } + + jclass testGlobalStructStructClass_0; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); + return nullptr; + } + + jmethodID testGlobalStructStructCtor_0; + err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_0, "", + "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", + &testGlobalStructStructCtor_0); + if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); + return nullptr; + } + + value = env->NewObject(testGlobalStructStructClass_0, testGlobalStructStructCtor_0, value_name, value_myBitmap, + value_myEnum); + return value; + } case Attributes::Unsupported::Id: { using TypeInfo = Attributes::Unsupported::TypeInfo; TypeInfo::DecodableType cppValue; @@ -48114,6 +48299,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jdouble jnivalue_h = static_cast(cppValue.Value().h); chip::JniReferences::GetInstance().CreateBoxedObject(value_hClassName.c_str(), value_hCtorSignature.c_str(), jnivalue_h, value_h); + jobject value_i; + if (!cppValue.Value().i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_i); + } + else + { + jobject value_iInsideOptional; + std::string value_iInsideOptionalClassName = "java/lang/Integer"; + std::string value_iInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_iInsideOptional = static_cast(cppValue.Value().i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(value_iInsideOptionalClassName.c_str(), + value_iInsideOptionalCtorSignature.c_str(), + jnivalue_iInsideOptional, value_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_iInsideOptional, value_i); + } jclass simpleStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -48128,7 +48329,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;)V", + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_1); if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) { @@ -48137,7 +48338,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } value = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, value_a, value_b, value_c, value_d, - value_e, value_f, value_g, value_h); + value_e, value_f, value_g, value_h, value_i); } return value; } @@ -48249,6 +48450,107 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } + case Attributes::NullableGlobalEnum::Id: { + using TypeInfo = Attributes::NullableGlobalEnum::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::NullableGlobalStruct::Id: { + using TypeInfo = Attributes::NullableGlobalStruct::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 + { + jobject value_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().name, value_name)); + jobject value_myBitmap; + if (cppValue.Value().myBitmap.IsNull()) + { + value_myBitmap = nullptr; + } + else + { + std::string value_myBitmapClassName = "java/lang/Long"; + std::string value_myBitmapCtorSignature = "(J)V"; + jlong jnivalue_myBitmap = static_cast(cppValue.Value().myBitmap.Value().Raw()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_myBitmapClassName.c_str(), value_myBitmapCtorSignature.c_str(), jnivalue_myBitmap, value_myBitmap); + } + jobject value_myEnum; + if (!cppValue.Value().myEnum.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_myEnum); + } + else + { + jobject value_myEnumInsideOptional; + if (cppValue.Value().myEnum.Value().IsNull()) + { + value_myEnumInsideOptional = nullptr; + } + else + { + std::string value_myEnumInsideOptionalClassName = "java/lang/Integer"; + std::string value_myEnumInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_myEnumInsideOptional = static_cast(cppValue.Value().myEnum.Value().Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_myEnumInsideOptionalClassName.c_str(), value_myEnumInsideOptionalCtorSignature.c_str(), + jnivalue_myEnumInsideOptional, value_myEnumInsideOptional); + } + chip::JniReferences::GetInstance().CreateOptional(value_myEnumInsideOptional, value_myEnum); + } + + jclass testGlobalStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$UnitTestingClusterTestGlobalStruct", testGlobalStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UnitTestingClusterTestGlobalStruct"); + return nullptr; + } + + jmethodID testGlobalStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, testGlobalStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Long;Ljava/util/Optional;)V", + &testGlobalStructStructCtor_1); + if (err != CHIP_NO_ERROR || testGlobalStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UnitTestingClusterTestGlobalStruct constructor"); + return nullptr; + } + + value = env->NewObject(testGlobalStructStructClass_1, testGlobalStructStructCtor_1, value_name, value_myBitmap, + value_myEnum); + } + return value; + } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 7f3c03f9e8ab05..89a4a256880158 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -8260,6 +8260,22 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jdouble jnivalue_arg4_h = static_cast(cppValue.arg4.h); chip::JniReferences::GetInstance().CreateBoxedObject( value_arg4_hClassName.c_str(), value_arg4_hCtorSignature.c_str(), jnivalue_arg4_h, value_arg4_h); + jobject value_arg4_i; + if (!cppValue.arg4.i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_arg4_i); + } + else + { + jobject value_arg4_iInsideOptional; + std::string value_arg4_iInsideOptionalClassName = "java/lang/Integer"; + std::string value_arg4_iInsideOptionalCtorSignature = "(I)V"; + jint jnivalue_arg4_iInsideOptional = static_cast(cppValue.arg4.i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + value_arg4_iInsideOptionalClassName.c_str(), value_arg4_iInsideOptionalCtorSignature.c_str(), + jnivalue_arg4_iInsideOptional, value_arg4_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(value_arg4_iInsideOptional, value_arg4_i); + } jclass simpleStructStructClass_0; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -8274,7 +8290,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;)V", + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_0); if (err != CHIP_NO_ERROR || simpleStructStructCtor_0 == nullptr) { @@ -8282,8 +8298,9 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } - value_arg4 = env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, - value_arg4_c, value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h); + value_arg4 = + env->NewObject(simpleStructStructClass_0, simpleStructStructCtor_0, value_arg4_a, value_arg4_b, value_arg4_c, + value_arg4_d, value_arg4_e, value_arg4_f, value_arg4_g, value_arg4_h, value_arg4_i); jobject value_arg5; chip::JniReferences::GetInstance().CreateArrayList(value_arg5); @@ -8336,6 +8353,22 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jdouble jninewElement_0_h = static_cast(entry_0.h); chip::JniReferences::GetInstance().CreateBoxedObject( newElement_0_hClassName.c_str(), newElement_0_hCtorSignature.c_str(), jninewElement_0_h, newElement_0_h); + jobject newElement_0_i; + if (!entry_0.i.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_i); + } + else + { + jobject newElement_0_iInsideOptional; + std::string newElement_0_iInsideOptionalClassName = "java/lang/Integer"; + std::string newElement_0_iInsideOptionalCtorSignature = "(I)V"; + jint jninewElement_0_iInsideOptional = static_cast(entry_0.i.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_iInsideOptionalClassName.c_str(), newElement_0_iInsideOptionalCtorSignature.c_str(), + jninewElement_0_iInsideOptional, newElement_0_iInsideOptional); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_iInsideOptional, newElement_0_i); + } jclass simpleStructStructClass_1; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -8350,7 +8383,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & err = chip::JniReferences::GetInstance().FindMethod( env, simpleStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Integer;[BLjava/lang/String;Ljava/lang/Integer;Ljava/lang/" - "Float;Ljava/lang/Double;)V", + "Float;Ljava/lang/Double;Ljava/util/Optional;)V", &simpleStructStructCtor_1); if (err != CHIP_NO_ERROR || simpleStructStructCtor_1 == nullptr) { @@ -8358,9 +8391,9 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & return nullptr; } - newElement_0 = - env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b, - newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g, newElement_0_h); + newElement_0 = env->NewObject(simpleStructStructClass_1, simpleStructStructCtor_1, newElement_0_a, newElement_0_b, + newElement_0_c, newElement_0_d, newElement_0_e, newElement_0_f, newElement_0_g, + newElement_0_h, newElement_0_i); chip::JniReferences::GetInstance().AddToList(value_arg5, newElement_0); } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 588c3da4f020eb..cc0b5aaa65a4b2 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -14491,6 +14491,14 @@ class ChipClusters: "payload": "bytes", }, }, + 0x00000019: { + "commandId": 0x00000019, + "commandName": "GlobalEchoRequest", + "args": { + "field1": "TestGlobalStruct", + "field2": "int", + }, + }, 0xFFF200AA: { "commandId": 0xFFF200AA, "commandName": "TestDifferentVendorMeiRequest", @@ -14829,6 +14837,20 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x00000033: { + "attributeName": "GlobalEnum", + "attributeId": 0x00000033, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000034: { + "attributeName": "GlobalStruct", + "attributeId": 0x00000034, + "type": "", + "reportable": True, + "writable": True, + }, 0x000000FF: { "attributeName": "Unsupported", "attributeId": 0x000000FF, @@ -15074,6 +15096,20 @@ class ChipClusters: "reportable": True, "writable": True, }, + 0x00004033: { + "attributeName": "NullableGlobalEnum", + "attributeId": 0x00004033, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00004034: { + "attributeName": "NullableGlobalStruct", + "attributeId": 0x00004034, + "type": "", + "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 b84ad31879c1d5..3795b08dd230e3 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -50101,6 +50101,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="timedWriteBoolean", Tag=0x00000030, Type=bool), ClusterObjectFieldDescriptor(Label="generalErrorBoolean", Tag=0x00000031, Type=bool), ClusterObjectFieldDescriptor(Label="clusterErrorBoolean", Tag=0x00000032, Type=bool), + ClusterObjectFieldDescriptor(Label="globalEnum", Tag=0x00000033, Type=Globals.Enums.TestGlobalEnum), + ClusterObjectFieldDescriptor(Label="globalStruct", Tag=0x00000034, Type=Globals.Structs.TestGlobalStruct), ClusterObjectFieldDescriptor(Label="unsupported", Tag=0x000000FF, Type=typing.Optional[bool]), ClusterObjectFieldDescriptor(Label="nullableBoolean", Tag=0x00004000, Type=typing.Union[Nullable, bool]), ClusterObjectFieldDescriptor(Label="nullableBitmap8", Tag=0x00004001, Type=typing.Union[Nullable, uint]), @@ -50136,6 +50138,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="nullableRangeRestrictedInt16u", Tag=0x00004028, Type=typing.Union[Nullable, uint]), ClusterObjectFieldDescriptor(Label="nullableRangeRestrictedInt16s", Tag=0x00004029, Type=typing.Union[Nullable, int]), ClusterObjectFieldDescriptor(Label="writeOnlyInt8u", Tag=0x0000402A, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="nullableGlobalEnum", Tag=0x00004033, Type=typing.Union[Nullable, Globals.Enums.TestGlobalEnum]), + ClusterObjectFieldDescriptor(Label="nullableGlobalStruct", Tag=0x00004034, Type=typing.Union[Nullable, Globals.Structs.TestGlobalStruct]), 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]), @@ -50192,6 +50196,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: timedWriteBoolean: 'bool' = None generalErrorBoolean: 'bool' = None clusterErrorBoolean: 'bool' = None + globalEnum: 'Globals.Enums.TestGlobalEnum' = None + globalStruct: 'Globals.Structs.TestGlobalStruct' = None unsupported: 'typing.Optional[bool]' = None nullableBoolean: 'typing.Union[Nullable, bool]' = None nullableBitmap8: 'typing.Union[Nullable, uint]' = None @@ -50227,6 +50233,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: nullableRangeRestrictedInt16u: 'typing.Union[Nullable, uint]' = None nullableRangeRestrictedInt16s: 'typing.Union[Nullable, int]' = None writeOnlyInt8u: 'typing.Optional[uint]' = None + nullableGlobalEnum: 'typing.Union[Nullable, Globals.Enums.TestGlobalEnum]' = None + nullableGlobalStruct: 'typing.Union[Nullable, Globals.Structs.TestGlobalStruct]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -50292,6 +50300,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="f", Tag=5, Type=uint), ClusterObjectFieldDescriptor(Label="g", Tag=6, Type=float32), ClusterObjectFieldDescriptor(Label="h", Tag=7, Type=float), + ClusterObjectFieldDescriptor(Label="i", Tag=8, Type=typing.Optional[Globals.Enums.TestGlobalEnum]), ]) a: 'uint' = 0 @@ -50302,6 +50311,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: f: 'uint' = 0 g: 'float32' = 0.0 h: 'float' = 0.0 + i: 'typing.Optional[Globals.Enums.TestGlobalEnum]' = None @dataclass class TestFabricScoped(ClusterObject): @@ -50370,11 +50380,13 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="a", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="b", Tag=1, Type=bool), ClusterObjectFieldDescriptor(Label="c", Tag=2, Type=UnitTesting.Structs.SimpleStruct), + ClusterObjectFieldDescriptor(Label="d", Tag=3, Type=typing.Optional[Globals.Structs.TestGlobalStruct]), ]) a: 'uint' = 0 b: 'bool' = False c: 'UnitTesting.Structs.SimpleStruct' = field(default_factory=lambda: UnitTesting.Structs.SimpleStruct()) + d: 'typing.Optional[Globals.Structs.TestGlobalStruct]' = None @dataclass class NestedStructList(ClusterObject): @@ -50962,6 +50974,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: arg1: 'uint' = 0 arg2: 'UnitTesting.Enums.SimpleEnum' = 0 + @dataclass + class GlobalEchoResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0xFFF1FC05 + command_id: typing.ClassVar[int] = 0x0000000E + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="field1", Tag=0, Type=Globals.Structs.TestGlobalStruct), + ClusterObjectFieldDescriptor(Label="field2", Tag=1, Type=Globals.Enums.TestGlobalEnum), + ]) + + field1: 'Globals.Structs.TestGlobalStruct' = field(default_factory=lambda: UnitTesting.Structs.TestGlobalStruct()) + field2: 'Globals.Enums.TestGlobalEnum' = 0 + @dataclass class TestNullableOptionalRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0xFFF1FC05 @@ -51157,6 +51187,24 @@ def descriptor(cls) -> ClusterObjectDescriptor: payload: 'bytes' = b"" + @dataclass + class GlobalEchoRequest(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0xFFF1FC05 + command_id: typing.ClassVar[int] = 0x00000019 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'GlobalEchoResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="field1", Tag=0, Type=Globals.Structs.TestGlobalStruct), + ClusterObjectFieldDescriptor(Label="field2", Tag=1, Type=Globals.Enums.TestGlobalEnum), + ]) + + field1: 'Globals.Structs.TestGlobalStruct' = field(default_factory=lambda: UnitTesting.Structs.TestGlobalStruct()) + field2: 'Globals.Enums.TestGlobalEnum' = 0 + @dataclass class TestDifferentVendorMeiRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0xFFF1FC05 @@ -51948,6 +51996,38 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'bool' = False + @dataclass + class GlobalEnum(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC05 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000033 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=Globals.Enums.TestGlobalEnum) + + value: 'Globals.Enums.TestGlobalEnum' = 0 + + @dataclass + class GlobalStruct(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC05 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000034 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=Globals.Structs.TestGlobalStruct) + + value: 'Globals.Structs.TestGlobalStruct' = field(default_factory=lambda: UnitTesting.Structs.TestGlobalStruct()) + @dataclass class Unsupported(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -52508,6 +52588,38 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[uint]' = None + @dataclass + class NullableGlobalEnum(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC05 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00004033 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, Globals.Enums.TestGlobalEnum]) + + value: 'typing.Union[Nullable, Globals.Enums.TestGlobalEnum]' = NullValue + + @dataclass + class NullableGlobalStruct(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC05 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00004034 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[Nullable, Globals.Structs.TestGlobalStruct]) + + value: 'typing.Union[Nullable, Globals.Structs.TestGlobalStruct]' = NullValue + @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @ChipUtility.classproperty diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index aed4d52a4c4b3c..ee6351b3c6793e 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -9695,29 +9695,38 @@ - WaterHeaterMode - WiFiNetworkManagement attributes: - OccupancySensing: - # Targeting 1.4 - - HoldTime - - HoldTimeLimits GeneralCommissioning: # Targeting 1.4 - TCAcceptedVersion - TCMinRequiredVersion - TCAcknowledgements - TCAcknowledgementsRequired + OccupancySensing: + # Targeting 1.4 + - HoldTime + - HoldTimeLimits + UnitTesting: + # Ideally none of UnitTesting would be exposed as public API, but + # for now just start doing that for new additions to it. + - GlobalEnum + - GlobalStruct + - NullableGlobalEnum + - NullableGlobalStruct commands: BridgedDeviceBasicInformation: # Targeting 1.4 - KeepActive + GeneralCommissioning: + # Targeting 1.4 + - SetTCAcknowledgements + - SetTCAcknowledgementsResponse UnitTesting: # Ideally none of UnitTesting would be exposed as public API, but # for now just start doing that for new additions to it. + - GlobalEchoRequest + - GlobalEchoResponse - StringEchoRequest - StringEchoResponse - GeneralCommissioning: - # Targeting 1.4 - - SetTCAcknowledgements - - SetTCAcknowledgementsResponse structs: Globals: # Test-only value @@ -9725,6 +9734,14 @@ OccupancySensing: # Targeting 1.4 - HoldTimeLimitsStruct + struct fields: + UnitTesting: + # Ideally none of UnitTesting would be exposed as public API, but + # for now just start doing that for new additions to it. + SimpleStruct: + - i + NestedStruct: + - d events: BridgedDeviceBasicInformation: # Targeting 1.4 @@ -9744,10 +9761,10 @@ BridgedDeviceBasicInformation: # Targeting 1.4 - Feature - OccupancySensing: + GeneralCommissioning: # Targeting 1.4 - Feature - GeneralCommissioning: + OccupancySensing: # Targeting 1.4 - Feature bitmap values: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index d214e061ec9f65..d0ea9a364af749 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -6678,6 +6678,12 @@ static BOOL AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) case Attributes::ClusterErrorBoolean::Id: { return YES; } + case Attributes::GlobalEnum::Id: { + return YES; + } + case Attributes::GlobalStruct::Id: { + return YES; + } case Attributes::Unsupported::Id: { return YES; } @@ -6783,6 +6789,12 @@ static BOOL AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) case Attributes::WriteOnlyInt8u::Id: { return YES; } + case Attributes::NullableGlobalEnum::Id: { + return YES; + } + case Attributes::NullableGlobalStruct::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 7920a04dc597b1..c6d743173044cd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -19333,6 +19333,11 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri newElement_0.nullableStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().f.Raw()]; newElement_0.nullableStruct.g = [NSNumber numberWithFloat:entry_0.nullableStruct.Value().g]; newElement_0.nullableStruct.h = [NSNumber numberWithDouble:entry_0.nullableStruct.Value().h]; + if (entry_0.nullableStruct.Value().i.HasValue()) { + newElement_0.nullableStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableStruct.Value().i.Value())]; + } else { + newElement_0.nullableStruct.i = nil; + } } if (entry_0.optionalStruct.HasValue()) { newElement_0.optionalStruct = [MTRUnitTestingClusterSimpleStruct new]; @@ -19349,6 +19354,11 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri newElement_0.optionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().f.Raw()]; newElement_0.optionalStruct.g = [NSNumber numberWithFloat:entry_0.optionalStruct.Value().g]; newElement_0.optionalStruct.h = [NSNumber numberWithDouble:entry_0.optionalStruct.Value().h]; + if (entry_0.optionalStruct.Value().i.HasValue()) { + newElement_0.optionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.optionalStruct.Value().i.Value())]; + } else { + newElement_0.optionalStruct.i = nil; + } } else { newElement_0.optionalStruct = nil; } @@ -19370,6 +19380,11 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri newElement_0.nullableOptionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().f.Raw()]; newElement_0.nullableOptionalStruct.g = [NSNumber numberWithFloat:entry_0.nullableOptionalStruct.Value().Value().g]; newElement_0.nullableOptionalStruct.h = [NSNumber numberWithDouble:entry_0.nullableOptionalStruct.Value().Value().h]; + if (entry_0.nullableOptionalStruct.Value().Value().i.HasValue()) { + newElement_0.nullableOptionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableOptionalStruct.Value().Value().i.Value())]; + } else { + newElement_0.nullableOptionalStruct.i = nil; + } } } else { newElement_0.nullableOptionalStruct = nil; @@ -19482,6 +19497,11 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri value.f = [NSNumber numberWithUnsignedChar:cppValue.f.Raw()]; value.g = [NSNumber numberWithFloat:cppValue.g]; value.h = [NSNumber numberWithDouble:cppValue.h]; + if (cppValue.i.HasValue()) { + value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.i.Value())]; + } else { + value.i = nil; + } return value; } case Attributes::RangeRestrictedInt8u::Id: { @@ -19609,6 +19629,11 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri newElement_0.fabricSensitiveStruct.f = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.f.Raw()]; newElement_0.fabricSensitiveStruct.g = [NSNumber numberWithFloat:entry_0.fabricSensitiveStruct.g]; newElement_0.fabricSensitiveStruct.h = [NSNumber numberWithDouble:entry_0.fabricSensitiveStruct.h]; + if (entry_0.fabricSensitiveStruct.i.HasValue()) { + newElement_0.fabricSensitiveStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.fabricSensitiveStruct.i.Value())]; + } else { + newElement_0.fabricSensitiveStruct.i = nil; + } { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.fabricSensitiveInt8uList.begin(); @@ -19670,6 +19695,48 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri value = [NSNumber numberWithBool:cppValue]; return value; } + case Attributes::GlobalEnum::Id: { + using TypeInfo = Attributes::GlobalEnum::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::GlobalStruct::Id: { + using TypeInfo = Attributes::GlobalStruct::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRDataTypeTestGlobalStruct * _Nonnull value; + value = [MTRDataTypeTestGlobalStruct new]; + value.name = AsString(cppValue.name); + if (value.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.myBitmap.IsNull()) { + value.myBitmap = nil; + } else { + value.myBitmap = [NSNumber numberWithUnsignedInt:cppValue.myBitmap.Value().Raw()]; + } + if (cppValue.myEnum.HasValue()) { + if (cppValue.myEnum.Value().IsNull()) { + value.myEnum = nil; + } else { + value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.myEnum.Value().Value())]; + } + } else { + value.myEnum = nil; + } + return value; + } case Attributes::Unsupported::Id: { using TypeInfo = Attributes::Unsupported::TypeInfo; TypeInfo::DecodableType cppValue; @@ -20131,6 +20198,11 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri value.f = [NSNumber numberWithUnsignedChar:cppValue.Value().f.Raw()]; value.g = [NSNumber numberWithFloat:cppValue.Value().g]; value.h = [NSNumber numberWithDouble:cppValue.Value().h]; + if (cppValue.Value().i.HasValue()) { + value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().i.Value())]; + } else { + value.i = nil; + } } return value; } @@ -20205,6 +20277,56 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster(AttributeId aAttri value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } + case Attributes::NullableGlobalEnum::Id: { + using TypeInfo = Attributes::NullableGlobalEnum::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:chip::to_underlying(cppValue.Value())]; + } + return value; + } + case Attributes::NullableGlobalStruct::Id: { + using TypeInfo = Attributes::NullableGlobalStruct::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRDataTypeTestGlobalStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRDataTypeTestGlobalStruct new]; + value.name = AsString(cppValue.Value().name); + if (value.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.Value().myBitmap.IsNull()) { + value.myBitmap = nil; + } else { + value.myBitmap = [NSNumber numberWithUnsignedInt:cppValue.Value().myBitmap.Value().Raw()]; + } + if (cppValue.Value().myEnum.HasValue()) { + if (cppValue.Value().myEnum.Value().IsNull()) { + value.myEnum = nil; + } else { + value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().myEnum.Value().Value())]; + } + } else { + value.myEnum = nil; + } + } + return value; + } case Attributes::MeiInt8u::Id: { using TypeInfo = Attributes::MeiInt8u::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index bdd3bcf1f78a2f..0f17934d1ee74f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -16339,6 +16339,13 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) supports large payloads. */ - (void)stringEchoRequestWithParams:(MTRUnitTestingClusterStringEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterStringEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command GlobalEchoRequest + * + * Command that takes arguments that are global structs/enums and the + response just echoes them back. + */ +- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; /** * Command TestDifferentVendorMeiRequest * @@ -16722,6 +16729,22 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributeClusterErrorBooleanWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)readAttributeGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGlobalEnumWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGlobalStructWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeUnsupportedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -17002,6 +17025,22 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributeWriteOnlyInt8uWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)readAttributeNullableGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNullableGlobalEnumWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNullableGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeNullableGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeNullableGlobalStructWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeNullableGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index e2bb0e376dffe1..3ca3bfe55708dd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -116509,6 +116509,30 @@ - (void)stringEchoRequestWithParams:(MTRUnitTestingClusterStringEchoRequestParam queue:self.callbackQueue completion:responseHandler]; } +- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRUnitTestingClusterGlobalEchoRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::GlobalEchoRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterGlobalEchoResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} - (void)testDifferentVendorMeiRequestWithParams:(MTRUnitTestingClusterTestDifferentVendorMeiRequestParams *)params completion:(void (^)(MTRUnitTestingClusterTestDifferentVendorMeiResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { @@ -118935,6 +118959,10 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu nonNullValue_2.f = static_cast>(element_0.nullableStruct.f.unsignedCharValue); nonNullValue_2.g = element_0.nullableStruct.g.floatValue; nonNullValue_2.h = element_0.nullableStruct.h.doubleValue; + if (element_0.nullableStruct.i != nil) { + auto & definedValue_4 = nonNullValue_2.i.Emplace(); + definedValue_4 = static_cast>(element_0.nullableStruct.i.unsignedCharValue); + } } if (element_0.optionalStruct != nil) { auto & definedValue_2 = listHolder_0->mList[i_0].optionalStruct.Emplace(); @@ -118946,6 +118974,10 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu definedValue_2.f = static_cast>(element_0.optionalStruct.f.unsignedCharValue); definedValue_2.g = element_0.optionalStruct.g.floatValue; definedValue_2.h = element_0.optionalStruct.h.doubleValue; + if (element_0.optionalStruct.i != nil) { + auto & definedValue_4 = definedValue_2.i.Emplace(); + definedValue_4 = static_cast>(element_0.optionalStruct.i.unsignedCharValue); + } } if (element_0.nullableOptionalStruct != nil) { auto & definedValue_2 = listHolder_0->mList[i_0].nullableOptionalStruct.Emplace(); @@ -118961,6 +118993,10 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu nonNullValue_3.f = static_cast>(element_0.nullableOptionalStruct.f.unsignedCharValue); nonNullValue_3.g = element_0.nullableOptionalStruct.g.floatValue; nonNullValue_3.h = element_0.nullableOptionalStruct.h.doubleValue; + if (element_0.nullableOptionalStruct.i != nil) { + auto & definedValue_5 = nonNullValue_3.i.Emplace(); + definedValue_5 = static_cast>(element_0.nullableOptionalStruct.i.unsignedCharValue); + } } } if (element_0.nullableList == nil) { @@ -119186,6 +119222,10 @@ - (void)writeAttributeStructAttrWithValue:(MTRUnitTestingClusterSimpleStruct * _ cppValue.f = static_cast>(value.f.unsignedCharValue); cppValue.g = value.g.floatValue; cppValue.h = value.h.doubleValue; + if (value.i != nil) { + auto & definedValue_1 = cppValue.i.Emplace(); + definedValue_1 = static_cast>(value.i.unsignedCharValue); + } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -119634,6 +119674,10 @@ - (void)writeAttributeListFabricScopedWithValue:(NSArray * _Nonnull)value params listHolder_0->mList[i_0].fabricSensitiveStruct.f = static_castmList[i_0].fabricSensitiveStruct.f)>>(element_0.fabricSensitiveStruct.f.unsignedCharValue); listHolder_0->mList[i_0].fabricSensitiveStruct.g = element_0.fabricSensitiveStruct.g.floatValue; listHolder_0->mList[i_0].fabricSensitiveStruct.h = element_0.fabricSensitiveStruct.h.doubleValue; + if (element_0.fabricSensitiveStruct.i != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].fabricSensitiveStruct.i.Emplace(); + definedValue_3 = static_cast>(element_0.fabricSensitiveStruct.i.unsignedCharValue); + } { using ListType_2 = std::remove_reference_tmList[i_0].fabricSensitiveInt8uList)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -119889,6 +119933,149 @@ + (void)readAttributeClusterErrorBooleanWithClusterStateCache:(MTRClusterStateCa completion:completion]; } +- (void)readAttributeGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeGlobalEnumWithValue:(NSNumber * _Nonnull)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 = UnitTesting::Attributes::GlobalEnum::TypeInfo; + TypeInfo::Type cppValue; + cppValue = static_cast>(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)subscribeAttributeGlobalEnumWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::GlobalEnum::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nonnull)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 = UnitTesting::Attributes::GlobalStruct::TypeInfo; + TypeInfo::Type cppValue; + cppValue.name = AsCharSpan(value.name); + if (value.myBitmap == nil) { + cppValue.myBitmap.SetNull(); + } else { + auto & nonNullValue_1 = cppValue.myBitmap.SetNonNull(); + nonNullValue_1 = static_cast>(value.myBitmap.unsignedIntValue); + } + if (value.myEnum != nil) { + auto & definedValue_1 = cppValue.myEnum.Emplace(); + if (value.myEnum == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = static_cast>(value.myEnum.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)subscribeAttributeGlobalStructWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::GlobalStruct::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeUnsupportedWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = UnitTesting::Attributes::Unsupported::TypeInfo; @@ -121929,6 +122116,10 @@ - (void)writeAttributeNullableStructWithValue:(MTRUnitTestingClusterSimpleStruct nonNullValue_0.f = static_cast>(value.f.unsignedCharValue); nonNullValue_0.g = value.g.floatValue; nonNullValue_0.h = value.h.doubleValue; + if (value.i != nil) { + auto & definedValue_2 = nonNullValue_0.i.Emplace(); + definedValue_2 = static_cast>(value.i.unsignedCharValue); + } } chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); @@ -122301,6 +122492,159 @@ + (void)readAttributeWriteOnlyInt8uWithClusterStateCache:(MTRClusterStateCacheCo completion:completion]; } +- (void)readAttributeNullableGlobalEnumWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNullableGlobalEnumWithValue:(NSNumber * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeNullableGlobalEnumWithValue:(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 = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0 = static_cast>(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)subscribeAttributeNullableGlobalEnumWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNullableGlobalEnumWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalEnum::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeNullableGlobalStructWithCompletion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeNullableGlobalStructWithValue:(MTRDataTypeTestGlobalStruct * _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 = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0.name = AsCharSpan(value.name); + if (value.myBitmap == nil) { + nonNullValue_0.myBitmap.SetNull(); + } else { + auto & nonNullValue_2 = nonNullValue_0.myBitmap.SetNonNull(); + nonNullValue_2 = static_cast>(value.myBitmap.unsignedIntValue); + } + if (value.myEnum != nil) { + auto & definedValue_2 = nonNullValue_0.myEnum.Emplace(); + if (value.myEnum == nil) { + definedValue_2.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_2.SetNonNull(); + nonNullValue_3 = static_cast>(value.myEnum.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)subscribeAttributeNullableGlobalStructWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeNullableGlobalStructWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = UnitTesting::Attributes::NullableGlobalStruct::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 = UnitTesting::Attributes::GeneratedCommandList::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 98ca2f96263d50..f920a8e336cd92 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -5764,6 +5764,8 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterUnitTestingAttributeTimedWriteBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000030, MTRAttributeIDTypeClusterUnitTestingAttributeGeneralErrorBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000031, MTRAttributeIDTypeClusterUnitTestingAttributeClusterErrorBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000032, + MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID MTR_PROVISIONALLY_AVAILABLE = 0x00000033, + MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID MTR_PROVISIONALLY_AVAILABLE = 0x00000034, MTRAttributeIDTypeClusterUnitTestingAttributeUnsupportedID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x000000FF, MTRAttributeIDTypeClusterUnitTestingAttributeNullableBooleanID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004000, MTRAttributeIDTypeClusterUnitTestingAttributeNullableBitmap8ID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004001, @@ -5799,6 +5801,8 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterUnitTestingAttributeNullableRangeRestrictedInt16uID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004028, MTRAttributeIDTypeClusterUnitTestingAttributeNullableRangeRestrictedInt16sID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00004029, MTRAttributeIDTypeClusterUnitTestingAttributeWriteOnlyInt8uID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000402A, + MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID MTR_PROVISIONALLY_AVAILABLE = 0x00004033, + MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID MTR_PROVISIONALLY_AVAILABLE = 0x00004034, MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterUnitTestingAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterUnitTestingAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -7102,6 +7106,7 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterUnitTestingCommandTestListInt8UReverseRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000D, MTRCommandIDTypeClusterUnitTestingCommandStringEchoResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000D, MTRCommandIDTypeClusterUnitTestingCommandTestEnumsRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000E, + MTRCommandIDTypeClusterUnitTestingCommandGlobalEchoResponseID MTR_PROVISIONALLY_AVAILABLE = 0x0000000E, MTRCommandIDTypeClusterUnitTestingCommandTestNullableOptionalRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000000F, MTRCommandIDTypeClusterUnitTestingCommandTestComplexNullableOptionalRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000010, MTRCommandIDTypeClusterUnitTestingCommandSimpleStructEchoRequestID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000011, @@ -7112,6 +7117,7 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterUnitTestingCommandTestBatchHelperRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000016, MTRCommandIDTypeClusterUnitTestingCommandTestSecondBatchHelperRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000017, MTRCommandIDTypeClusterUnitTestingCommandStringEchoRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000018, + MTRCommandIDTypeClusterUnitTestingCommandGlobalEchoRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000019, MTRCommandIDTypeClusterUnitTestingCommandTestDifferentVendorMeiRequestID MTR_PROVISIONALLY_AVAILABLE = 0xFFF200AA, MTRCommandIDTypeClusterUnitTestingCommandTestDifferentVendorMeiResponseID MTR_PROVISIONALLY_AVAILABLE = 0xFFF200BB, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 5f9d1b8e510ed6..6191e7c60d53eb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -9163,6 +9163,14 @@ result = @"ClusterErrorBoolean"; break; + case MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID: + result = @"GlobalEnum"; + break; + + case MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID: + result = @"GlobalStruct"; + break; + case MTRAttributeIDTypeClusterUnitTestingAttributeUnsupportedID: result = @"Unsupported"; break; @@ -9303,6 +9311,14 @@ result = @"WriteOnlyInt8u"; break; + case MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID: + result = @"NullableGlobalEnum"; + break; + + case MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID: + result = @"NullableGlobalStruct"; + break; + case MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID: result = @"GeneratedCommandList"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 8da2b1f2ec4f2b..44ecc1e0119c46 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -7455,6 +7455,7 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (void)testBatchHelperRequestWithParams:(MTRUnitTestingClusterTestBatchHelperRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)testSecondBatchHelperRequestWithParams:(MTRUnitTestingClusterTestSecondBatchHelperRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestBatchHelperResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)stringEchoRequestWithParams:(MTRUnitTestingClusterStringEchoRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterStringEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)testDifferentVendorMeiRequestWithParams:(MTRUnitTestingClusterTestDifferentVendorMeiRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestDifferentVendorMeiResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeBooleanWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -7645,6 +7646,14 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (NSDictionary * _Nullable)readAttributeGlobalEnumWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGlobalStructWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeUnsupportedWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeUnsupportedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeUnsupportedWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -7785,6 +7794,14 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (void)writeAttributeWriteOnlyInt8uWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)writeAttributeWriteOnlyInt8uWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (NSDictionary * _Nullable)readAttributeNullableGlobalEnumWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeNullableGlobalStructWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index ec6f0c49b74d73..8e06c4d288084f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -21757,6 +21757,33 @@ - (void)stringEchoRequestWithParams:(MTRUnitTestingClusterStringEchoRequestParam completion:responseHandler]; } +- (void)globalEchoRequestWithParams:(MTRUnitTestingClusterGlobalEchoRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable data, NSError * _Nullable error))completion +{ + if (params == nil) { + params = [[MTRUnitTestingClusterGlobalEchoRequestParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(response, error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = UnitTesting::Commands::GlobalEchoRequest::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:MTRUnitTestingClusterGlobalEchoResponseParams.class + queue:self.callbackQueue + completion:responseHandler]; +} + - (void)testDifferentVendorMeiRequestWithParams:(MTRUnitTestingClusterTestDifferentVendorMeiRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRUnitTestingClusterTestDifferentVendorMeiResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { @@ -22539,6 +22566,38 @@ - (void)writeAttributeClusterErrorBooleanWithValue:(NSDictionary [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeClusterErrorBooleanID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } +- (NSDictionary * _Nullable)readAttributeGlobalEnumWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID) params:params]; +} + +- (void)writeAttributeGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeGlobalEnumWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalEnumID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeGlobalStructWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID) params:params]; +} + +- (void)writeAttributeGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeGlobalStructWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGlobalStructID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + - (NSDictionary * _Nullable)readAttributeUnsupportedWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeUnsupportedID) params:params]; @@ -23099,6 +23158,38 @@ - (void)writeAttributeWriteOnlyInt8uWithValue:(NSDictionary *)da [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeWriteOnlyInt8uID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } +- (NSDictionary * _Nullable)readAttributeNullableGlobalEnumWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID) params:params]; +} + +- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableGlobalEnumWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableGlobalEnumWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalEnumID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeNullableGlobalStructWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID) params:params]; +} + +- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeNullableGlobalStructWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeNullableGlobalStructWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeNullableGlobalStructID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeUnitTestingID) attributeID:@(MTRAttributeIDTypeClusterUnitTestingAttributeGeneratedCommandListID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 54073ac579e846..62f200fe8623f7 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -12925,6 +12925,27 @@ MTR_DEPRECATED("Please use MTRUnitTestingClusterTestEnumsRequestParams", ios(16. @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRUnitTestingClusterGlobalEchoResponseParams : NSObject + +@property (nonatomic, copy) MTRDataTypeTestGlobalStruct * _Nonnull field1 MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull field2 MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRUnitTestingClusterGlobalEchoResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRUnitTestingClusterTestNullableOptionalRequestParams : NSObject @@ -13491,6 +13512,38 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRUnitTestingClusterGlobalEchoRequestParams : NSObject + +@property (nonatomic, copy) MTRDataTypeTestGlobalStruct * _Nonnull field1 MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull field2 MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRUnitTestingClusterTestDifferentVendorMeiRequestParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index c49195ce1016eb..6b10028ec18d78 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -32884,6 +32884,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + if (entry_0.c.i.HasValue()) { + newElement_0.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.i.Value())]; + } else { + newElement_0.c.i = nil; + } { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; auto iter_2 = entry_0.d.begin(); @@ -32903,6 +32908,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + if (entry_2.i.HasValue()) { + newElement_2.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.i.Value())]; + } else { + newElement_2.i = nil; + } [array_2 addObject:newElement_2]; } CHIP_ERROR err = iter_2.GetStatus(); @@ -32985,6 +32995,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + if (entry_0.i.HasValue()) { + newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())]; + } else { + newElement_0.i = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -33497,6 +33512,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_0->mList[i_0].c.f = static_castmList[i_0].c.f)>>(element_0.c.f.unsignedCharValue); listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue; listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue; + if (element_0.c.i != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace(); + definedValue_3 = static_cast>(element_0.c.i.unsignedCharValue); + } { using ListType_2 = std::remove_reference_tmList[i_0].d)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -33520,6 +33539,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_2->mList[i_2].f = static_castmList[i_2].f)>>(element_2.f.unsignedCharValue); listHolder_2->mList[i_2].g = element_2.g.floatValue; listHolder_2->mList[i_2].h = element_2.h.doubleValue; + if (element_2.i != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace(); + definedValue_4 = static_cast>(element_2.i.unsignedCharValue); + } } listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); } else { @@ -33623,6 +33646,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_0->mList[i_0].f = static_castmList[i_0].f)>>(element_0.f.unsignedCharValue); listHolder_0->mList[i_0].g = element_0.g.floatValue; listHolder_0->mList[i_0].h = element_0.h.doubleValue; + if (element_0.i != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace(); + definedValue_2 = static_cast>(element_0.i.unsignedCharValue); + } } encodableStruct.arg2 = ListType_0(listHolder_0->mList, self.arg2.count); } else { @@ -33903,6 +33930,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.arg1.f = static_cast>(self.arg1.f.unsignedCharValue); encodableStruct.arg1.g = self.arg1.g.floatValue; encodableStruct.arg1.h = self.arg1.h.doubleValue; + if (self.arg1.i != nil) { + auto & definedValue_1 = encodableStruct.arg1.i.Emplace(); + definedValue_1 = static_cast>(self.arg1.i.unsignedCharValue); + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -34207,6 +34238,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest self.nullableStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.nullableStructValue.Value().f.Raw()]; self.nullableStructValue.g = [NSNumber numberWithFloat:decodableStruct.nullableStructValue.Value().g]; self.nullableStructValue.h = [NSNumber numberWithDouble:decodableStruct.nullableStructValue.Value().h]; + if (decodableStruct.nullableStructValue.Value().i.HasValue()) { + self.nullableStructValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.nullableStructValue.Value().i.Value())]; + } else { + self.nullableStructValue.i = nil; + } } else { self.nullableStructValue = nil; } @@ -34229,6 +34265,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest self.optionalStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.optionalStructValue.Value().f.Raw()]; self.optionalStructValue.g = [NSNumber numberWithFloat:decodableStruct.optionalStructValue.Value().g]; self.optionalStructValue.h = [NSNumber numberWithDouble:decodableStruct.optionalStructValue.Value().h]; + if (decodableStruct.optionalStructValue.Value().i.HasValue()) { + self.optionalStructValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.optionalStructValue.Value().i.Value())]; + } else { + self.optionalStructValue.i = nil; + } } else { self.optionalStructValue = nil; } @@ -34258,6 +34299,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest self.nullableOptionalStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.nullableOptionalStructValue.Value().f.Raw()]; self.nullableOptionalStructValue.g = [NSNumber numberWithFloat:decodableStruct.nullableOptionalStructValue.Value().g]; self.nullableOptionalStructValue.h = [NSNumber numberWithDouble:decodableStruct.nullableOptionalStructValue.Value().h]; + if (decodableStruct.nullableOptionalStructValue.Value().i.HasValue()) { + self.nullableOptionalStructValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.nullableOptionalStructValue.Value().i.Value())]; + } else { + self.nullableOptionalStructValue.i = nil; + } } else { self.nullableOptionalStructValue = nil; } @@ -34426,6 +34472,29 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.arg1.c.f = static_cast>(self.arg1.c.f.unsignedCharValue); encodableStruct.arg1.c.g = self.arg1.c.g.floatValue; encodableStruct.arg1.c.h = self.arg1.c.h.doubleValue; + if (self.arg1.c.i != nil) { + auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace(); + definedValue_2 = static_cast>(self.arg1.c.i.unsignedCharValue); + } + if (self.arg1.d != nil) { + auto & definedValue_1 = encodableStruct.arg1.d.Emplace(); + definedValue_1.name = AsCharSpan(self.arg1.d.name); + if (self.arg1.d.myBitmap == nil) { + definedValue_1.myBitmap.SetNull(); + } else { + auto & nonNullValue_3 = definedValue_1.myBitmap.SetNonNull(); + nonNullValue_3 = static_cast>(self.arg1.d.myBitmap.unsignedIntValue); + } + if (self.arg1.d.myEnum != nil) { + auto & definedValue_3 = definedValue_1.myEnum.Emplace(); + if (self.arg1.d.myEnum == nil) { + definedValue_3.SetNull(); + } else { + auto & nonNullValue_4 = definedValue_3.SetNonNull(); + nonNullValue_4 = static_cast>(self.arg1.d.myEnum.unsignedCharValue); + } + } + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -34619,6 +34688,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_0->mList[i_0].f = static_castmList[i_0].f)>>(element_0.f.unsignedCharValue); listHolder_0->mList[i_0].g = element_0.g.floatValue; listHolder_0->mList[i_0].h = element_0.h.doubleValue; + if (element_0.i != nil) { + auto & definedValue_2 = listHolder_0->mList[i_0].i.Emplace(); + definedValue_2 = static_cast>(element_0.i.unsignedCharValue); + } } encodableStruct.arg1 = ListType_0(listHolder_0->mList, self.arg1.count); } else { @@ -34758,6 +34831,11 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTest self.arg1.f = [NSNumber numberWithUnsignedChar:decodableStruct.arg1.f.Raw()]; self.arg1.g = [NSNumber numberWithFloat:decodableStruct.arg1.g]; self.arg1.h = [NSNumber numberWithDouble:decodableStruct.arg1.h]; + if (decodableStruct.arg1.i.HasValue()) { + self.arg1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg1.i.Value())]; + } else { + self.arg1.i = nil; + } } return CHIP_NO_ERROR; } @@ -35009,6 +35087,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.arg1.c.f = static_cast>(self.arg1.c.f.unsignedCharValue); encodableStruct.arg1.c.g = self.arg1.c.g.floatValue; encodableStruct.arg1.c.h = self.arg1.c.h.doubleValue; + if (self.arg1.c.i != nil) { + auto & definedValue_2 = encodableStruct.arg1.c.i.Emplace(); + definedValue_2 = static_cast>(self.arg1.c.i.unsignedCharValue); + } { using ListType_1 = std::remove_reference_t; using ListMemberType_1 = ListMemberTypeGetter::Type; @@ -35032,6 +35114,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_1->mList[i_1].f = static_castmList[i_1].f)>>(element_1.f.unsignedCharValue); listHolder_1->mList[i_1].g = element_1.g.floatValue; listHolder_1->mList[i_1].h = element_1.h.doubleValue; + if (element_1.i != nil) { + auto & definedValue_3 = listHolder_1->mList[i_1].i.Emplace(); + definedValue_3 = static_cast>(element_1.i.unsignedCharValue); + } } encodableStruct.arg1.d = ListType_1(listHolder_1->mList, self.arg1.d.count); } else { @@ -35299,6 +35385,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_0->mList[i_0].c.f = static_castmList[i_0].c.f)>>(element_0.c.f.unsignedCharValue); listHolder_0->mList[i_0].c.g = element_0.c.g.floatValue; listHolder_0->mList[i_0].c.h = element_0.c.h.doubleValue; + if (element_0.c.i != nil) { + auto & definedValue_3 = listHolder_0->mList[i_0].c.i.Emplace(); + definedValue_3 = static_cast>(element_0.c.i.unsignedCharValue); + } { using ListType_2 = std::remove_reference_tmList[i_0].d)>; using ListMemberType_2 = ListMemberTypeGetter::Type; @@ -35322,6 +35412,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader listHolder_2->mList[i_2].f = static_castmList[i_2].f)>>(element_2.f.unsignedCharValue); listHolder_2->mList[i_2].g = element_2.g.floatValue; listHolder_2->mList[i_2].h = element_2.h.doubleValue; + if (element_2.i != nil) { + auto & definedValue_4 = listHolder_2->mList[i_2].i.Emplace(); + definedValue_4 = static_cast>(element_2.i.unsignedCharValue); + } } listHolder_0->mList[i_0].d = ListType_2(listHolder_2->mList, element_0.d.count); } else { @@ -35802,6 +35896,110 @@ @implementation MTRTestClusterClusterTestEnumsRequestParams @dynamic timedInvokeTimeoutMs; @dynamic serverSideProcessingTimeout; @end +@implementation MTRUnitTestingClusterGlobalEchoResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _field1 = [MTRDataTypeTestGlobalStruct new]; + + _field2 = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRUnitTestingClusterGlobalEchoResponseParams alloc] init]; + + other.field1 = self.field1; + other.field2 = self.field2; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: field1:%@; field2:%@; >", NSStringFromClass([self class]), _field1, _field2]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterGlobalEchoResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType &)decodableStruct +{ + { + self.field1 = [MTRDataTypeTestGlobalStruct new]; + self.field1.name = AsString(decodableStruct.field1.name); + if (self.field1.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + return err; + } + if (decodableStruct.field1.myBitmap.IsNull()) { + self.field1.myBitmap = nil; + } else { + self.field1.myBitmap = [NSNumber numberWithUnsignedInt:decodableStruct.field1.myBitmap.Value().Raw()]; + } + if (decodableStruct.field1.myEnum.HasValue()) { + if (decodableStruct.field1.myEnum.Value().IsNull()) { + self.field1.myEnum = nil; + } else { + self.field1.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.field1.myEnum.Value().Value())]; + } + } else { + self.field1.myEnum = nil; + } + } + { + self.field2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.field2)]; + } + return CHIP_NO_ERROR; +} + +@end + @implementation MTRUnitTestingClusterTestNullableOptionalRequestParams - (instancetype)init { @@ -36028,6 +36226,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader nonNullValue_0.f = static_cast>(self.nullableStruct.f.unsignedCharValue); nonNullValue_0.g = self.nullableStruct.g.floatValue; nonNullValue_0.h = self.nullableStruct.h.doubleValue; + if (self.nullableStruct.i != nil) { + auto & definedValue_2 = nonNullValue_0.i.Emplace(); + definedValue_2 = static_cast>(self.nullableStruct.i.unsignedCharValue); + } } } { @@ -36041,6 +36243,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader definedValue_0.f = static_cast>(self.optionalStruct.f.unsignedCharValue); definedValue_0.g = self.optionalStruct.g.floatValue; definedValue_0.h = self.optionalStruct.h.doubleValue; + if (self.optionalStruct.i != nil) { + auto & definedValue_2 = definedValue_0.i.Emplace(); + definedValue_2 = static_cast>(self.optionalStruct.i.unsignedCharValue); + } } } { @@ -36058,6 +36264,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader nonNullValue_1.f = static_cast>(self.nullableOptionalStruct.f.unsignedCharValue); nonNullValue_1.g = self.nullableOptionalStruct.g.floatValue; nonNullValue_1.h = self.nullableOptionalStruct.h.doubleValue; + if (self.nullableOptionalStruct.i != nil) { + auto & definedValue_3 = nonNullValue_1.i.Emplace(); + definedValue_3 = static_cast>(self.nullableOptionalStruct.i.unsignedCharValue); + } } } } @@ -36251,6 +36461,10 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader encodableStruct.arg1.f = static_cast>(self.arg1.f.unsignedCharValue); encodableStruct.arg1.g = self.arg1.g.floatValue; encodableStruct.arg1.h = self.arg1.h.doubleValue; + if (self.arg1.i != nil) { + auto & definedValue_1 = encodableStruct.arg1.i.Emplace(); + definedValue_1 = static_cast>(self.arg1.i.unsignedCharValue); + } } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); @@ -36908,6 +37122,106 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end +@implementation MTRUnitTestingClusterGlobalEchoRequestParams +- (instancetype)init +{ + if (self = [super init]) { + + _field1 = [MTRDataTypeTestGlobalStruct new]; + + _field2 = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRUnitTestingClusterGlobalEchoRequestParams alloc] init]; + + other.field1 = self.field1; + other.field2 = self.field2; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: field1:%@; field2:%@; >", NSStringFromClass([self class]), _field1, _field2]; + return descriptionString; +} + +@end + +@implementation MTRUnitTestingClusterGlobalEchoRequestParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Type encodableStruct; + ListFreer listFreer; + { + encodableStruct.field1.name = AsCharSpan(self.field1.name); + if (self.field1.myBitmap == nil) { + encodableStruct.field1.myBitmap.SetNull(); + } else { + auto & nonNullValue_1 = encodableStruct.field1.myBitmap.SetNonNull(); + nonNullValue_1 = static_cast>(self.field1.myBitmap.unsignedIntValue); + } + if (self.field1.myEnum != nil) { + auto & definedValue_1 = encodableStruct.field1.myEnum.Emplace(); + if (self.field1.myEnum == nil) { + definedValue_1.SetNull(); + } else { + auto & nonNullValue_2 = definedValue_1.SetNonNull(); + nonNullValue_2 = static_cast>(self.field1.myEnum.unsignedCharValue); + } + } + } + { + encodableStruct.field2 = static_cast>(self.field2.unsignedCharValue); + } + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRUnitTestingClusterTestDifferentVendorMeiRequestParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index d3058d649ee710..93191eb3caa64d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2266,6 +2266,12 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRUnitTestingClusterGlobalEchoResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType &)decodableStruct; + +@end + @interface MTRUnitTestingClusterTestNullableOptionalRequestParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; @@ -2326,6 +2332,12 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRUnitTestingClusterGlobalEchoRequestParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRUnitTestingClusterTestDifferentVendorMeiRequestParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 4d70a00ee32937..821b8f6d58173d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4637,6 +4637,11 @@ static id _Nullable DecodeEventPayloadForUnitTestingCluster(EventId aEventId, TL memberValue.f = [NSNumber numberWithUnsignedChar:cppValue.arg4.f.Raw()]; memberValue.g = [NSNumber numberWithFloat:cppValue.arg4.g]; memberValue.h = [NSNumber numberWithDouble:cppValue.arg4.h]; + if (cppValue.arg4.i.HasValue()) { + memberValue.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.arg4.i.Value())]; + } else { + memberValue.i = nil; + } value.arg4 = memberValue; } while (0); do { @@ -4661,6 +4666,11 @@ static id _Nullable DecodeEventPayloadForUnitTestingCluster(EventId aEventId, TL newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + if (entry_0.i.HasValue()) { + newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())]; + } else { + newElement_0.i = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 3a11fc91e44536..d73fc257e6bcd6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2139,6 +2139,7 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy) NSNumber * _Nonnull f MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @property (nonatomic, copy) NSNumber * _Nonnull g MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @property (nonatomic, copy) NSNumber * _Nonnull h MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +@property (nonatomic, copy) NSNumber * _Nullable i MTR_PROVISIONALLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterSimpleStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -2214,6 +2215,7 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy) NSNumber * _Nonnull a MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @property (nonatomic, copy) NSNumber * _Nonnull b MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @property (nonatomic, copy) MTRUnitTestingClusterSimpleStruct * _Nonnull c MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +@property (nonatomic, copy) MTRDataTypeTestGlobalStruct * _Nullable d MTR_PROVISIONALLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterNestedStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 94a6b90dfeac88..632b70647eb6d0 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8825,6 +8825,8 @@ - (instancetype)init _g = @(0); _h = @(0); + + _i = nil; } return self; } @@ -8841,13 +8843,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.f = self.f; other.g = self.g; other.h = self.h; + other.i = self.i; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; e:%@; f:%@; g:%@; h:%@; i:%@; >", NSStringFromClass([self class]), _a, _b, _c, [_d base64EncodedStringWithOptions:0], _e, _f, _g, _h, _i]; return descriptionString; } @@ -9008,6 +9011,8 @@ - (instancetype)init _b = @(0); _c = [MTRUnitTestingClusterSimpleStruct new]; + + _d = nil; } return self; } @@ -9019,13 +9024,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone other.a = self.a; other.b = self.b; other.c = self.c; + other.d = self.d; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; >", NSStringFromClass([self class]), _a, _b, _c]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: a:%@; b:%@; c:%@; d:%@; >", NSStringFromClass([self class]), _a, _b, _c, _d]; return descriptionString; } 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 1ba55467d670af..ca6df3d1c72e99 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 @@ -46078,6 +46078,53 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value) } // namespace TimedWriteBoolean +namespace GlobalEnum { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::UnitTesting::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(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum 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(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum 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::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +} // namespace GlobalEnum + namespace Unsupported { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) @@ -49016,6 +49063,98 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value } // namespace WriteOnlyInt8u +namespace NullableGlobalEnum { + +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + DataModel::Nullable & value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = + emberAfReadAttribute(endpoint, Clusters::UnitTesting::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(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum 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(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum 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::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE, markDirty); +} + +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType value; + Traits::SetNull(value); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); + return emberAfWriteAttribute(endpoint, Clusters::UnitTesting::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); +} + +Protocols::InteractionModel::Status Set(chip::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(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value) +{ + if (value.IsNull()) + { + return SetNull(endpoint); + } + + return Set(endpoint, value.Value()); +} + +} // namespace NullableGlobalEnum + namespace FeatureMap { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_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 53e24c079fc4bd..ea344fcc49b7cd 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 @@ -6957,6 +6957,14 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty); } // namespace TimedWriteBoolean +namespace GlobalEnum { +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::app::Clusters::Globals::TestGlobalEnum * value); // TestGlobalEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value, + MarkAttributeDirty markDirty); +} // namespace GlobalEnum + namespace Unsupported { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value); // boolean Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value); @@ -7362,6 +7370,21 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); } // namespace WriteOnlyInt8u +namespace NullableGlobalEnum { +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, DataModel::Nullable & value); // TestGlobalEnum +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Globals::TestGlobalEnum value, + MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); +Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable & value, + MarkAttributeDirty markDirty); +} // namespace NullableGlobalEnum + namespace FeatureMap { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 60cdf13689cf10..d1f11db1e93cc5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -6929,6 +6929,12 @@ bool emberAfUnitTestingClusterTestSecondBatchHelperRequestCallback( bool emberAfUnitTestingClusterStringEchoRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::UnitTesting::Commands::StringEchoRequest::DecodableType & commandData); +/** + * @brief Unit Testing Cluster GlobalEchoRequest Command callback (from client) + */ +bool emberAfUnitTestingClusterGlobalEchoRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::DecodableType & commandData); /** * @brief Unit Testing Cluster TestDifferentVendorMeiRequest Command callback (from client) */ 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 af49e0617caa1f..f206178484a6c3 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 @@ -29391,6 +29391,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const encoder.Encode(to_underlying(Fields::kF), f); encoder.Encode(to_underlying(Fields::kG), g); encoder.Encode(to_underlying(Fields::kH), h); + encoder.Encode(to_underlying(Fields::kI), i); return encoder.Finalize(); } @@ -29440,6 +29441,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, h); } + else if (__context_tag == to_underlying(Fields::kI)) + { + err = DataModel::Decode(reader, i); + } else { } @@ -29657,6 +29662,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const encoder.Encode(to_underlying(Fields::kA), a); encoder.Encode(to_underlying(Fields::kB), b); encoder.Encode(to_underlying(Fields::kC), c); + encoder.Encode(to_underlying(Fields::kD), d); return encoder.Finalize(); } @@ -29686,6 +29692,10 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { err = DataModel::Decode(reader, c); } + else if (__context_tag == to_underlying(Fields::kD)) + { + err = DataModel::Decode(reader, d); + } else { } @@ -30986,6 +30996,45 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace TestEnumsRequest. +namespace GlobalEchoResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kField1), field1); + encoder.Encode(to_underlying(Fields::kField2), field2); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kField1)) + { + err = DataModel::Decode(reader, field1); + } + else if (__context_tag == to_underlying(Fields::kField2)) + { + err = DataModel::Decode(reader, field2); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GlobalEchoResponse. namespace TestNullableOptionalRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -31397,6 +31446,45 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace StringEchoRequest. +namespace GlobalEchoRequest { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kField1), field1); + encoder.Encode(to_underlying(Fields::kField2), field2); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kField1)) + { + err = DataModel::Decode(reader, field1); + } + else if (__context_tag == to_underlying(Fields::kField2)) + { + err = DataModel::Decode(reader, field2); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} +} // namespace GlobalEchoRequest. namespace TestDifferentVendorMeiRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -31571,6 +31659,10 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, generalErrorBoolean); case Attributes::ClusterErrorBoolean::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, clusterErrorBoolean); + case Attributes::GlobalEnum::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, globalEnum); + case Attributes::GlobalStruct::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, globalStruct); case Attributes::Unsupported::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, unsupported); case Attributes::NullableBoolean::TypeInfo::GetAttributeId(): @@ -31641,6 +31733,10 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, nullableRangeRestrictedInt16s); case Attributes::WriteOnlyInt8u::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, writeOnlyInt8u); + case Attributes::NullableGlobalEnum::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nullableGlobalEnum); + case Attributes::NullableGlobalStruct::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, nullableGlobalStruct); 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 25ded74c85a287..719c1de9e28975 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 @@ -44013,6 +44013,7 @@ enum class Fields : uint8_t kF = 5, kG = 6, kH = 7, + kI = 8, }; struct Type @@ -44026,6 +44027,7 @@ struct Type chip::BitMask f = static_cast>(0); float g = static_cast(0); double h = static_cast(0); + Optional i; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -44163,6 +44165,7 @@ enum class Fields : uint8_t kA = 0, kB = 1, kC = 2, + kD = 3, }; struct Type @@ -44171,6 +44174,7 @@ struct Type uint8_t a = static_cast(0); bool b = static_cast(0); Structs::SimpleStruct::Type c; + Optional d; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -44427,6 +44431,11 @@ struct Type; struct DecodableType; } // namespace TestEnumsRequest +namespace GlobalEchoResponse { +struct Type; +struct DecodableType; +} // namespace GlobalEchoResponse + namespace TestNullableOptionalRequest { struct Type; struct DecodableType; @@ -44477,6 +44486,11 @@ struct Type; struct DecodableType; } // namespace StringEchoRequest +namespace GlobalEchoRequest { +struct Type; +struct DecodableType; +} // namespace GlobalEchoRequest + namespace TestDifferentVendorMeiRequest { struct Type; struct DecodableType; @@ -45531,6 +45545,41 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace TestEnumsRequest +namespace GlobalEchoResponse { +enum class Fields : uint8_t +{ + kField1 = 0, + kField2 = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GlobalEchoResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + + Globals::Structs::TestGlobalStruct::Type field1; + Globals::TestGlobalEnum field2 = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GlobalEchoResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + + Globals::Structs::TestGlobalStruct::DecodableType field1; + Globals::TestGlobalEnum field2 = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GlobalEchoResponse namespace TestNullableOptionalRequest { enum class Fields : uint8_t { @@ -45898,6 +45947,41 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StringEchoRequest +namespace GlobalEchoRequest { +enum class Fields : uint8_t +{ + kField1 = 0, + kField2 = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::GlobalEchoRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + + Globals::Structs::TestGlobalStruct::Type field1; + Globals::TestGlobalEnum field2 = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::GlobalEchoRequest::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + + Globals::Structs::TestGlobalStruct::DecodableType field1; + Globals::TestGlobalEnum field2 = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace GlobalEchoRequest namespace TestDifferentVendorMeiRequest { enum class Fields : uint8_t { @@ -46543,6 +46627,30 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace ClusterErrorBoolean +namespace GlobalEnum { +struct TypeInfo +{ + using Type = chip::app::Clusters::Globals::TestGlobalEnum; + using DecodableType = chip::app::Clusters::Globals::TestGlobalEnum; + using DecodableArgType = chip::app::Clusters::Globals::TestGlobalEnum; + + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::GlobalEnum::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace GlobalEnum +namespace GlobalStruct { +struct TypeInfo +{ + using Type = chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type; + using DecodableType = chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType &; + + static constexpr ClusterId GetClusterId() { return Clusters::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::GlobalStruct::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace GlobalStruct namespace Unsupported { struct TypeInfo { @@ -46970,6 +47078,31 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace WriteOnlyInt8u +namespace NullableGlobalEnum { +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::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalEnum::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NullableGlobalEnum +namespace NullableGlobalStruct { +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::UnitTesting::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::NullableGlobalStruct::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace NullableGlobalStruct namespace GeneratedCommandList { struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo { @@ -47078,7 +47211,9 @@ struct TypeInfo Attributes::TimedWriteBoolean::TypeInfo::DecodableType timedWriteBoolean = static_cast(0); Attributes::GeneralErrorBoolean::TypeInfo::DecodableType generalErrorBoolean = static_cast(0); Attributes::ClusterErrorBoolean::TypeInfo::DecodableType clusterErrorBoolean = static_cast(0); - Attributes::Unsupported::TypeInfo::DecodableType unsupported = static_cast(0); + Attributes::GlobalEnum::TypeInfo::DecodableType globalEnum = static_cast(0); + Attributes::GlobalStruct::TypeInfo::DecodableType globalStruct; + Attributes::Unsupported::TypeInfo::DecodableType unsupported = static_cast(0); Attributes::NullableBoolean::TypeInfo::DecodableType nullableBoolean; Attributes::NullableBitmap8::TypeInfo::DecodableType nullableBitmap8; Attributes::NullableBitmap16::TypeInfo::DecodableType nullableBitmap16; @@ -47113,6 +47248,8 @@ struct TypeInfo Attributes::NullableRangeRestrictedInt16u::TypeInfo::DecodableType nullableRangeRestrictedInt16u; Attributes::NullableRangeRestrictedInt16s::TypeInfo::DecodableType nullableRangeRestrictedInt16s; Attributes::WriteOnlyInt8u::TypeInfo::DecodableType writeOnlyInt8u = static_cast(0); + Attributes::NullableGlobalEnum::TypeInfo::DecodableType nullableGlobalEnum; + Attributes::NullableGlobalStruct::TypeInfo::DecodableType nullableGlobalStruct; 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 0a144da9030e42..5deab64ef504fc 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 @@ -8296,6 +8296,14 @@ namespace ClusterErrorBoolean { static constexpr AttributeId Id = 0x00000032; } // namespace ClusterErrorBoolean +namespace GlobalEnum { +static constexpr AttributeId Id = 0x00000033; +} // namespace GlobalEnum + +namespace GlobalStruct { +static constexpr AttributeId Id = 0x00000034; +} // namespace GlobalStruct + namespace Unsupported { static constexpr AttributeId Id = 0x000000FF; } // namespace Unsupported @@ -8436,6 +8444,14 @@ namespace WriteOnlyInt8u { static constexpr AttributeId Id = 0x0000402A; } // namespace WriteOnlyInt8u +namespace NullableGlobalEnum { +static constexpr AttributeId Id = 0x00004033; +} // namespace NullableGlobalEnum + +namespace NullableGlobalStruct { +static constexpr AttributeId Id = 0x00004034; +} // namespace NullableGlobalStruct + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; } // namespace GeneratedCommandList diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 68b11f130dcb4c..e9210638315112 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1980,6 +1980,10 @@ namespace TestEnumsRequest { static constexpr CommandId Id = 0x0000000E; } // namespace TestEnumsRequest +namespace GlobalEchoResponse { +static constexpr CommandId Id = 0x0000000E; +} // namespace GlobalEchoResponse + namespace TestNullableOptionalRequest { static constexpr CommandId Id = 0x0000000F; } // namespace TestNullableOptionalRequest @@ -2020,6 +2024,10 @@ namespace StringEchoRequest { static constexpr CommandId Id = 0x00000018; } // namespace StringEchoRequest +namespace GlobalEchoRequest { +static constexpr CommandId Id = 0x00000019; +} // namespace GlobalEchoRequest + namespace TestDifferentVendorMeiRequest { static constexpr CommandId Id = 0xFFF200AA; } // namespace TestDifferentVendorMeiRequest diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 9367f844d3c16b..a48a4b5376f2b7 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -14243,6 +14243,7 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand | * TestBatchHelperRequest | 0x16 | | * TestSecondBatchHelperRequest | 0x17 | | * StringEchoRequest | 0x18 | +| * GlobalEchoRequest | 0x19 | | * TestDifferentVendorMeiRequest | 0xFFF200AA| |------------------------------------------------------------------------------| | Attributes: | | @@ -14293,6 +14294,8 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand | * TimedWriteBoolean | 0x0030 | | * GeneralErrorBoolean | 0x0031 | | * ClusterErrorBoolean | 0x0032 | +| * GlobalEnum | 0x0033 | +| * GlobalStruct | 0x0034 | | * Unsupported | 0x00FF | | * NullableBoolean | 0x4000 | | * NullableBitmap8 | 0x4001 | @@ -14328,6 +14331,8 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand | * NullableRangeRestrictedInt16u | 0x4028 | | * NullableRangeRestrictedInt16s | 0x4029 | | * WriteOnlyInt8u | 0x402A | +| * NullableGlobalEnum | 0x4033 | +| * NullableGlobalStruct | 0x4034 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -15344,6 +15349,46 @@ class UnitTestingStringEchoRequest : public ClusterCommand chip::app::Clusters::UnitTesting::Commands::StringEchoRequest::Type mRequest; }; +/* + * Command GlobalEchoRequest + */ +class UnitTestingGlobalEchoRequest : public ClusterCommand +{ +public: + UnitTestingGlobalEchoRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("global-echo-request", credsIssuerConfig), mComplex_Field1(&mRequest.field1) + { + AddArgument("Field1", &mComplex_Field1); + AddArgument("Field2", 0, UINT8_MAX, &mRequest.field2); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Type mRequest; + TypedComplexArgument mComplex_Field1; +}; + /* * Command TestDifferentVendorMeiRequest */ @@ -27673,6 +27718,7 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // // // Attributes @@ -27726,6 +27772,8 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * make_unique(Id, "timed-write-boolean", Attributes::TimedWriteBoolean::Id, credsIssuerConfig), // make_unique(Id, "general-error-boolean", Attributes::GeneralErrorBoolean::Id, credsIssuerConfig), // make_unique(Id, "cluster-error-boolean", Attributes::ClusterErrorBoolean::Id, credsIssuerConfig), // + make_unique(Id, "global-enum", Attributes::GlobalEnum::Id, credsIssuerConfig), // + make_unique(Id, "global-struct", Attributes::GlobalStruct::Id, credsIssuerConfig), // make_unique(Id, "unsupported", Attributes::Unsupported::Id, credsIssuerConfig), // make_unique(Id, "nullable-boolean", Attributes::NullableBoolean::Id, credsIssuerConfig), // make_unique(Id, "nullable-bitmap8", Attributes::NullableBitmap8::Id, credsIssuerConfig), // @@ -27765,6 +27813,8 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * make_unique(Id, "nullable-range-restricted-int16s", Attributes::NullableRangeRestrictedInt16s::Id, credsIssuerConfig), // make_unique(Id, "write-only-int8u", Attributes::WriteOnlyInt8u::Id, credsIssuerConfig), // + make_unique(Id, "nullable-global-enum", Attributes::NullableGlobalEnum::Id, credsIssuerConfig), // + make_unique(Id, "nullable-global-struct", Attributes::NullableGlobalStruct::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), // @@ -27873,6 +27923,10 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "cluster-error-boolean", 0, 1, Attributes::ClusterErrorBoolean::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>( + Id, "global-enum", 0, UINT8_MAX, Attributes::GlobalEnum::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>( + Id, "global-struct", Attributes::GlobalStruct::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "unsupported", 0, 1, Attributes::Unsupported::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( @@ -27966,6 +28020,12 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "write-only-int8u", 0, UINT8_MAX, Attributes::WriteOnlyInt8u::Id, WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>>( + Id, "nullable-global-enum", 0, UINT8_MAX, Attributes::NullableGlobalEnum::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique< + WriteAttributeAsComplex>>( + Id, "nullable-global-struct", Attributes::NullableGlobalStruct::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -28031,6 +28091,8 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * make_unique(Id, "timed-write-boolean", Attributes::TimedWriteBoolean::Id, credsIssuerConfig), // make_unique(Id, "general-error-boolean", Attributes::GeneralErrorBoolean::Id, credsIssuerConfig), // make_unique(Id, "cluster-error-boolean", Attributes::ClusterErrorBoolean::Id, credsIssuerConfig), // + make_unique(Id, "global-enum", Attributes::GlobalEnum::Id, credsIssuerConfig), // + make_unique(Id, "global-struct", Attributes::GlobalStruct::Id, credsIssuerConfig), // make_unique(Id, "unsupported", Attributes::Unsupported::Id, credsIssuerConfig), // make_unique(Id, "nullable-boolean", Attributes::NullableBoolean::Id, credsIssuerConfig), // make_unique(Id, "nullable-bitmap8", Attributes::NullableBitmap8::Id, credsIssuerConfig), // @@ -28070,6 +28132,8 @@ void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * make_unique(Id, "nullable-range-restricted-int16s", Attributes::NullableRangeRestrictedInt16s::Id, credsIssuerConfig), // make_unique(Id, "write-only-int8u", Attributes::WriteOnlyInt8u::Id, credsIssuerConfig), // + make_unique(Id, "nullable-global-enum", Attributes::NullableGlobalEnum::Id, credsIssuerConfig), // + make_unique(Id, "nullable-global-struct", Attributes::NullableGlobalStruct::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/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 3b958cf45af7ff..8a9766461d448c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -19,6 +19,44 @@ #include +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.name", "name", value.isMember("name"))); + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.myBitmap", "myBitmap", value.isMember("myBitmap"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myBitmap"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myBitmap, value["myBitmap"])); + valueCopy.removeMember("myBitmap"); + + if (value.isMember("myEnum")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myEnum"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myEnum, value["myEnum"])); + } + valueCopy.removeMember("myEnum"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.name); + ComplexArgumentParser::Finalize(request.myBitmap); + ComplexArgumentParser::Finalize(request.myEnum); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ModeTagStruct::Type & request, Json::Value & value) { @@ -423,44 +461,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Opera ComplexArgumentParser::Finalize(request.operationalStateLabel); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.name", "name", value.isMember("name"))); - ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("TestGlobalStruct.myBitmap", "myBitmap", value.isMember("myBitmap"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); - valueCopy.removeMember("name"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myBitmap"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myBitmap, value["myBitmap"])); - valueCopy.removeMember("myBitmap"); - - if (value.isMember("myEnum")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "myEnum"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.myEnum, value["myEnum"])); - } - valueCopy.removeMember("myEnum"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.name); - ComplexArgumentParser::Finalize(request.myBitmap); - ComplexArgumentParser::Finalize(request.myEnum); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & request, Json::Value & value) @@ -5739,6 +5739,13 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.h, value["h"])); valueCopy.removeMember("h"); + if (value.isMember("i")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "i"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.i, value["i"])); + } + valueCopy.removeMember("i"); + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -5752,6 +5759,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::UnitTesting::Structs:: ComplexArgumentParser::Finalize(request.f); ComplexArgumentParser::Finalize(request.g); ComplexArgumentParser::Finalize(request.h); + ComplexArgumentParser::Finalize(request.i); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, @@ -5978,6 +5986,13 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.c, value["c"])); valueCopy.removeMember("c"); + if (value.isMember("d")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "d"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.d, value["d"])); + } + valueCopy.removeMember("d"); + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } @@ -5986,6 +6001,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::UnitTesting::Structs:: ComplexArgumentParser::Finalize(request.a); ComplexArgumentParser::Finalize(request.b); ComplexArgumentParser::Finalize(request.c); + ComplexArgumentParser::Finalize(request.d); } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 47683b1ab87888..5bb0718efb81ea 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -22,6 +22,11 @@ #include #include +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ModeTagStruct::Type & request, Json::Value & value); @@ -71,11 +76,6 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::OperationalStateStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type & request); - static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index fb156dee2d45dc..7fe1851ba370ce 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -21,6 +21,39 @@ using namespace chip::app::Clusters; +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MyBitmap", indent + 1, value.myBitmap); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyBitmap'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("MyEnum", indent + 1, value.myEnum); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyEnum'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::ModeTagStruct::DecodableType & value) { @@ -368,39 +401,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("Name", indent + 1, value.name); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("MyBitmap", indent + 1, value.myBitmap); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyBitmap'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("MyEnum", indent + 1, value.myEnum); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'MyEnum'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::DecodableType & value) { @@ -5083,6 +5083,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = LogValue("I", indent + 1, value.i); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'I'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -5296,6 +5304,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return err; } } + { + CHIP_ERROR err = LogValue("D", indent + 1, value.d); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'D'"); + return err; + } + } DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; @@ -8758,6 +8774,15 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const UnitTesting::Commands::GlobalEchoResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("field1", indent + 1, value.field1)); + ReturnErrorOnFailure(DataModelLogger::LogValue("field2", indent + 1, value.field2)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const UnitTesting::Commands::TestDifferentVendorMeiResponse::DecodableType & value) { @@ -19002,6 +19027,16 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("cluster_error_boolean", 1, value); } + case UnitTesting::Attributes::GlobalEnum::Id: { + chip::app::Clusters::Globals::TestGlobalEnum value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("global_enum", 1, value); + } + case UnitTesting::Attributes::GlobalStruct::Id: { + chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("global_struct", 1, value); + } case UnitTesting::Attributes::Unsupported::Id: { bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -19177,6 +19212,16 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("write_only_int8u", 1, value); } + case UnitTesting::Attributes::NullableGlobalEnum::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("nullable_global_enum", 1, value); + } + case UnitTesting::Attributes::NullableGlobalStruct::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("nullable_global_struct", 1, value); + } case UnitTesting::Attributes::GeneratedCommandList::Id: { chip::app::DataModel::DecodableList value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -19991,6 +20036,11 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("StringEchoResponse", 1, value); } + case UnitTesting::Commands::GlobalEchoResponse::Id: { + UnitTesting::Commands::GlobalEchoResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GlobalEchoResponse", 1, value); + } case UnitTesting::Commands::TestDifferentVendorMeiResponse::Id: { UnitTesting::Commands::TestDifferentVendorMeiResponse::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 165d44db24002f..52dede56ab7ec0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -20,6 +20,9 @@ #include #include +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::ModeTagStruct::DecodableType & value); @@ -50,9 +53,6 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::OperationalStateStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::Globals::Structs::TestGlobalStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::DecodableType & value); @@ -868,6 +868,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Commands::TestBatchHelperResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Commands::StringEchoResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Commands::TestDifferentVendorMeiResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index d31a6b22803f88..e226d87a19aec8 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -177168,6 +177168,7 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA | * TestBatchHelperRequest | 0x16 | | * TestSecondBatchHelperRequest | 0x17 | | * StringEchoRequest | 0x18 | +| * GlobalEchoRequest | 0x19 | | * TestDifferentVendorMeiRequest | 0xFFF200AA| |------------------------------------------------------------------------------| | Attributes: | | @@ -177218,6 +177219,8 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA | * TimedWriteBoolean | 0x0030 | | * GeneralErrorBoolean | 0x0031 | | * ClusterErrorBoolean | 0x0032 | +| * GlobalEnum | 0x0033 | +| * GlobalStruct | 0x0034 | | * Unsupported | 0x00FF | | * NullableBoolean | 0x4000 | | * NullableBitmap8 | 0x4001 | @@ -177253,6 +177256,8 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA | * NullableRangeRestrictedInt16u | 0x4028 | | * NullableRangeRestrictedInt16s | 0x4029 | | * WriteOnlyInt8u | 0x402A | +| * NullableGlobalEnum | 0x4033 | +| * NullableGlobalStruct | 0x4034 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -177605,6 +177610,11 @@ class UnitTestingTestStructArrayArgumentRequest : public ClusterCommand { newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + if (entry_0.c.i.HasValue()) { + newElement_0.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.i.Value())]; + } else { + newElement_0.c.i = nil; + } { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; for (auto & entry_2 : entry_0.d) { @@ -177618,6 +177628,11 @@ class UnitTestingTestStructArrayArgumentRequest : public ClusterCommand { newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + if (entry_2.i.HasValue()) { + newElement_2.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.i.Value())]; + } else { + newElement_2.i = nil; + } [array_2 addObject:newElement_2]; } newElement_0.d = array_2; @@ -177666,6 +177681,11 @@ class UnitTestingTestStructArrayArgumentRequest : public ClusterCommand { newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + if (entry_0.i.HasValue()) { + newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())]; + } else { + newElement_0.i = nil; + } [array_0 addObject:newElement_0]; } params.arg2 = array_0; @@ -177756,6 +177776,11 @@ class UnitTestingTestStructArgumentRequest : public ClusterCommand { params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()]; params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g]; params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h]; + if (mRequest.arg1.i.HasValue()) { + params.arg1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.i.Value())]; + } else { + params.arg1.i = nil; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -177822,6 +177847,31 @@ class UnitTestingTestNestedStructArgumentRequest : public ClusterCommand { params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()]; params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g]; params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h]; + if (mRequest.arg1.c.i.HasValue()) { + params.arg1.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.i.Value())]; + } else { + params.arg1.c.i = nil; + } + if (mRequest.arg1.d.HasValue()) { + params.arg1.d = [MTRDataTypeTestGlobalStruct new]; + params.arg1.d.name = [[NSString alloc] initWithBytes:mRequest.arg1.d.Value().name.data() length:mRequest.arg1.d.Value().name.size() encoding:NSUTF8StringEncoding]; + if (mRequest.arg1.d.Value().myBitmap.IsNull()) { + params.arg1.d.myBitmap = nil; + } else { + params.arg1.d.myBitmap = [NSNumber numberWithUnsignedInt:mRequest.arg1.d.Value().myBitmap.Value().Raw()]; + } + if (mRequest.arg1.d.Value().myEnum.HasValue()) { + if (mRequest.arg1.d.Value().myEnum.Value().IsNull()) { + params.arg1.d.myEnum = nil; + } else { + params.arg1.d.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.d.Value().myEnum.Value().Value())]; + } + } else { + params.arg1.d.myEnum = nil; + } + } else { + params.arg1.d = nil; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -177889,6 +177939,11 @@ class UnitTestingTestListStructArgumentRequest : public ClusterCommand { newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + if (entry_0.i.HasValue()) { + newElement_0.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.i.Value())]; + } else { + newElement_0.i = nil; + } [array_0 addObject:newElement_0]; } params.arg1 = array_0; @@ -178022,6 +178077,11 @@ class UnitTestingTestNestedStructListArgumentRequest : public ClusterCommand { params.arg1.c.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.c.f.Raw()]; params.arg1.c.g = [NSNumber numberWithFloat:mRequest.arg1.c.g]; params.arg1.c.h = [NSNumber numberWithDouble:mRequest.arg1.c.h]; + if (mRequest.arg1.c.i.HasValue()) { + params.arg1.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.c.i.Value())]; + } else { + params.arg1.c.i = nil; + } { // Scope for our temporary variables auto * array_1 = [NSMutableArray new]; for (auto & entry_1 : mRequest.arg1.d) { @@ -178035,6 +178095,11 @@ class UnitTestingTestNestedStructListArgumentRequest : public ClusterCommand { newElement_1.f = [NSNumber numberWithUnsignedChar:entry_1.f.Raw()]; newElement_1.g = [NSNumber numberWithFloat:entry_1.g]; newElement_1.h = [NSNumber numberWithDouble:entry_1.h]; + if (entry_1.i.HasValue()) { + newElement_1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.i.Value())]; + } else { + newElement_1.i = nil; + } [array_1 addObject:newElement_1]; } params.arg1.d = array_1; @@ -178136,6 +178201,11 @@ class UnitTestingTestListNestedStructListArgumentRequest : public ClusterCommand newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + if (entry_0.c.i.HasValue()) { + newElement_0.c.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.i.Value())]; + } else { + newElement_0.c.i = nil; + } { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; for (auto & entry_2 : entry_0.d) { @@ -178149,6 +178219,11 @@ class UnitTestingTestListNestedStructListArgumentRequest : public ClusterCommand newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + if (entry_2.i.HasValue()) { + newElement_2.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.i.Value())]; + } else { + newElement_2.i = nil; + } [array_2 addObject:newElement_2]; } newElement_0.d = array_2; @@ -178483,6 +178558,11 @@ class UnitTestingTestComplexNullableOptionalRequest : public ClusterCommand { params.nullableStruct.f = [NSNumber numberWithUnsignedChar:mRequest.nullableStruct.Value().f.Raw()]; params.nullableStruct.g = [NSNumber numberWithFloat:mRequest.nullableStruct.Value().g]; params.nullableStruct.h = [NSNumber numberWithDouble:mRequest.nullableStruct.Value().h]; + if (mRequest.nullableStruct.Value().i.HasValue()) { + params.nullableStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.nullableStruct.Value().i.Value())]; + } else { + params.nullableStruct.i = nil; + } } if (mRequest.optionalStruct.HasValue()) { params.optionalStruct = [MTRUnitTestingClusterSimpleStruct new]; @@ -178494,6 +178574,11 @@ class UnitTestingTestComplexNullableOptionalRequest : public ClusterCommand { params.optionalStruct.f = [NSNumber numberWithUnsignedChar:mRequest.optionalStruct.Value().f.Raw()]; params.optionalStruct.g = [NSNumber numberWithFloat:mRequest.optionalStruct.Value().g]; params.optionalStruct.h = [NSNumber numberWithDouble:mRequest.optionalStruct.Value().h]; + if (mRequest.optionalStruct.Value().i.HasValue()) { + params.optionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.optionalStruct.Value().i.Value())]; + } else { + params.optionalStruct.i = nil; + } } else { params.optionalStruct = nil; } @@ -178510,6 +178595,11 @@ class UnitTestingTestComplexNullableOptionalRequest : public ClusterCommand { params.nullableOptionalStruct.f = [NSNumber numberWithUnsignedChar:mRequest.nullableOptionalStruct.Value().Value().f.Raw()]; params.nullableOptionalStruct.g = [NSNumber numberWithFloat:mRequest.nullableOptionalStruct.Value().Value().g]; params.nullableOptionalStruct.h = [NSNumber numberWithDouble:mRequest.nullableOptionalStruct.Value().Value().h]; + if (mRequest.nullableOptionalStruct.Value().Value().i.HasValue()) { + params.nullableOptionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.nullableOptionalStruct.Value().Value().i.Value())]; + } else { + params.nullableOptionalStruct.i = nil; + } } } else { params.nullableOptionalStruct = nil; @@ -178625,6 +178715,11 @@ class UnitTestingSimpleStructEchoRequest : public ClusterCommand { params.arg1.f = [NSNumber numberWithUnsignedChar:mRequest.arg1.f.Raw()]; params.arg1.g = [NSNumber numberWithFloat:mRequest.arg1.g]; params.arg1.h = [NSNumber numberWithDouble:mRequest.arg1.h]; + if (mRequest.arg1.i.HasValue()) { + params.arg1.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.arg1.i.Value())]; + } else { + params.arg1.i = nil; + } uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { @@ -179060,6 +179155,88 @@ class UnitTestingStringEchoRequest : public ClusterCommand { chip::app::Clusters::UnitTesting::Commands::StringEchoRequest::Type mRequest; }; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command GlobalEchoRequest + */ +class UnitTestingGlobalEchoRequest : public ClusterCommand { +public: + UnitTestingGlobalEchoRequest() + : ClusterCommand("global-echo-request") + , mComplex_Field1(&mRequest.field1) + { +#if MTR_ENABLE_PROVISIONAL + AddArgument("Field1", &mComplex_Field1); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Field2", 0, UINT8_MAX, &mRequest.field2); +#endif // MTR_ENABLE_PROVISIONAL + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRUnitTestingClusterGlobalEchoRequestParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; +#if MTR_ENABLE_PROVISIONAL + params.field1 = [MTRDataTypeTestGlobalStruct new]; + params.field1.name = [[NSString alloc] initWithBytes:mRequest.field1.name.data() length:mRequest.field1.name.size() encoding:NSUTF8StringEncoding]; + if (mRequest.field1.myBitmap.IsNull()) { + params.field1.myBitmap = nil; + } else { + params.field1.myBitmap = [NSNumber numberWithUnsignedInt:mRequest.field1.myBitmap.Value().Raw()]; + } + if (mRequest.field1.myEnum.HasValue()) { + if (mRequest.field1.myEnum.Value().IsNull()) { + params.field1.myEnum = nil; + } else { + params.field1.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.field1.myEnum.Value().Value())]; + } + } else { + params.field1.myEnum = nil; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + params.field2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.field2)]; +#endif // MTR_ENABLE_PROVISIONAL + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster globalEchoRequestWithParams:params completion: + ^(MTRUnitTestingClusterGlobalEchoResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting::Commands::GlobalEchoResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::UnitTesting::Commands::GlobalEchoRequest::Type mRequest; + TypedComplexArgument mComplex_Field1; +}; + #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* @@ -183580,6 +183757,11 @@ class WriteUnitTestingListNullablesAndOptionalsStruct : public WriteAttribute { newElement_0.nullableStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableStruct.Value().f.Raw()]; newElement_0.nullableStruct.g = [NSNumber numberWithFloat:entry_0.nullableStruct.Value().g]; newElement_0.nullableStruct.h = [NSNumber numberWithDouble:entry_0.nullableStruct.Value().h]; + if (entry_0.nullableStruct.Value().i.HasValue()) { + newElement_0.nullableStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableStruct.Value().i.Value())]; + } else { + newElement_0.nullableStruct.i = nil; + } } if (entry_0.optionalStruct.HasValue()) { newElement_0.optionalStruct = [MTRUnitTestingClusterSimpleStruct new]; @@ -183591,6 +183773,11 @@ class WriteUnitTestingListNullablesAndOptionalsStruct : public WriteAttribute { newElement_0.optionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.optionalStruct.Value().f.Raw()]; newElement_0.optionalStruct.g = [NSNumber numberWithFloat:entry_0.optionalStruct.Value().g]; newElement_0.optionalStruct.h = [NSNumber numberWithDouble:entry_0.optionalStruct.Value().h]; + if (entry_0.optionalStruct.Value().i.HasValue()) { + newElement_0.optionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.optionalStruct.Value().i.Value())]; + } else { + newElement_0.optionalStruct.i = nil; + } } else { newElement_0.optionalStruct = nil; } @@ -183607,6 +183794,11 @@ class WriteUnitTestingListNullablesAndOptionalsStruct : public WriteAttribute { newElement_0.nullableOptionalStruct.f = [NSNumber numberWithUnsignedChar:entry_0.nullableOptionalStruct.Value().Value().f.Raw()]; newElement_0.nullableOptionalStruct.g = [NSNumber numberWithFloat:entry_0.nullableOptionalStruct.Value().Value().g]; newElement_0.nullableOptionalStruct.h = [NSNumber numberWithDouble:entry_0.nullableOptionalStruct.Value().Value().h]; + if (entry_0.nullableOptionalStruct.Value().Value().i.HasValue()) { + newElement_0.nullableOptionalStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.nullableOptionalStruct.Value().Value().i.Value())]; + } else { + newElement_0.nullableOptionalStruct.i = nil; + } } } else { newElement_0.nullableOptionalStruct = nil; @@ -183915,6 +184107,11 @@ class WriteUnitTestingStructAttr : public WriteAttribute { value.f = [NSNumber numberWithUnsignedChar:mValue.f.Raw()]; value.g = [NSNumber numberWithFloat:mValue.g]; value.h = [NSNumber numberWithDouble:mValue.h]; + if (mValue.i.HasValue()) { + value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.i.Value())]; + } else { + value.i = nil; + } [cluster writeAttributeStructAttrWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { @@ -184705,6 +184902,11 @@ class WriteUnitTestingListFabricScoped : public WriteAttribute { newElement_0.fabricSensitiveStruct.f = [NSNumber numberWithUnsignedChar:entry_0.fabricSensitiveStruct.f.Raw()]; newElement_0.fabricSensitiveStruct.g = [NSNumber numberWithFloat:entry_0.fabricSensitiveStruct.g]; newElement_0.fabricSensitiveStruct.h = [NSNumber numberWithDouble:entry_0.fabricSensitiveStruct.h]; + if (entry_0.fabricSensitiveStruct.i.HasValue()) { + newElement_0.fabricSensitiveStruct.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.fabricSensitiveStruct.i.Value())]; + } else { + newElement_0.fabricSensitiveStruct.i = nil; + } { // Scope for our temporary variables auto * array_2 = [NSMutableArray new]; for (auto & entry_2 : entry_0.fabricSensitiveInt8uList) { @@ -185065,22 +185267,274 @@ class ReadUnitTestingClusterErrorBoolean : public ReadAttribute { class WriteUnitTestingClusterErrorBoolean : public WriteAttribute { public: - WriteUnitTestingClusterErrorBoolean() - : WriteAttribute("cluster-error-boolean") + WriteUnitTestingClusterErrorBoolean() + : WriteAttribute("cluster-error-boolean") + { + AddArgument("attr-name", "cluster-error-boolean"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteUnitTestingClusterErrorBoolean() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::ClusterErrorBoolean::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeClusterErrorBooleanWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("UnitTesting ClusterErrorBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeUnitTestingClusterErrorBoolean : public SubscribeAttribute { +public: + SubscribeAttributeUnitTestingClusterErrorBoolean() + : SubscribeAttribute("cluster-error-boolean") + { + } + + ~SubscribeAttributeUnitTestingClusterErrorBoolean() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::ClusterErrorBoolean::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 subscribeAttributeClusterErrorBooleanWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.ClusterErrorBoolean 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; + } +}; + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GlobalEnum + */ +class ReadUnitTestingGlobalEnum : public ReadAttribute { +public: + ReadUnitTestingGlobalEnum() + : ReadAttribute("global-enum") + { + } + + ~ReadUnitTestingGlobalEnum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGlobalEnumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.GlobalEnum response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("UnitTesting GlobalEnum read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteUnitTestingGlobalEnum : public WriteAttribute { +public: + WriteUnitTestingGlobalEnum() + : WriteAttribute("global-enum") + { + AddArgument("attr-name", "global-enum"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteUnitTestingGlobalEnum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeGlobalEnumWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("UnitTesting GlobalEnum write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeUnitTestingGlobalEnum : public SubscribeAttribute { +public: + SubscribeAttributeUnitTestingGlobalEnum() + : SubscribeAttribute("global-enum") + { + } + + ~SubscribeAttributeUnitTestingGlobalEnum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalEnum::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 subscribeAttributeGlobalEnumWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.GlobalEnum 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 GlobalStruct + */ +class ReadUnitTestingGlobalStruct : public ReadAttribute { +public: + ReadUnitTestingGlobalStruct() + : ReadAttribute("global-struct") + { + } + + ~ReadUnitTestingGlobalStruct() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGlobalStructWithCompletion:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.GlobalStruct response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("UnitTesting GlobalStruct read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteUnitTestingGlobalStruct : public WriteAttribute { +public: + WriteUnitTestingGlobalStruct() + : WriteAttribute("global-struct") + , mComplex(&mValue) { - AddArgument("attr-name", "cluster-error-boolean"); - AddArgument("attr-value", 0, 1, &mValue); + AddArgument("attr-name", "global-struct"); + AddArgument("attr-value", &mComplex); WriteAttribute::AddArguments(); } - ~WriteUnitTestingClusterErrorBoolean() + ~WriteUnitTestingGlobalStruct() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::ClusterErrorBoolean::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::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); @@ -185088,11 +185542,27 @@ class WriteUnitTestingClusterErrorBoolean : public WriteAttribute { __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 * _Nonnull value = [NSNumber numberWithBool:mValue]; + MTRDataTypeTestGlobalStruct * _Nonnull value; + value = [MTRDataTypeTestGlobalStruct new]; + value.name = [[NSString alloc] initWithBytes:mValue.name.data() length:mValue.name.size() encoding:NSUTF8StringEncoding]; + if (mValue.myBitmap.IsNull()) { + value.myBitmap = nil; + } else { + value.myBitmap = [NSNumber numberWithUnsignedInt:mValue.myBitmap.Value().Raw()]; + } + if (mValue.myEnum.HasValue()) { + if (mValue.myEnum.Value().IsNull()) { + value.myEnum = nil; + } else { + value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.myEnum.Value().Value())]; + } + } else { + value.myEnum = nil; + } - [cluster writeAttributeClusterErrorBooleanWithValue:value params:params completion:^(NSError * _Nullable error) { + [cluster writeAttributeGlobalStructWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { - LogNSError("UnitTesting ClusterErrorBoolean write Error", error); + LogNSError("UnitTesting GlobalStruct write Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -185101,24 +185571,25 @@ class WriteUnitTestingClusterErrorBoolean : public WriteAttribute { } private: - bool mValue; + chip::app::Clusters::Globals::Structs::TestGlobalStruct::Type mValue; + TypedComplexArgument mComplex; }; -class SubscribeAttributeUnitTestingClusterErrorBoolean : public SubscribeAttribute { +class SubscribeAttributeUnitTestingGlobalStruct : public SubscribeAttribute { public: - SubscribeAttributeUnitTestingClusterErrorBoolean() - : SubscribeAttribute("cluster-error-boolean") + SubscribeAttributeUnitTestingGlobalStruct() + : SubscribeAttribute("global-struct") { } - ~SubscribeAttributeUnitTestingClusterErrorBoolean() + ~SubscribeAttributeUnitTestingGlobalStruct() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::ClusterErrorBoolean::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::GlobalStruct::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); @@ -185133,10 +185604,10 @@ class SubscribeAttributeUnitTestingClusterErrorBoolean : public SubscribeAttribu if (mAutoResubscribe.HasValue()) { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [cluster subscribeAttributeClusterErrorBooleanWithParams:params + [cluster subscribeAttributeGlobalStructWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"UnitTesting.ClusterErrorBoolean response %@", [value description]); + reportHandler:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.GlobalStruct response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -185149,6 +185620,8 @@ class SubscribeAttributeUnitTestingClusterErrorBoolean : public SubscribeAttribu } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute Unsupported */ @@ -188876,6 +189349,11 @@ class WriteUnitTestingNullableStruct : public WriteAttribute { value.f = [NSNumber numberWithUnsignedChar:mValue.Value().f.Raw()]; value.g = [NSNumber numberWithFloat:mValue.Value().g]; value.h = [NSNumber numberWithDouble:mValue.Value().h]; + if (mValue.Value().i.HasValue()) { + value.i = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().i.Value())]; + } else { + value.i = nil; + } } [cluster writeAttributeNullableStructWithValue:value params:params completion:^(NSError * _Nullable error) { @@ -189565,6 +190043,284 @@ class SubscribeAttributeUnitTestingWriteOnlyInt8u : public SubscribeAttribute { } }; +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute NullableGlobalEnum + */ +class ReadUnitTestingNullableGlobalEnum : public ReadAttribute { +public: + ReadUnitTestingNullableGlobalEnum() + : ReadAttribute("nullable-global-enum") + { + } + + ~ReadUnitTestingNullableGlobalEnum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNullableGlobalEnumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.NullableGlobalEnum response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("UnitTesting NullableGlobalEnum read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteUnitTestingNullableGlobalEnum : public WriteAttribute { +public: + WriteUnitTestingNullableGlobalEnum() + : WriteAttribute("nullable-global-enum") + { + AddArgument("attr-name", "nullable-global-enum"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteUnitTestingNullableGlobalEnum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 writeAttributeNullableGlobalEnumWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("UnitTesting NullableGlobalEnum write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::Nullable mValue; +}; + +class SubscribeAttributeUnitTestingNullableGlobalEnum : public SubscribeAttribute { +public: + SubscribeAttributeUnitTestingNullableGlobalEnum() + : SubscribeAttribute("nullable-global-enum") + { + } + + ~SubscribeAttributeUnitTestingNullableGlobalEnum() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalEnum::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 subscribeAttributeNullableGlobalEnumWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.NullableGlobalEnum 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 NullableGlobalStruct + */ +class ReadUnitTestingNullableGlobalStruct : public ReadAttribute { +public: + ReadUnitTestingNullableGlobalStruct() + : ReadAttribute("nullable-global-struct") + { + } + + ~ReadUnitTestingNullableGlobalStruct() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeNullableGlobalStructWithCompletion:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.NullableGlobalStruct response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("UnitTesting NullableGlobalStruct read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteUnitTestingNullableGlobalStruct : public WriteAttribute { +public: + WriteUnitTestingNullableGlobalStruct() + : WriteAttribute("nullable-global-struct") + , mComplex(&mValue) + { + AddArgument("attr-name", "nullable-global-struct"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteUnitTestingNullableGlobalStruct() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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; + MTRDataTypeTestGlobalStruct * _Nullable value; + if (mValue.IsNull()) { + value = nil; + } else { + value = [MTRDataTypeTestGlobalStruct new]; + value.name = [[NSString alloc] initWithBytes:mValue.Value().name.data() length:mValue.Value().name.size() encoding:NSUTF8StringEncoding]; + if (mValue.Value().myBitmap.IsNull()) { + value.myBitmap = nil; + } else { + value.myBitmap = [NSNumber numberWithUnsignedInt:mValue.Value().myBitmap.Value().Raw()]; + } + if (mValue.Value().myEnum.HasValue()) { + if (mValue.Value().myEnum.Value().IsNull()) { + value.myEnum = nil; + } else { + value.myEnum = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().myEnum.Value().Value())]; + } + } else { + value.myEnum = nil; + } + } + + [cluster writeAttributeNullableGlobalStructWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("UnitTesting NullableGlobalStruct write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::Nullable mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeUnitTestingNullableGlobalStruct : public SubscribeAttribute { +public: + SubscribeAttributeUnitTestingNullableGlobalStruct() + : SubscribeAttribute("nullable-global-struct") + { + } + + ~SubscribeAttributeUnitTestingNullableGlobalStruct() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::UnitTesting::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::UnitTesting::Attributes::NullableGlobalStruct::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); + __auto_type * cluster = [[MTRBaseClusterUnitTesting 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 subscribeAttributeNullableGlobalStructWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRDataTypeTestGlobalStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"UnitTesting.NullableGlobalStruct 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 + /* * Attribute GeneratedCommandList */ @@ -198236,6 +198992,9 @@ void registerClusterUnitTesting(Commands & commands) #if MTR_ENABLE_PROVISIONAL make_unique(), // #endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // #endif // MTR_ENABLE_PROVISIONAL @@ -198383,6 +199142,16 @@ void registerClusterUnitTesting(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#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 make_unique(), // make_unique(), // make_unique(), // @@ -198488,6 +199257,16 @@ void registerClusterUnitTesting(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#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 make_unique(), // make_unique(), // make_unique(), // From 5d280dedd0bcea407f575aef11e67c8bb7f0a7a1 Mon Sep 17 00:00:00 2001 From: Michael Rupp <95718139+mykrupp@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:31:44 -0400 Subject: [PATCH 22/40] [Silabs] Port platform specific Multi-Chip OTA work (#34440) * Pull request #1836: Cherry multi ota Merge in WMN_TOOLS/matter from cherry-multi-ota to silabs_slc_1.3 Squashed commit of the following: commit 4320bb46571658bc44fb82345348265def394991 Author: Michael Rupp Date: Fri May 10 14:26:07 2024 -0400 remove some unwanted diffs in provision files commit be160931dc600de7e7ead378b70d6a43c3945e46 Author: Michael Rupp Date: Fri May 10 14:24:25 2024 -0400 revert changes to generator.project.mak commit 14b6605887166e6d5284a61feb2bf407d850bdcf Author: Michael Rupp Date: Fri May 10 13:06:12 2024 -0400 revert NVM key changes and script changes ... and 8 more commits * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by autopep8 * remove unused libs caught by linter * update doctree with new readmes * rerun CI, cirque failing for unknown reasons * fix include guards in provision examples * Restyled by clang-format --------- Co-authored-by: Restyled.io --- docs/tools/index.md | 2 + .../provision/ProvisionStorageDefault.cpp | 5 +- .../provision/ProvisionStorageFlash.cpp | 5 +- .../silabs/factory_data_generator/README.md | 56 ++++++ .../silabs/factory_data_generator/custom.py | 106 +++++++++++ .../silabs/factory_data_generator/default.py | 131 ++++++++++++++ scripts/tools/silabs/ota/README.md | 15 +- .../binaries/ext_flash_ota_entry_example.bin | Bin 0 -> 7056 bytes .../examples/ota_custom_entries_example.json | 67 +++++++ .../examples/ota_custom_entries_example2.json | 88 +++++++++ .../tools/silabs/ota/ota_multi_image_tool.py | 10 +- scripts/tools/silabs/ota/requirements.txt | 1 + src/platform/silabs/efr32/BUILD.gn | 21 ++- .../silabs/efr32/efr32-psa-crypto-config.h | 5 + .../silabs/multi-ota/OTACustomProcessor.cpp | 94 ++++++++++ .../silabs/multi-ota/OTACustomProcessor.h | 56 ++++++ .../multi-ota/OTAFactoryDataProcessor.cpp | 170 ++++++++++++++++++ .../multi-ota/OTAFactoryDataProcessor.h | 81 +++++++++ .../{efr32 => }/OTAFirmwareProcessor.cpp | 37 +++- .../{efr32 => }/OTAFirmwareProcessor.h | 0 .../silabs/multi-ota/{efr32 => }/OTAHooks.cpp | 27 ++- .../multi-ota/OTAMultiImageProcessorImpl.cpp | 3 - .../silabs/multi-ota/OTATlvProcessor.cpp | 70 +------- .../silabs/multi-ota/OTATlvProcessor.h | 10 ++ .../silabs/multi-ota/OtaTlvEncryptionKey.cpp | 130 ++++++++++++++ .../silabs/multi-ota/OtaTlvEncryptionKey.h | 34 ++++ third_party/silabs/efr32_sdk.gni | 10 ++ 27 files changed, 1145 insertions(+), 89 deletions(-) create mode 100644 scripts/tools/silabs/factory_data_generator/README.md create mode 100644 scripts/tools/silabs/factory_data_generator/custom.py create mode 100644 scripts/tools/silabs/factory_data_generator/default.py create mode 100755 scripts/tools/silabs/ota/examples/binaries/ext_flash_ota_entry_example.bin create mode 100644 scripts/tools/silabs/ota/examples/ota_custom_entries_example.json create mode 100644 scripts/tools/silabs/ota/examples/ota_custom_entries_example2.json create mode 100644 scripts/tools/silabs/ota/requirements.txt create mode 100644 src/platform/silabs/multi-ota/OTACustomProcessor.cpp create mode 100644 src/platform/silabs/multi-ota/OTACustomProcessor.h create mode 100644 src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp create mode 100644 src/platform/silabs/multi-ota/OTAFactoryDataProcessor.h rename src/platform/silabs/multi-ota/{efr32 => }/OTAFirmwareProcessor.cpp (84%) rename src/platform/silabs/multi-ota/{efr32 => }/OTAFirmwareProcessor.h (100%) rename src/platform/silabs/multi-ota/{efr32 => }/OTAHooks.cpp (52%) create mode 100644 src/platform/silabs/multi-ota/OtaTlvEncryptionKey.cpp create mode 100644 src/platform/silabs/multi-ota/OtaTlvEncryptionKey.h diff --git a/docs/tools/index.md b/docs/tools/index.md index 003573ed5ebb14..a2ff8fd1587f89 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -49,6 +49,8 @@ Source files for these tools are located at `scripts/tools`. :maxdepth: 1 ../scripts/tools/silabs/README +../scripts/tools/silabs/ota/README +../scripts/tools/silabs/factory_data_generator/README ``` diff --git a/examples/platform/silabs/provision/ProvisionStorageDefault.cpp b/examples/platform/silabs/provision/ProvisionStorageDefault.cpp index 09f103592d2470..1162323cda3d51 100644 --- a/examples/platform/silabs/provision/ProvisionStorageDefault.cpp +++ b/examples/platform/silabs/provision/ProvisionStorageDefault.cpp @@ -28,6 +28,9 @@ #include #include #include +#ifdef OTA_ENCRYPTION_ENABLE +#include +#endif // OTA_ENCRYPTION_ENABLE #ifdef SLI_SI91X_MCU_INTERFACE #include #else @@ -659,7 +662,7 @@ CHIP_ERROR Storage::SetOtaTlvEncryptionKey(const ByteSpan & value) ReturnErrorOnFailure(key.Import(value.data(), value.size())); return SilabsConfig::WriteConfigValue(SilabsConfig::kOtaTlvEncryption_KeyId, key.GetId()); } -#endif +#endif // OTA_ENCRYPTION_ENABLE /** * @brief Reads the test event trigger key from NVM. If the key isn't present, returns default value if defined. diff --git a/examples/platform/silabs/provision/ProvisionStorageFlash.cpp b/examples/platform/silabs/provision/ProvisionStorageFlash.cpp index 5bd11108bd9cc6..35a32d6af8f5ec 100644 --- a/examples/platform/silabs/provision/ProvisionStorageFlash.cpp +++ b/examples/platform/silabs/provision/ProvisionStorageFlash.cpp @@ -25,6 +25,9 @@ #include #include #include +#ifdef OTA_ENCRYPTION_ENABLE +#include +#endif // OTA_ENCRYPTION_ENABLE using namespace chip::Credentials; @@ -708,7 +711,7 @@ CHIP_ERROR Storage::SetOtaTlvEncryptionKey(const ByteSpan & value) { return CHIP_ERROR_NOT_IMPLEMENTED; } -#endif +#endif // OTA_ENCRYPTION_ENABLE CHIP_ERROR Storage::GetTestEventTriggerKey(MutableByteSpan & keySpan) { diff --git a/scripts/tools/silabs/factory_data_generator/README.md b/scripts/tools/silabs/factory_data_generator/README.md new file mode 100644 index 00000000000000..c75c52f91d0333 --- /dev/null +++ b/scripts/tools/silabs/factory_data_generator/README.md @@ -0,0 +1,56 @@ +# Silabs Factory Data Generator + +## Tool implementation + +The tool comprises of two files: `default.py`, `custom.py` + +### `default.py` + +Defines the base `InputArgument` class and its derived classes that will be +referenced as **default classes**. + +`InputArgument` offers an abstract interface in the form of three methods: +`key()`, `length()`, `encode()`, that will be used to generate the `(K, L, V)` +tuple through the public `output()` method. Each custom class should implement +the abstract interface, if its direct parent does not offer a relevant +implementation. + +### `custom.py` + +Defines classes for each argument that should generate data in the output binary +(will be referenced as **custom classes**). Please note that each new class +should derive from a default class, not from `InputArgument` directly. + +### How to add a new argument + +Example of defining a new argument class in `custom.py`: + +``` +class FooArgument(BarArgument): + def __init__(self, arg): + super().__init__(arg) + + def key(self): + return + + def length(self): + return + + def encode(self): + return + + def custom_function(self): + pass +``` + +where `BarArgument` is one of the **default classes**. Please note that a user +can define additional methods if needed (e.g. `custom_function`; also see +`generate_private_key` from `DacPKey` class). + +Then use this class in `generate.py` to create a `FooArgument` object from an +option: + +``` +parser.add_argument("--foo", required=True, type=FooArgument, + help="[int | hex] Foo argument.") +``` diff --git a/scripts/tools/silabs/factory_data_generator/custom.py b/scripts/tools/silabs/factory_data_generator/custom.py new file mode 100644 index 00000000000000..a06d61ca3f8568 --- /dev/null +++ b/scripts/tools/silabs/factory_data_generator/custom.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2022 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +'''This file should contain custom classes derived any class from default.py. + +Each class implemented here should describe an input parameter and should +implement the InputArgument abstract interface, if its base class does not +already offer an implementation or if there is a need of a custom behavior. + +Example of defining a new argument class: + + class FooArgument(IntArgument): + def __init__(self, arg): + super().__init__(arg) + + def key(self): + return + + def length(self): + return + + def encode(self): + return + + def custom_function(self): + pass + +Then use this class in generate.py to create a FooArgument object from an +option: + + parser.add_argument("--foo", required=True, type=FooArgument, + help="[int | hex] Foo argument.") +''' + +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives.serialization import load_der_private_key +from default import FileArgument + + +class DacPKey(FileArgument): + + def __init__(self, arg): + super().__init__(arg) + self.private_key = None + + def key(self): + return 1 + + def length(self): + assert (self.private_key is not None) + return len(self.private_key) + + def encode(self): + assert (self.private_key is not None) + return self.private_key + + def generate_private_key(self, password, use_sss_blob=True): + if use_sss_blob: + self.private_key = self.val + else: + keys = load_der_private_key(self.val, password, backend=default_backend()) + self.private_key = keys.private_numbers().private_value.to_bytes( + 32, byteorder='big' + ) + + +class DacCert(FileArgument): + + def __init__(self, arg): + super().__init__(arg) + + def key(self): + return 2 + + +class PaiCert(FileArgument): + + def __init__(self, arg): + super().__init__(arg) + + def key(self): + return 3 + + +class CertDeclaration(FileArgument): + + def __init__(self, arg): + super().__init__(arg) + + def key(self): + return 4 diff --git a/scripts/tools/silabs/factory_data_generator/default.py b/scripts/tools/silabs/factory_data_generator/default.py new file mode 100644 index 00000000000000..13dc0866aaed40 --- /dev/null +++ b/scripts/tools/silabs/factory_data_generator/default.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2022 Project CHIP Authors +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +'''This file should contain default argument classes. + +Base class is InputArgument. It defines the abstract interface to be +implemented and offers a way to compute a KLV value through output(). +Other classes that derive InputArgument directly will be referenced +as default classes throughout the docstrings. + +The default classes should not be used to instantiate arguments. +If one wants to add another argument, a custom class should be derived +from one of the default classes. +''' + +import base64 +import logging + + +class InputArgument: + '''Base class for any input argument that will be added to KLV. + + The user will define its arguments as instances of InputArgument + by setting the "type" attribute of ArgumentParser add_argument to + an instance of a derived class. This means that all derived classes + must accept an additional "arg" parameter in the constructor. In the + end, the list of arguments will be parsed into objects derived from + InputArgument (or default derived classes), which decouples the object + creation from its processing. + + Abstract methods: + key: Should be overwritten by final classes to return a "magic number". + length: Can be overwritten by default classes to specify a default value + (e.g. int arguments with a default length value of 4); can also + be overwritten by final classes to specify a custom value for a + certain argument. + encode: Should be overwritten to generate the correct bytes array from + its internal value. + + Main usage is to iterate over an iterable entity of InputArguments and call + the output() method to generate the (K, L, V) tuple. Note that the output() + method should not be implemented, since its a common functionality across + all InputArgument classes. + ''' + + def __init__(self): + self.val = None + + def key(self): + logging.error("key() should be implemented in derived classes.") + + def length(self): + logging.error("length() should be implemented in derived classes.") + + def encode(self): + logging.error("encode() should be implemented in derived classes.") + + def output(self): + out = (self.key(), self.length(), self.encode()) + logging.info("'{}' length: {}".format(type(self).__name__, self.length())) + return out + + +class IntArgument(InputArgument): + + def __init__(self, arg): + super().__init__() + self.val = int(arg, 0) + + def length(self): + return 4 + + def encode(self): + return self.val.to_bytes(self.length(), "little") + + +class Base64Argument(InputArgument): + + def __init__(self, arg): + super().__init__() + self.val = base64.b64decode(arg) + + def length(self): + return len(self.encode()) + + def encode(self): + return base64.b64encode(self.val) + + +class StrArgument(InputArgument): + + def __init__(self, arg): + super().__init__() + self.val = str(arg) + + def length(self): + return len(self.encode()) + + def encode(self): + return str.encode(self.val) + + def max_length(self): + return 32 + + +class FileArgument(InputArgument): + + def __init__(self, arg): + super().__init__() + with open(arg, "rb") as _file: + self.val = _file.read() + + def length(self): + return len(self.val) + + def encode(self): + return self.val diff --git a/scripts/tools/silabs/ota/README.md b/scripts/tools/silabs/ota/README.md index d0c1bd39e068cd..0629d8650c1e8a 100644 --- a/scripts/tools/silabs/ota/README.md +++ b/scripts/tools/silabs/ota/README.md @@ -25,8 +25,7 @@ python3 ./scripts/tools/silabs/ota/ota_multi_image_tool.py create -v 0xDEAD -p 0 ``` followed by \*_custom options_- and a positional argument (should be last) that -specifies the output file. Please see the `create_ota_images.sh` for some -reference commands. +specifies the output file. The list of **custom options**: @@ -38,12 +37,6 @@ The list of **custom options**: --app-version-str --> Application version string. Same as above. --app-build-date --> Application build date. Same as above. -# SSBL options ---bl-input-file --> Path to the SSBL binary. ---bl-version --> SSBL version. ---bl-version-str --> SSBL version string. ---bl-build-date --> SSBL build date. - # Factory data options --factory-data --> If set, enables the generation of factory data. --cert_declaration --> Certification Declaration. @@ -51,6 +44,10 @@ The list of **custom options**: --dac_key --> DAC private key. --pai_cert --> PAI certificate. +# Encryption options +--enc_enable --> Enable ota encryption +--input_ota_key --> 16 Byte AES key + # Custom TLV options --json --> Path to a JSON file following ota_payload.schema ``` @@ -67,5 +64,5 @@ processing. When defining a custom processor, a user is able to also specify the custom format of the TLV by creating a JSON file based on the `ota_payload.schema`. The tool offers support for describing multiple TLV in the same JSON file. Please -see the `examples/ota_max_entries_example.json` for a multi-app + SSBL example. +see the `examples/ota_custom_entries_example.json` for a multi-binary example. Option `--json` must be used to specify the path to the JSON file. diff --git a/scripts/tools/silabs/ota/examples/binaries/ext_flash_ota_entry_example.bin b/scripts/tools/silabs/ota/examples/binaries/ext_flash_ota_entry_example.bin new file mode 100755 index 0000000000000000000000000000000000000000..5800a9860f70aae4d8f235a4371b31c6b77a498f GIT binary patch literal 7056 zcmcIod011|w%;e`Bsn1Tih2}w8sqK!ibrz$w~LA6(|UaMZKL{W=X zD;ft(E)Lb+GKdU{6}gB?ty66if)%wY)@zR#TTd9wVUWCau-<#$_r1T~_q_wZ>~Za3 z?KSMRTjpWJdJLgTKsbTW2}tVz)qtbsz8=A9T|r6^LWQL>k9`Amuf7_{*8(a9Km(`- zd;_Qf)B@@N^?>t$2EawYCBPNHHNbVij{rNs0k{FU3AhEg1Go#g4|o802zUfw0IdKg z;5WcCfD6zL=mfX{U4S0I3xEfJ;RxY?SDz5_Vt@o71^57b0e%2~Kpq_SyM7ujVms4rr0op z|A{cekfjc;B3)r1*c_rjuZ|3~hZ^G4gv!q@Q2N?$aO61uN=5(NMz%!}lGebHqYxX^ zRo;$FeN2!+O%>=7E9)9$7?iqIBXJB$MbuV}%z;=@*Zfl$d!W0IakQf3f=ur?B+u78 zz4iAQ$EOgnUCeZjoIRZ*CL#H5&7)gIP}j}$vyQ^lg#!>yAUG)aI%$Mcu*Y$L6ac^H zipT7{M>L7ZdW_=t_V3;Q|L4Y5qc9rrGaHKf%{GA!rK9O{dPF^Dl(bEcln-sfPPD?wEEH)d3CVi1ozLV zU;{GaooG2`c2r@iAp1ZsEMkyNP$F>V;=t`mgi9?#;k&udVqU0x>`j~r^SBEqz*xY1r^zKXbMK4#~?`eB#5B?Op_Xc zjh8a4g_pPWSzdXD=cNlQ8f5EZ1TpI~s8B2&&gV?F9wblG2vUc$Vw_M(n(sfx+2J@j zd^l?4HpcoH9Ng(>zclEjb#SIQN2a2qWkCoL;;m)t7ic@MI7hm%W0=Ch*%EGx#W#eh zX-gW~Xi8%h1q({5VGVR1H4zG-%yKhN<)@K+}kuDbte}Yy^|Y7g%FK|pyS*? zyrV_ouieQ-QQ9Yh1v|MnsA)n$M>>omNXyM|WZe<>-hdUWNj0zE0cm^sK|j`{3Fq>*LO^);_@&oL_YX-%=&jVyh(t*3l9w)h4aJ0=aX3QtkTH zsY0wH9g}LO^W1>3WhvvTWs?rMNTJ7l-SaTZBI>=N`l~=CvEeE&8>aHASFBx-b*Ji% z`1hu9bw@t8R&_D*wV`VjYeNW_4R+vSl(0U2ERe6H``kiPuu({pE*T1-2Y`%y=~2@n zm+8H;=@duJ^SCXZa2Cf8ixoOKP1?*F^42tt2w9!c#k@?-n(pRE9Xa`LAjuwgxd%>S zdTBbyXwnSEpTkrUD_jh!=Xt`?EbUwjg$!3A2hyX3{d=8Yw@tOI;Al5rs}lwv_hMp zc(e{FELCaAVh5t66~Lh#a+)9S4&w)>Ap~G?zcXlfC5`r;pbNPv(U_{t7HCDPa$9hw zxPP5E^?;e1{Pfm!4w-V8&estBaR9>o1|qx|Ag(sD$Qx6DB}*Wz9=G0uSA4(`J>qK2 zEKndbU-#x8b!_#!Z^y6NRDmMZ?3X59OTFaRTQOZ3=dEtws89!&?;osffZs`}4csA( zu>-xUZu^>owrS)-b=x;o%EG*bmlu+YQWiCE>S=ucP!`8{3O=9oANf$$l*HE?J4_is zKM*SdiqKFRv7dO1&ppe_I3n6tQO1d)p$C-6=rYbLI?Ave)*_SN&bXar2R)5U8=M|7 znJ+uDZbNxwipL$)=ghK#rVXF8G>ZUD@wk2a!VDwW9Q{E}fK6^Vs2OQ9vYvR4JE||l zFbq7fX__V7v|zyCx|ezYFuo?Bg8f=BA|Y8hH3>0 zyT_Dn=m9&bS`i60e1EdqpBB(Tz>lYWh$8D`)f>e56&Ov})bdQIebARh zOVg%j@|MiYAWb8OP2mWmmLm*iO_yC{7!os;BYdGO<;$`PSsmyd3-%762IMZ`HCw#I zUzfYk5v*1T!JY)r<8-TWU(E_kndpKP*QUw~k>;2>d<%81& zicQdR$)zSWbPTMhpifDw6Flw`PXbtj5j1!@GBK*iDMsGShb2qdM1i0O1G^-0uJ=%=N|^IfjP6vX1bZFY})NiXT5NK^9D#-#?OJiZwEMi=PcvYyixXnwIT zHpCYd=mq&m`Lms;;^&Bi@d+o1QB)Dw2Ae(JG9ShjsII}d&G~0QQ!)FbiTrFEnz#4eRt;eo&KdPXx;NeoAA9S2n+<&9J6K zgGI9e+SZj!rTIM|Wn#ygaJ6$>=$faXCkXiGm$PREjRUW0vHCK4>b{01&e zE@pkD>Nd=O1nVm4+*n#q5LeG1Y@+ncT-Iz{Y{i{H_nQ5l70K z_966D<|TDY^DLSuriwi7Z~Bn(mc5B7glk9N=Gy-%lp{PY zL3kl|k-{Q`cBC4U29g*$Fw`$yb_`R2h6-R67)1xv2ZU4Mh@JK#+A=mGshKLKK-yAY zL|bDEO!8meIR{!@+|#mvf;GL<7X~^6zW#vT(BRsN`=J)j1=tT?16@9^txj5j}uwl&+}K@NTGc|nt7|92o}VI%bI+=>@SiQncW{dKTg0*k=9t4l;#SEGoDw?}}4l9d=xC@kSX zt6GIr6Kr8ni!>U?$4+xQF%)Fc6km>1UYPqANE93WY_L zErnU}eQ%|oXA~9*zA?uTxkB>;0@=+qwt4(3oztU?Po|Gp%HrfX zw%kGCrCg)`pS*&>ir&dv*QMXx4bB2oce~_|ZFp~R* zO=|OeYGg|W7};9Tc0$rqLqw?ALnd-RX*tzDqDGE6_Gko+wN<1UDa7Wxtzv~)qx@NF zRa8zghzbhyzSf|0p*0uyGrMXhbD}fFxV!#p5a#q2oZ}uF^XiXurf4^CsHLDDDb~YX zW9pD|U_EVIOVl)R&ka76v!viWGukj5xbD->_02tE>l^`2X9MSj)>nLwH247DMb=Si zLBYO?3*6&Gfx?llmBWT=lb%=gbMYuo*CL%Tn&Wfv|uddxo^G!7&K zQ>xpnCZEn-8Q34C-KLY=gjn7;>@`_IM};&}s@W~31&cA2x^0tbAJpwLDB%{nxBq5Z zpkG)llb;0p`F?j(>uI><%~dqDo`EzS(zB4xS8O-T*>k;h)@Y2{3e-G&I!~@a3gPY% zw2{R~!n~9<&H9GhnDM;wCTE%|bkf6>5LI}_!`+=j%4N2F5KH!{l5Htqua-lN+P229 zKl#mO4Ly+-M`-RMMK17(Fq1BfJnfSBie04mCp%$XaAKnzg$9D<+}6FDdn0>|SnYbc zzKK)j*MJ8>?62!`CcCd97ju5tPL&TB^Dz<(r!Ti{R82=;P3 zu16$jl0>W7f$L}Y-+hr1v6>BijFsNYoZztWZX%{!R2KT=4goDMR2DI<_ORo zq-1T?8u5O-xiVSQT&-!fV{eI^Nuk>{|7^q*g^bXZtvvw|kG=6d-6=?~Hzv^&Xz|D$ zKR0rDF;(0)40mPIe2b*9P=hz`Pkz`8sU3H!6@{9+4lIU@W#B$DryD8v+(zN`EyXUG zmrOpDmH-DN-QJcc@Zr1dQme>Z#|2GM4YMSF;V5=_V-a*}h>t7YYYg=3>`J03`4sS2 zZCzpDTSn4jz_*w{4stqHm3vukb12%P$>~^DKBiQq3onAGEpj_|lk(>T3EP2Bqf2K7 z&zfDvHBnmzBld@`LTDRP+=%#7xWt#Ddun)2X1Bn7@Q*lp&)W#+?eBla4!pn3g7_f= zVhPV(395_&Uu=9Q$!|Ww-x7~#Is!NGFw+?Gd-Rx6%h=f&f7+|~F(?&LsBMb?AVN)@j<2p8#tmWScq!^DeR~Z?HEye*@%vI*d_T0+< zd5Xv36hnF?(TN?(<4Eyst5@7yhA_`zAQn9>w1AzS4sS)FD3re)V%-?@`%8ITX4~qr zU0B>$`*KDzB(Xz!e1O4M-oQPM@-f(25m-L{g_5u|aJxsrE9D1Y(b0PD(aXC8A4~Bu z7B8c`tnzlc8s6qMtqz2jH#h?MTF#>f9pVEimMHAM6;C-l`kH?79h#hj;L(a}M~u_nO*l=>b`9>C*Q#8Ez}-m1lJ)TVH6g4X-UY4!$FFhC*?OGzhp1$M_jvjrun~3;o><|-g!~Wui(uJ&ioq}Z5wR~z#NwCj1ocNc z?T`L7kpAndm0`873i*Q}M}fb5`9R)Z&D)Y!?f+Z)>iK-)%-zqbLt`qxn*8JVo$sa} zJCGT>@zTt~5T(zjJ30gK_?lZ6apKP{-dn~urk1;Yd-BHTj_uF5Z2qx8t# z2RnRMo{1bwjW@mdVvXhF`+{W?w3kH^N8W28y?3ogsw~E!Re#>{;o5UMl0FE!_x;+B zYE>KArp9^UUj@#QMxQ!9>-{vzhZdh4b8X?E0SR}<-FSXs@GsW+E@H(_QAH)IZ8R*C zFE{^Pb~dia%*@S_J92mZ^zq*Jrgg_nyBhV=*`H6gth>2zZLC21{t?T}woR*kN&ar! z#ggYOy+iXhluUd-E9iir<>950^0_{_5?1z)yW;}i^=_L`KI++%@4t%h8vbz19eVNS zo43q3n*YUb?zmZ5x5KN7*Ss!WeK_p=>&q|v`ZT3=$~ZFN*UL+OOfk=VsCGyG>DeLG zI^D`;B?*OJu6md$`7711?bDBYw8y1Aa|fJqF2>*d!g0DHa!1UMzwe!$z3$l$`G1w< zjh}}ksgf4Qjs>$0ylSA4X_ zy>9B(N8djx`tU&Y+-+~icV^emdHda84&)?!d~i+9lZ>3ByWaoxPJHd)cEiV0@6frY aOX=pJ+=kw7SL#0dc~SP73%^%zf&UFmw4W~k literal 0 HcmV?d00001 diff --git a/scripts/tools/silabs/ota/examples/ota_custom_entries_example.json b/scripts/tools/silabs/ota/examples/ota_custom_entries_example.json new file mode 100644 index 00000000000000..8f679a266da9bd --- /dev/null +++ b/scripts/tools/silabs/ota/examples/ota_custom_entries_example.json @@ -0,0 +1,67 @@ +{ + "inputs": [ + { + "tag": 8, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1003 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + }, + { + "tag": 9, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1004 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion2" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + }, + { + "tag": 10, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1005 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion3" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + } + ] +} diff --git a/scripts/tools/silabs/ota/examples/ota_custom_entries_example2.json b/scripts/tools/silabs/ota/examples/ota_custom_entries_example2.json new file mode 100644 index 00000000000000..3b910f2d163156 --- /dev/null +++ b/scripts/tools/silabs/ota/examples/ota_custom_entries_example2.json @@ -0,0 +1,88 @@ +{ + "inputs": [ + { + "tag": 8, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1003 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + }, + { + "tag": 9, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1004 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion2" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + }, + { + "tag": 10, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1005 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion3" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + }, + { + "tag": 11, + "descriptor": [ + { + "name": "binary_version", + "length": 4, + "value": 1006 + }, + { + "name": "binary_version_str", + "length": 64, + "value": "TestVersion4" + }, + { + "name": "build_date", + "length": 64, + "value": "2024-03-25" + } + ], + "path": "./binaries/ext_flash_ota_entry_example.bin" + } + ] +} diff --git a/scripts/tools/silabs/ota/ota_multi_image_tool.py b/scripts/tools/silabs/ota/ota_multi_image_tool.py index 64715d784aeecd..280c80ea516a5d 100755 --- a/scripts/tools/silabs/ota/ota_multi_image_tool.py +++ b/scripts/tools/silabs/ota/ota_multi_image_tool.py @@ -50,7 +50,6 @@ from chip.tlv import TLVWriter # noqa: E402 isort:skip from custom import CertDeclaration, DacCert, DacPKey, PaiCert # noqa: E402 isort:skip from default import InputArgument # noqa: E402 isort:skip -from generate import set_logger # noqa: E402 isort:skip OTA_APP_TLV_TEMP = os.path.join(os.path.dirname(__file__), "ota_temp_app_tlv.bin") OTA_BOOTLOADER_TLV_TEMP = os.path.join(os.path.dirname(__file__), "ota_temp_ssbl_tlv.bin") @@ -65,6 +64,15 @@ class TAG: FACTORY_DATA = 3 +def set_logger(): + stdout_handler = logging.StreamHandler(stream=sys.stdout) + logging.basicConfig( + level=logging.DEBUG, + format='[%(levelname)s] %(message)s', + handlers=[stdout_handler] + ) + + def write_to_temp(path: str, payload: bytearray): with open(path, "wb") as _handle: _handle.write(payload) diff --git a/scripts/tools/silabs/ota/requirements.txt b/scripts/tools/silabs/ota/requirements.txt new file mode 100644 index 00000000000000..9d440c9c5b780b --- /dev/null +++ b/scripts/tools/silabs/ota/requirements.txt @@ -0,0 +1 @@ +jsonschema>=3.2.0 diff --git a/src/platform/silabs/efr32/BUILD.gn b/src/platform/silabs/efr32/BUILD.gn index 5d661886d54f21..a71a0cd8b335e6 100644 --- a/src/platform/silabs/efr32/BUILD.gn +++ b/src/platform/silabs/efr32/BUILD.gn @@ -78,14 +78,29 @@ static_library("efr32") { } if (chip_enable_multi_ota_requestor) { + if (chip_enable_multi_ota_encryption) { + sources += [ + "${silabs_platform_dir}/multi-ota/OtaTlvEncryptionKey.cpp", + "${silabs_platform_dir}/multi-ota/OtaTlvEncryptionKey.h", + ] + } + + if (chip_enable_ota_custom_tlv_testing) { + sources += [ + "${silabs_platform_dir}/multi-ota/OTACustomProcessor.cpp", + "${silabs_platform_dir}/multi-ota/OTACustomProcessor.h", + ] + } sources += [ + "${silabs_platform_dir}/multi-ota/OTAFactoryDataProcessor.cpp", + "${silabs_platform_dir}/multi-ota/OTAFactoryDataProcessor.h", + "${silabs_platform_dir}/multi-ota/OTAFirmwareProcessor.cpp", + "${silabs_platform_dir}/multi-ota/OTAFirmwareProcessor.h", + "${silabs_platform_dir}/multi-ota/OTAHooks.cpp", "${silabs_platform_dir}/multi-ota/OTAMultiImageProcessorImpl.cpp", "${silabs_platform_dir}/multi-ota/OTAMultiImageProcessorImpl.h", "${silabs_platform_dir}/multi-ota/OTATlvProcessor.cpp", "${silabs_platform_dir}/multi-ota/OTATlvProcessor.h", - "${silabs_platform_dir}/multi-ota/efr32/OTAFirmwareProcessor.cpp", - "${silabs_platform_dir}/multi-ota/efr32/OTAFirmwareProcessor.h", - "${silabs_platform_dir}/multi-ota/efr32/OTAHooks.cpp", ] } else if (chip_enable_ota_requestor) { sources += [ diff --git a/src/platform/silabs/efr32/efr32-psa-crypto-config.h b/src/platform/silabs/efr32/efr32-psa-crypto-config.h index b5564f88bd3258..b389431f85ec0b 100644 --- a/src/platform/silabs/efr32/efr32-psa-crypto-config.h +++ b/src/platform/silabs/efr32/efr32-psa-crypto-config.h @@ -30,5 +30,10 @@ #define PSA_WANT_ALG_CBC_NO_PADDING #endif // SL_USE_COAP_CONFIG +// Multi-chip OTA encryption processing +#if OTA_ENCRYPTION_ENABLE +#define PSA_WANT_ALG_CTR +#endif // OTA_ENCRYPTION_ENABLE + // Include Generated fies #include "psa_crypto_config.h" diff --git a/src/platform/silabs/multi-ota/OTACustomProcessor.cpp b/src/platform/silabs/multi-ota/OTACustomProcessor.cpp new file mode 100644 index 00000000000000..85ceb7d44d4eaf --- /dev/null +++ b/src/platform/silabs/multi-ota/OTACustomProcessor.cpp @@ -0,0 +1,94 @@ +/* + * + * Copyright (c) 2023 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 +#include +#include + +#include + +extern "C" { +#include "btl_interface.h" +#include "em_bus.h" // For CORE_CRITICAL_SECTION +#if SL_WIFI +#include "spi_multiplex.h" +#endif // SL_WIFI +} + +/// No error, operation OK +#define SL_BOOTLOADER_OK 0L + +namespace chip { + +// Define static memebers +uint8_t OTACustomProcessor::mSlotId = 0; +uint32_t OTACustomProcessor::mWriteOffset = 0; +uint16_t OTACustomProcessor::writeBufOffset = 0; +uint8_t OTACustomProcessor::writeBuffer[kAlignmentBytes] __attribute__((aligned(4))) = { 0 }; + +CHIP_ERROR OTACustomProcessor::Init() +{ + ReturnErrorCodeIf(mCallbackProcessDescriptor == nullptr, CHIP_OTA_PROCESSOR_CB_NOT_REGISTERED); + mAccumulator.Init(sizeof(Descriptor)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTACustomProcessor::Clear() +{ + OTATlvProcessor::ClearInternal(); + mAccumulator.Clear(); + mDescriptorProcessed = false; + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTACustomProcessor::ProcessInternal(ByteSpan & block) +{ + if (!mDescriptorProcessed) + { + ReturnErrorOnFailure(ProcessDescriptor(block)); + } + + ChipLogError(SoftwareUpdate, "Reached Custom Processor"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTACustomProcessor::ProcessDescriptor(ByteSpan & block) +{ + ReturnErrorOnFailure(mAccumulator.Accumulate(block)); + ReturnErrorOnFailure(mCallbackProcessDescriptor(static_cast(mAccumulator.data()))); + + mDescriptorProcessed = true; + mAccumulator.Clear(); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTACustomProcessor::ApplyAction() +{ + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTACustomProcessor::FinalizeAction() +{ + return CHIP_NO_ERROR; +} + +} // namespace chip diff --git a/src/platform/silabs/multi-ota/OTACustomProcessor.h b/src/platform/silabs/multi-ota/OTACustomProcessor.h new file mode 100644 index 00000000000000..64610f4b41fa37 --- /dev/null +++ b/src/platform/silabs/multi-ota/OTACustomProcessor.h @@ -0,0 +1,56 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { + +class OTACustomProcessor : public OTATlvProcessor +{ +public: + struct Descriptor + { + uint32_t version; + char versionString[kVersionStringSize]; + char buildDate[kBuildDateSize]; + }; + + CHIP_ERROR Init() override; + CHIP_ERROR Clear() override; + CHIP_ERROR ApplyAction() override; + CHIP_ERROR FinalizeAction() override; + +private: + CHIP_ERROR ProcessInternal(ByteSpan & block) override; + CHIP_ERROR ProcessDescriptor(ByteSpan & block); + + OTADataAccumulator mAccumulator; + bool mDescriptorProcessed = false; + static constexpr size_t kAlignmentBytes = 64; + static uint32_t mWriteOffset; // End of last written block + static uint8_t mSlotId; // Bootloader storage slot + // Bootloader storage API requires the buffer size to be a multiple of 4. + static uint8_t writeBuffer[kAlignmentBytes] __attribute__((aligned(4))); + // Offset indicates how far the write buffer has been filled + static uint16_t writeBufOffset; +}; + +} // namespace chip diff --git a/src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp b/src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp new file mode 100644 index 00000000000000..8d38207df35542 --- /dev/null +++ b/src/platform/silabs/multi-ota/OTAFactoryDataProcessor.cpp @@ -0,0 +1,170 @@ +/* + * + * Copyright (c) 2023 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 +#include +#include + +namespace chip { + +using FactoryProvider = DeviceLayer::Silabs::Provision::Storage; + +CHIP_ERROR OTAFactoryDataProcessor::Init() +{ + mAccumulator.Init(mLength); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAFactoryDataProcessor::Clear() +{ + OTATlvProcessor::ClearInternal(); + mAccumulator.Clear(); + mPayload.Clear(); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAFactoryDataProcessor::ProcessInternal(ByteSpan & block) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + + ReturnErrorOnFailure(mAccumulator.Accumulate(block)); +#if OTA_ENCRYPTION_ENABLE + MutableByteSpan mBlock = MutableByteSpan(mAccumulator.data(), mAccumulator.GetThreshold()); + OTATlvProcessor::vOtaProcessInternalEncryption(mBlock); +#endif + error = DecodeTlv(); + + if (error != CHIP_NO_ERROR) + { + // The factory data payload can contain a variable number of fields + // to be updated. CHIP_END_OF_TLV is returned if no more fields are + // found. + if (error == CHIP_END_OF_TLV) + { + return CHIP_NO_ERROR; + } + + Clear(); + } + + return error; +} + +CHIP_ERROR OTAFactoryDataProcessor::ApplyAction() +{ + CHIP_ERROR error = CHIP_NO_ERROR; + + SuccessOrExit(error = Update((uint8_t) FactoryTags::kDacKey, mPayload.mCertDacKey)); + SuccessOrExit(error = Update((uint8_t) FactoryTags::kDacCert, mPayload.mCertDac)); + SuccessOrExit(error = Update((uint8_t) FactoryTags::kPaiCert, mPayload.mCertPai)); + SuccessOrExit(error = Update((uint8_t) FactoryTags::kCdCert, mPayload.mCertDeclaration)); + +exit: + if (error != CHIP_NO_ERROR) + { + ChipLogError(SoftwareUpdate, "Failed to update factory data. Error: %s", ErrorStr(error)); + } + else + { + ChipLogProgress(SoftwareUpdate, "Factory data update finished."); + } + + return error; +} + +CHIP_ERROR OTAFactoryDataProcessor::FinalizeAction() +{ + ChipLogProgress(SoftwareUpdate, "Finalize Action\n"); + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAFactoryDataProcessor::DecodeTlv() +{ + TLV::TLVReader tlvReader; + tlvReader.Init(mAccumulator.data(), mLength); + ReturnErrorOnFailure(tlvReader.Next(TLV::TLVType::kTLVType_Structure, TLV::AnonymousTag())); + + TLV::TLVType outerType; + ReturnErrorOnFailure(tlvReader.EnterContainer(outerType)); + ReturnErrorOnFailure(tlvReader.Next()); + + if (tlvReader.GetTag() == TLV::ContextTag((uint8_t) FactoryTags::kDacKey)) + { + ReturnErrorOnFailure(tlvReader.Get(mPayload.mCertDacKey.Emplace())); + ReturnErrorOnFailure(tlvReader.Next()); + } + + if (tlvReader.GetTag() == TLV::ContextTag((uint8_t) FactoryTags::kDacCert)) + { + ReturnErrorOnFailure(tlvReader.Get(mPayload.mCertDac.Emplace())); + ReturnErrorOnFailure(tlvReader.Next()); + } + + if (tlvReader.GetTag() == TLV::ContextTag((uint8_t) FactoryTags::kPaiCert)) + { + ReturnErrorOnFailure(tlvReader.Get(mPayload.mCertPai.Emplace())); + ReturnErrorOnFailure(tlvReader.Next()); + } + + if (tlvReader.GetTag() == TLV::ContextTag((uint8_t) FactoryTags::kCdCert)) + { + ReturnErrorOnFailure(tlvReader.Get(mPayload.mCertDeclaration.Emplace())); + } + + ReturnErrorOnFailure(tlvReader.ExitContainer(outerType)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OTAFactoryDataProcessor::Update(uint8_t tag, Optional & optional) +{ + CHIP_ERROR error = CHIP_NO_ERROR; + if (optional.HasValue()) + { + error = UpdateValue(tag, optional.Value()); + } + + return error; +} + +CHIP_ERROR OTAFactoryDataProcessor::UpdateValue(uint8_t tag, ByteSpan & newValue) +{ + FactoryProvider factoryProvider; + switch (tag) + { + case (int) FactoryTags::kDacKey: + ChipLogProgress(SoftwareUpdate, "Set Device Attestation Key"); + return factoryProvider.FactoryProvider::SetDeviceAttestationKey(newValue); + case (int) FactoryTags::kDacCert: + ChipLogProgress(SoftwareUpdate, "Set Device Attestation Cert"); + return factoryProvider.FactoryProvider::SetDeviceAttestationCert(newValue); + case (int) FactoryTags::kPaiCert: + ChipLogProgress(SoftwareUpdate, "Set Product Attestionation Intermediate Cert"); + return factoryProvider.FactoryProvider::SetProductAttestationIntermediateCert(newValue); + case (int) FactoryTags::kCdCert: + ChipLogProgress(SoftwareUpdate, "Set Certification Declaration"); + return factoryProvider.FactoryProvider::SetCertificationDeclaration(newValue); + } + + ChipLogError(DeviceLayer, "Failed to find tag %d.", tag); + return CHIP_ERROR_NOT_FOUND; +} + +} // namespace chip diff --git a/src/platform/silabs/multi-ota/OTAFactoryDataProcessor.h b/src/platform/silabs/multi-ota/OTAFactoryDataProcessor.h new file mode 100644 index 00000000000000..f7fd106de17220 --- /dev/null +++ b/src/platform/silabs/multi-ota/OTAFactoryDataProcessor.h @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include // nogncheck +#include // nogncheck + +namespace chip { + +/** + * OTA custom payload that uses Matter TLVs. + * The custom payload is used when factory data needs updating. + * Factory data will be encoded using Matter TLV format to make + * use of the ChipTlv reader. A payload contains metadata (size of + * TLVs) and the TLVs themselves contained in a structure. + * If no factory data need to be updated, the metadata will be 0 + */ +struct OTAFactoryPayload +{ + Optional mCertDacKey; + Optional mCertDac; + Optional mCertPai; + Optional mCertDeclaration; + + void Clear() + { + mCertDacKey.ClearValue(); + mCertDac.ClearValue(); + mCertPai.ClearValue(); + mCertDeclaration.ClearValue(); + } +}; + +enum class FactoryTags +{ + kDacKey = 1, + kDacCert = 2, + kPaiCert = 3, + kCdCert = 4 +}; + +class OTAFactoryDataProcessor : public OTATlvProcessor +{ +public: + CHIP_ERROR Init() override; + CHIP_ERROR Clear() override; + CHIP_ERROR ApplyAction() override; + CHIP_ERROR FinalizeAction() override; + +private: + CHIP_ERROR ProcessInternal(ByteSpan & block) override; + CHIP_ERROR DecodeTlv(); + CHIP_ERROR Update(uint8_t tag, Optional & optional); + CHIP_ERROR UpdateValue(uint8_t tag, ByteSpan & newValue); + + OTAFactoryPayload mPayload; + OTADataAccumulator mAccumulator; + uint8_t * mFactoryData = nullptr; +}; + +} // namespace chip diff --git a/src/platform/silabs/multi-ota/efr32/OTAFirmwareProcessor.cpp b/src/platform/silabs/multi-ota/OTAFirmwareProcessor.cpp similarity index 84% rename from src/platform/silabs/multi-ota/efr32/OTAFirmwareProcessor.cpp rename to src/platform/silabs/multi-ota/OTAFirmwareProcessor.cpp index fdf4c3d0321262..3fc66e53913b87 100644 --- a/src/platform/silabs/multi-ota/efr32/OTAFirmwareProcessor.cpp +++ b/src/platform/silabs/multi-ota/OTAFirmwareProcessor.cpp @@ -17,8 +17,8 @@ */ #include +#include #include -#include #include @@ -32,8 +32,6 @@ extern "C" { /// No error, operation OK #define SL_BOOTLOADER_OK 0L -// TODO: more descriptive error codes -#define SL_OTA_ERROR 1L namespace chip { @@ -72,7 +70,33 @@ CHIP_ERROR OTAFirmwareProcessor::ProcessInternal(ByteSpan & block) if (!mDescriptorProcessed) { ReturnErrorOnFailure(ProcessDescriptor(block)); +#if OTA_ENCRYPTION_ENABLE + /* 16 bytes to used to store undecrypted data because of unalignment */ + mAccumulator.Init(requestedOtaMaxBlockSize + 16); +#endif + } +#if OTA_ENCRYPTION_ENABLE + MutableByteSpan mBlock = MutableByteSpan(mAccumulator.data(), mAccumulator.GetThreshold()); + memcpy(&mBlock[0], &mBlock[requestedOtaMaxBlockSize], mUnalignmentNum); + memcpy(&mBlock[mUnalignmentNum], block.data(), block.size()); + + if (mUnalignmentNum + block.size() < requestedOtaMaxBlockSize) + { + uint32_t mAlignmentNum = (mUnalignmentNum + block.size()) / 16; + mAlignmentNum = mAlignmentNum * 16; + mUnalignmentNum = (mUnalignmentNum + block.size()) % 16; + memcpy(&mBlock[requestedOtaMaxBlockSize], &mBlock[mAlignmentNum], mUnalignmentNum); + mBlock.reduce_size(mAlignmentNum); } + else + { + mUnalignmentNum = mUnalignmentNum + block.size() - requestedOtaMaxBlockSize; + mBlock.reduce_size(requestedOtaMaxBlockSize); + } + + OTATlvProcessor::vOtaProcessInternalEncryption(mBlock); + block = mBlock; +#endif uint32_t blockReadOffset = 0; while (blockReadOffset < block.size()) @@ -88,7 +112,7 @@ CHIP_ERROR OTAFirmwareProcessor::ProcessInternal(ByteSpan & block) if (err != SL_STATUS_OK) { ChipLogError(SoftwareUpdate, "sl_wfx_host_pre_bootloader_spi_transfer() error: %ld", err); - return; + return CHIP_ERROR_CANCELLED; } #endif // SL_BTLCTRL_MUX CORE_CRITICAL_SECTION(err = bootloader_eraseWriteStorage(mSlotId, mWriteOffset, writeBuffer, kAlignmentBytes);) @@ -97,15 +121,12 @@ CHIP_ERROR OTAFirmwareProcessor::ProcessInternal(ByteSpan & block) if (err != SL_STATUS_OK) { ChipLogError(SoftwareUpdate, "sl_wfx_host_post_bootloader_spi_transfer() error: %ld", err); - return; + return CHIP_ERROR_CANCELLED; } #endif // SL_BTLCTRL_MUX if (err) { ChipLogError(SoftwareUpdate, "bootloader_eraseWriteStorage() error: %ld", err); - // TODO: add this somewhere - // imageProcessor->mDownloader->EndDownload(CHIP_ERROR_WRITE_FAILED); - // TODO: Replace CHIP_ERROR_CANCELLED with new error statement return CHIP_ERROR_CANCELLED; } mWriteOffset += kAlignmentBytes; diff --git a/src/platform/silabs/multi-ota/efr32/OTAFirmwareProcessor.h b/src/platform/silabs/multi-ota/OTAFirmwareProcessor.h similarity index 100% rename from src/platform/silabs/multi-ota/efr32/OTAFirmwareProcessor.h rename to src/platform/silabs/multi-ota/OTAFirmwareProcessor.h diff --git a/src/platform/silabs/multi-ota/efr32/OTAHooks.cpp b/src/platform/silabs/multi-ota/OTAHooks.cpp similarity index 52% rename from src/platform/silabs/multi-ota/efr32/OTAHooks.cpp rename to src/platform/silabs/multi-ota/OTAHooks.cpp index cddb66980c27f9..6be17441be473f 100644 --- a/src/platform/silabs/multi-ota/efr32/OTAHooks.cpp +++ b/src/platform/silabs/multi-ota/OTAHooks.cpp @@ -21,7 +21,12 @@ #include -#include +#include +#include + +#if OTA_TEST_CUSTOM_TLVS +#include +#endif CHIP_ERROR chip::OTAMultiImageProcessorImpl::ProcessDescriptor(void * descriptor) { @@ -34,11 +39,29 @@ CHIP_ERROR chip::OTAMultiImageProcessorImpl::ProcessDescriptor(void * descriptor CHIP_ERROR chip::OTAMultiImageProcessorImpl::OtaHookInit() { static chip::OTAFirmwareProcessor sApplicationProcessor; + static chip::OTAFactoryDataProcessor sFactoryDataProcessor; sApplicationProcessor.RegisterDescriptorCallback(ProcessDescriptor); + sFactoryDataProcessor.RegisterDescriptorCallback(ProcessDescriptor); auto & imageProcessor = chip::OTAMultiImageProcessorImpl::GetDefaultInstance(); - ReturnErrorOnFailure(imageProcessor.RegisterProcessor(1, &sApplicationProcessor)); + ReturnErrorOnFailure( + imageProcessor.RegisterProcessor(static_cast(OTAProcessorTag::kApplicationProcessor), &sApplicationProcessor)); + ReturnErrorOnFailure( + imageProcessor.RegisterProcessor(static_cast(OTAProcessorTag::kFactoryDataProcessor), &sFactoryDataProcessor)); + +#if OTA_TEST_CUSTOM_TLVS + static chip::OTACustomProcessor customProcessor1; + static chip::OTACustomProcessor customProcessor2; + static chip::OTACustomProcessor customProcessor3; + + customProcessor1.RegisterDescriptorCallback(ProcessDescriptor); + customProcessor2.RegisterDescriptorCallback(ProcessDescriptor); + customProcessor3.RegisterDescriptorCallback(ProcessDescriptor); + ReturnErrorOnFailure(imageProcessor.RegisterProcessor(8, &customProcessor1)); + ReturnErrorOnFailure(imageProcessor.RegisterProcessor(9, &customProcessor2)); + ReturnErrorOnFailure(imageProcessor.RegisterProcessor(10, &customProcessor3)); +#endif return CHIP_NO_ERROR; } diff --git a/src/platform/silabs/multi-ota/OTAMultiImageProcessorImpl.cpp b/src/platform/silabs/multi-ota/OTAMultiImageProcessorImpl.cpp index 147dcdaf8317ee..9dfb42fc879c4b 100644 --- a/src/platform/silabs/multi-ota/OTAMultiImageProcessorImpl.cpp +++ b/src/platform/silabs/multi-ota/OTAMultiImageProcessorImpl.cpp @@ -420,9 +420,6 @@ void OTAMultiImageProcessorImpl::HandleApply(intptr_t context) ChipLogProgress(SoftwareUpdate, "HandleApply: Finished"); - // TODO: check where to put this - // ConfigurationManagerImpl().StoreSoftwareUpdateCompleted(); - // This reboots the device CORE_CRITICAL_SECTION(bootloader_rebootAndInstall();) } diff --git a/src/platform/silabs/multi-ota/OTATlvProcessor.cpp b/src/platform/silabs/multi-ota/OTATlvProcessor.cpp index a5da7eaba00c10..91a748c077ec79 100644 --- a/src/platform/silabs/multi-ota/OTATlvProcessor.cpp +++ b/src/platform/silabs/multi-ota/OTATlvProcessor.cpp @@ -23,9 +23,12 @@ #include #include #if OTA_ENCRYPTION_ENABLE -#include "OtaUtils.h" -#include "rom_aes.h" +#include +#include #endif + +using namespace ::chip::DeviceLayer::Internal; + namespace chip { #if OTA_ENCRYPTION_ENABLE @@ -105,65 +108,10 @@ CHIP_ERROR OTADataAccumulator::Accumulate(ByteSpan & block) #if OTA_ENCRYPTION_ENABLE CHIP_ERROR OTATlvProcessor::vOtaProcessInternalEncryption(MutableByteSpan & block) { - uint8_t iv[16]; - uint8_t key[kOTAEncryptionKeyLength]; - uint8_t dataOut[16] = { 0 }; - uint32_t u32IVCount; - uint32_t Offset = 0; - uint8_t data; - tsReg128 sKey; - aesContext_t Context; - - memcpy(iv, au8Iv, sizeof(au8Iv)); - - u32IVCount = (((uint32_t) iv[12]) << 24) | (((uint32_t) iv[13]) << 16) | (((uint32_t) iv[14]) << 8) | (iv[15]); - u32IVCount += (mIVOffset >> 4); - - iv[12] = (uint8_t) ((u32IVCount >> 24) & 0xff); - iv[13] = (uint8_t) ((u32IVCount >> 16) & 0xff); - iv[14] = (uint8_t) ((u32IVCount >> 8) & 0xff); - iv[15] = (uint8_t) (u32IVCount & 0xff); - - if (Encoding::HexToBytes(OTA_ENCRYPTION_KEY, strlen(OTA_ENCRYPTION_KEY), key, kOTAEncryptionKeyLength) != - kOTAEncryptionKeyLength) - { - // Failed to convert the OTAEncryptionKey string to octstr type value - return CHIP_ERROR_INVALID_STRING_LENGTH; - } - - ByteSpan KEY = ByteSpan(key); - Encoding::LittleEndian::Reader reader_key(KEY.data(), KEY.size()); - ReturnErrorOnFailure(reader_key.Read32(&sKey.u32register0) - .Read32(&sKey.u32register1) - .Read32(&sKey.u32register2) - .Read32(&sKey.u32register3) - .StatusCode()); - - while (Offset + 16 <= block.size()) - { - /*Encrypt the IV*/ - Context.mode = AES_MODE_ECB_ENCRYPT; - Context.pSoftwareKey = (uint32_t *) &sKey; - AES_128_ProcessBlocks(&Context, (uint32_t *) &iv[0], (uint32_t *) &dataOut[0], 1); - - /* Decrypt a block of the buffer */ - for (uint8_t i = 0; i < 16; i++) - { - data = block[Offset + i] ^ dataOut[i]; - memcpy(&block[Offset + i], &data, sizeof(uint8_t)); - } - - /* increment the IV for the next block */ - u32IVCount++; - - iv[12] = (uint8_t) ((u32IVCount >> 24) & 0xff); - iv[13] = (uint8_t) ((u32IVCount >> 16) & 0xff); - iv[14] = (uint8_t) ((u32IVCount >> 8) & 0xff); - iv[15] = (uint8_t) (u32IVCount & 0xff); - - Offset += 16; /* increment the buffer offset */ - mIVOffset += 16; - } + uint32_t keyId; + SilabsConfig::ReadConfigValue(SilabsConfig::kOtaTlvEncryption_KeyId, keyId); + chip::DeviceLayer::Silabs::OtaTlvEncryptionKey::OtaTlvEncryptionKey key(keyId); + key.Decrypt(block, mIVOffset); return CHIP_NO_ERROR; } diff --git a/src/platform/silabs/multi-ota/OTATlvProcessor.h b/src/platform/silabs/multi-ota/OTATlvProcessor.h index 9e8e56a2b35825..fe2070b75e5634 100644 --- a/src/platform/silabs/multi-ota/OTATlvProcessor.h +++ b/src/platform/silabs/multi-ota/OTATlvProcessor.h @@ -43,6 +43,8 @@ namespace chip { #define CHIP_OTA_PROCESSOR_START_IMAGE CHIP_ERROR_TLV_PROCESSOR(0x0E) #define SL_GENERIC_OTA_ERROR CHIP_ERROR_TLV_PROCESSOR(0x0E) +constexpr uint16_t requestedOtaMaxBlockSize = 1024; + // Descriptor constants inline constexpr size_t kVersionStringSize = 64; inline constexpr size_t kBuildDateSize = 64; @@ -60,6 +62,14 @@ struct OTATlvHeader uint32_t length; }; +// TLV tags synced with ota files generate by scripts/tools/silabs/ota/ota_image_tool.py +enum class OTAProcessorTag +{ + kApplicationProcessor = 1, + kBootloaderProcessor = 2, + kFactoryDataProcessor = 3 +}; + /** * This class defines an interface for a Matter TLV processor. * Instances of derived classes can be registered as processors diff --git a/src/platform/silabs/multi-ota/OtaTlvEncryptionKey.cpp b/src/platform/silabs/multi-ota/OtaTlvEncryptionKey.cpp new file mode 100644 index 00000000000000..10273e52f5a7a1 --- /dev/null +++ b/src/platform/silabs/multi-ota/OtaTlvEncryptionKey.cpp @@ -0,0 +1,130 @@ +#include "OtaTlvEncryptionKey.h" +#include +#include +#include +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace Silabs { +namespace OtaTlvEncryptionKey { + +using SilabsConfig = chip::DeviceLayer::Internal::SilabsConfig; + +int destroyAESKey(uint32_t kid) +{ + psa_key_handle_t key_handle; + + int err = psa_open_key(kid, &key_handle); + if (err) + { + psa_close_key(kid); + } + else + { + err = psa_destroy_key(kid); + } + return err; +} + +CHIP_ERROR OtaTlvEncryptionKey::Import(const uint8_t * key, size_t key_len) +{ + destroyAESKey(mId); + + psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; + psa_status_t status; + + psa_key_id_t key_id; + psa_set_key_id(&attributes, mId); + psa_set_key_type(&attributes, PSA_KEY_TYPE_AES); + psa_set_key_bits(&attributes, 128); + psa_set_key_algorithm(&attributes, PSA_ALG_CTR); + psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_DECRYPT); + + status = psa_import_key(&attributes, key, key_len, &key_id); + if (status != PSA_SUCCESS) + { + printf("Failed to import a key error:%ld\n", status); + return CHIP_ERROR_INTERNAL; + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR OtaTlvEncryptionKey::Decrypt(MutableByteSpan & block, uint32_t & mIVOffset) +{ + constexpr uint8_t au8Iv[] = { 0x00, 0x00, 0x00, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x00, 0x00, 0x00, 0x00 }; + uint8_t iv[16]; + psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; + psa_status_t status; + uint8_t output[PSA_BLOCK_CIPHER_BLOCK_LENGTH(PSA_KEY_TYPE_AES)]; + size_t output_len; + size_t total_output; + uint32_t u32IVCount; + uint32_t Offset = 0; + + memcpy(iv, au8Iv, sizeof(au8Iv)); + + u32IVCount = (((uint32_t) iv[12]) << 24) | (((uint32_t) iv[13]) << 16) | (((uint32_t) iv[14]) << 8) | (iv[15]); + u32IVCount += (mIVOffset >> 4); + + iv[12] = (uint8_t) ((u32IVCount >> 24) & 0xff); + iv[13] = (uint8_t) ((u32IVCount >> 16) & 0xff); + iv[14] = (uint8_t) ((u32IVCount >> 8) & 0xff); + iv[15] = (uint8_t) (u32IVCount & 0xff); + + while (Offset + 16 <= block.size()) + { + status = psa_cipher_decrypt_setup(&operation, static_cast(mId), PSA_ALG_CTR); + if (status != PSA_SUCCESS) + { + printf("Failed to begin cipher operation error:%ld\n", status); + return CHIP_ERROR_INTERNAL; + } + + status = psa_cipher_set_iv(&operation, iv, sizeof(iv)); + if (status != PSA_SUCCESS) + { + printf("Failed to set IV error:%ld\n", status); + return CHIP_ERROR_INTERNAL; + } + + status = psa_cipher_update(&operation, static_cast(&block[Offset]), 16, output, sizeof(output), &output_len); + if (status != PSA_SUCCESS) + { + printf("Failed to update cipher operation error:%ld\n", status); + return CHIP_ERROR_INTERNAL; + } + + /* increment the IV for the next block */ + u32IVCount++; + + iv[12] = (uint8_t) ((u32IVCount >> 24) & 0xff); + iv[13] = (uint8_t) ((u32IVCount >> 16) & 0xff); + iv[14] = (uint8_t) ((u32IVCount >> 8) & 0xff); + iv[15] = (uint8_t) (u32IVCount & 0xff); + + memcpy((void *) &block[Offset], &output, output_len); + + Offset += 16; /* increment the buffer offset */ + mIVOffset += 16; + status = psa_cipher_finish(&operation, output + total_output, sizeof(output) - total_output, &total_output); + if (status != PSA_SUCCESS) + { + printf("Failed to finish cipher operation\n"); + return CHIP_ERROR_INTERNAL; + } + } + + printf("Decrypted ciphertext\n"); + + psa_cipher_abort(&operation); + + return CHIP_NO_ERROR; +} + +} // namespace OtaTlvEncryptionKey +} // namespace Silabs +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/silabs/multi-ota/OtaTlvEncryptionKey.h b/src/platform/silabs/multi-ota/OtaTlvEncryptionKey.h new file mode 100644 index 00000000000000..919e3b1285ac80 --- /dev/null +++ b/src/platform/silabs/multi-ota/OtaTlvEncryptionKey.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace Silabs { +namespace OtaTlvEncryptionKey { + +static constexpr uint32_t kAES_KeyId_Default = (PSA_KEY_ID_USER_MIN + 2); + +class OtaTlvEncryptionKey +{ +public: + OtaTlvEncryptionKey(uint32_t id = 0) { mId = (id > 0) ? id : kAES_KeyId_Default; } + ~OtaTlvEncryptionKey() = default; + + uint32_t GetId() { return mId; } + CHIP_ERROR Import(const uint8_t * key, size_t key_len); + CHIP_ERROR Decrypt(MutableByteSpan & block, uint32_t & mIVOffset); + +protected: + uint32_t mId = 0; +}; + +} // namespace OtaTlvEncryptionKey +} // namespace Silabs +} // namespace DeviceLayer +} // namespace chip diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 08695af1fc3800..ccbae7f1ec23ff 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -80,6 +80,8 @@ declare_args() { # Multi-chip OTA chip_enable_multi_ota_requestor = false + chip_enable_multi_ota_encryption = false + chip_enable_ota_custom_tlv_testing = false } examples_plat_dir = "${chip_root}/examples/platform/silabs/efr32" @@ -496,6 +498,14 @@ template("efr32_sdk") { ] } + if (chip_enable_multi_ota_encryption && chip_enable_multi_ota_requestor) { + defines += [ "OTA_ENCRYPTION_ENABLE=1" ] + } + + if (chip_enable_ota_custom_tlv_testing && chip_enable_multi_ota_requestor) { + defines += [ "OTA_TEST_CUSTOM_TLVS=1" ] + } + if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) { if (enable_dic) { assert(chip_enable_wifi_ipv4, "enable chip_enable_wifi_ipv4") From c7f5f65cb21e11af81626012e2be2dcb4c77ccf2 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:41:18 -0700 Subject: [PATCH 23/40] Add python tests for Thermostat presets feature (#34693) * Add python tests for Thermostat presets feature * Restyled by autopep8 * Restyled by isort * Update the PICS code for presets attribute --------- Co-authored-by: Restyled.io --- src/python_testing/TC_TSTAT_4_2.py | 348 +++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 src/python_testing/TC_TSTAT_4_2.py diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py new file mode 100644 index 00000000000000..5f53debfa024a0 --- /dev/null +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -0,0 +1,348 @@ +# +# 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. + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --endpoint 1 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import copy +import logging + +import chip.clusters as Clusters +from chip.clusters.Types import NullValue +from chip.interaction_model import InteractionModelError, Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + +logger = logging.getLogger(__name__) + +cluster = Clusters.Thermostat + + +initial_presets = [] +initial_presets.append(cluster.Structs.PresetStruct(presetHandle=b'\x01', presetScenario=cluster.Enums.PresetScenarioEnum.kOccupied, + name=None, coolingSetpoint=2500, heatingSetpoint=2100, builtIn=True)) +initial_presets.append(cluster.Structs.PresetStruct(presetHandle=b'\x02', presetScenario=cluster.Enums.PresetScenarioEnum.kUnoccupied, + name=None, coolingSetpoint=2600, heatingSetpoint=2000, builtIn=True)) + +new_presets = initial_presets.copy() +new_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=cluster.Enums.PresetScenarioEnum.kSleep, + name="Sleep", coolingSetpoint=2700, heatingSetpoint=1900, builtIn=False)) + +new_presets_with_handle = initial_presets.copy() +new_presets_with_handle.append(cluster.Structs.PresetStruct( + presetHandle=b'\x03', presetScenario=cluster.Enums.PresetScenarioEnum.kSleep, name="Sleep", coolingSetpoint=2700, heatingSetpoint=1900, builtIn=False)) + + +class TC_TSTAT_4_2(MatterBaseTest): + + async def write_presets(self, endpoint, presets) -> Status: + result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, cluster.Attributes.Presets(presets))]) + return result[0].Status + + async def send_edit_preset_request_command(self, + endpoint: int = None, + expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=cluster.Commands.StartPresetsSchedulesEditRequest(timeoutSeconds=180), + endpoint=endpoint) + asserts.assert_equal(expected_status, Status.Success) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_commit_preset_request_command(self, + endpoint: int = None, + expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=cluster.Commands.CommitPresetsSchedulesRequest(), + endpoint=endpoint) + asserts.assert_equal(expected_status, Status.Success) + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_cancel_preset_request_command(self, + endpoint: int = None, + expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=cluster.Commands.CancelPresetsSchedulesEditRequest(), + endpoint=endpoint) + asserts.assert_equal(expected_status, Status.Success) + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + async def send_set_active_preset_handle_request_command(self, + endpoint: int = None, + value: bytes = None, + expected_status: Status = Status.Success): + try: + await self.send_single_cmd(cmd=cluster.Commands.SetActivePresetRequest(value), + endpoint=endpoint) + asserts.assert_equal(expected_status, Status.Success) + + except InteractionModelError as e: + asserts.assert_equal(e.status, expected_status, "Unexpected error returned") + + def desc_TC_TSTAT_4_2(self) -> str: + """Returns a description of this test""" + return "3.2.4 [TC-TSTAT-4-2] Preset write and command attributes test case with server as DUT" + + def pics_TC_TSTAT_4_2(self): + """ This function returns a list of PICS for this test case that must be True for the test to be run""" + return ["TSTAT.S"] + + def steps_TC_TSTAT_4_2(self) -> list[TestStep]: + steps = [ + TestStep("1", "Commissioning, already done", + is_commissioning=True), + TestStep("2", "TH writes to the Presets attribute without calling the StartPresetsSchedulesEditRequest command", + "Verify that the Presets attribute was not updated."), + TestStep("3", "TH writes to the Presets attribute after calling the StartPresetsSchedulesEditRequest command but doesn't call CommitPresetsSchedulesRequest to commit", + "Verify that the Presets attribute was not updated."), + TestStep("4", "TH writes to the Presets attribute after calling the StartPresetsSchedulesEditRequest command and calls CommitPresetsSchedulesRequest to commit", + "Verify that the Presets attribute was updated."), + TestStep("5", "TH writes to the Presets attribute with a built-in preset removed", + "Verify that the CommitPresetsSchedulesRequest returned UNSUPPORTED_ACCESS (0x7e)."), + TestStep("6", "TH writes to the Presets attribute with a preset removed whose handle matches the value in the ActivePresetHandle attribute", + "Verify that the CommitPresetsSchedulesRequest returned INVALID_IN_STATE (0xcb)."), + TestStep("7", "TH writes to the Presets attribute with a built-in preset modified to be not built-in", + "Verify that the CommitPresetsSchedulesRequest returned UNSUPPORTED_ACCESS (0x7e)."), + TestStep("8", "TH writes to the Presets attribute with a new preset having builtIn set to true", + "Verify that the CommitPresetsSchedulesRequest returned CONSTRAINT_ERROR (0x87)."), + TestStep("9", "TH writes to the Presets attribute with a new preset having a preset handle that doesn't exist in the Presets attribute", + "Verify that the CommitPresetsSchedulesRequest returned NOT_FOUND (0x8b)."), + TestStep("10", "TH writes to the Presets attribute with a non built-in preset modified to be built-in", + "Verify that the CommitPresetsSchedulesRequest returned UNSUPPORTED_ACCESS (0x7e)."), + TestStep("11", "TH writes to the Presets attribute with a preset that doesn't support names in the PresetTypeFeatures bitmap but has a name", + "Verify that the CommitPresetsSchedulesRequest returned CONSTRAINT_ERROR (0x87)."), + TestStep("12", "TH writes to the Presets attribute but calls the CancelPresetsSchedulesEditRequest command to cancel the edit request", + "Verify that the edit request was cancelled"), + ] + + return steps + + @async_test_body + async def test_TC_TSTAT_4_2(self): + endpoint = self.user_params.get("endpoint", 1) + + self.step("1") + # Commission DUT - already done + + self.step("2") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050")): + presets = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.Presets) + logger.info(f"Rx'd Presets: {presets}") + asserts.assert_equal(presets, initial_presets, "Presets do not match initial value") + + # Write to the presets attribute without calling StartPresetsSchedulesEditRequest command + status = await self.write_presets(endpoint=endpoint, presets=new_presets) + status_ok = (status == Status.InvalidInState) + asserts.assert_true(status_ok, "Presets write did not return InvalidInState as expected") + + self.step("3") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + await self.send_edit_preset_request_command() + + # Write to the presets attribute after calling StartPresetsSchedulesEditRequest command + status = await self.write_presets(endpoint=endpoint, presets=new_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Read the presets attribute and verify it was not updated since CommitPresetsSchedulesRequest was not called after writing presets + presets = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.Presets) + logger.info(f"Rx'd Presets: {presets}") + asserts.assert_equal(presets, initial_presets, "Presets were updated which is not expected") + + self.step("4") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after calling StartPresetsSchedulesEditRequest command + status = await self.write_presets(endpoint=endpoint, presets=new_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command + await self.send_commit_preset_request_command() + + # Read the presets attribute and verify it was updated since CommitPresetsSchedulesRequest was called after writing presets + presets = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.Presets) + logger.info(f"Rx'd Presets: {presets}") + asserts.assert_equal(presets, new_presets_with_handle, "Presets were not updated which is not expected") + + self.step("5") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after removing a built in preset from the list. Remove the first entry. + test_presets = new_presets_with_handle.copy() + test_presets.pop(0) + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect UnsupportedAccess + await self.send_commit_preset_request_command(expected_status=Status.UnsupportedAccess) + + self.step("6") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C06.Rsp") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the SetActivePresetRequest command + await self.send_set_active_preset_handle_request_command(value=b'\x03') + + # Read the active preset handle attribute and verify it was updated to preset handle + activePresetHandle = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=cluster.Attributes.ActivePresetHandle) + logger.info(f"Rx'd ActivePresetHandle: {activePresetHandle}") + asserts.assert_equal(activePresetHandle, b'\x03', "Active preset handle was not updated as expected") + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after removing the preset that was set as the active preset handle. Remove the last entry with preset handle (b'\x03') + test_presets = new_presets_with_handle.copy() + del test_presets[-1] + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect InvalidInState + await self.send_commit_preset_request_command(expected_status=Status.InvalidInState) + + self.step("7") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after setting the builtIn flag to False for preset with handle (b'\x01') + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets[0].builtIn = False + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect UnsupportedAccess + await self.send_commit_preset_request_command(expected_status=Status.UnsupportedAccess) + + self.step("8") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after adding a preset with builtIn set to True + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets.append(cluster.Structs.PresetStruct(presetHandle=NullValue, presetScenario=cluster.Enums.PresetScenarioEnum.kWake, + name="Wake", coolingSetpoint=2800, heatingSetpoint=1800, builtIn=True)) + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect ConstraintError + await self.send_commit_preset_request_command(expected_status=Status.ConstraintError) + + self.step("9") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after adding a preset with a preset handle that doesn't exist in Presets attribute + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets.append(cluster.Structs.PresetStruct(presetHandle=b'\x08', presetScenario=cluster.Enums.PresetScenarioEnum.kWake, + name="Wake", coolingSetpoint=2800, heatingSetpoint=1800, builtIn=True)) + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect NotFound + await self.send_commit_preset_request_command(expected_status=Status.NotFound) + + self.step("10") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after setting the builtIn flag to True for preset with handle (b'\x03') + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets[2].builtIn = True + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect UnsupportedAccess + await self.send_commit_preset_request_command(expected_status=Status.UnsupportedAccess) + + self.step("11") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute after setting a name for preset with handle (b'\x01') that doesn't support names + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets[0].name = "Occupied" + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect ConstraintError + await self.send_commit_preset_request_command(expected_status=Status.ConstraintError) + + self.step("12") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + + # Write to the presets attribute with a new valid preset added + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets.append(cluster.Structs.PresetStruct(presetHandle=b'\x04', presetScenario=cluster.Enums.PresetScenarioEnum.kWake, + name="Wake", coolingSetpoint=2800, heatingSetpoint=1800, builtIn=False)) + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CancelPresetsSchedulesRequest command + await self.send_cancel_preset_request_command() + + # Send the CommitPresetsSchedulesRequest command and expect InvalidInState as the previous edit request was cancelled + await self.send_commit_preset_request_command(expected_status=Status.InvalidInState) + + # TODO: Add tests for the total number of Presets exceeds the NumberOfPresets supported. Also Add tests for adding presets with preset scenario not present in PresetTypes. + + +if __name__ == "__main__": + default_matter_test_main() From fb1d2d8c398488b7ffb17d796694e6dc40fddec2 Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:00:52 +0200 Subject: [PATCH 24/40] removing unneccessary git fetch (#34698) --- scripts/helpers/restyle-diff.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helpers/restyle-diff.sh b/scripts/helpers/restyle-diff.sh index 5f37c69762e281..58904e06a38565 100755 --- a/scripts/helpers/restyle-diff.sh +++ b/scripts/helpers/restyle-diff.sh @@ -78,7 +78,7 @@ done if [[ -z "$ref" ]]; then ref="master" - git remote | grep -qxF upstream && ref="upstream/master" && git fetch upstream + git remote | grep -qxF upstream && ref="upstream/master" fi if [[ $pull_image -eq 1 ]]; then From 1bebacd29d8ece107658b8e5b6e758ac7f723303 Mon Sep 17 00:00:00 2001 From: shripad621git <79364691+shripad621git@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:13:58 +0530 Subject: [PATCH 25/40] [ESP32] Update the esp32 ci to use the latest docker version . (#34659) * Update the esp32 ci to use the latest docker version * Added the CI fixes for ESP32 builds --- .github/workflows/chef.yaml | 2 +- .github/workflows/examples-esp32.yaml | 4 ++-- .github/workflows/qemu.yaml | 2 +- .github/workflows/release_artifacts.yaml | 2 +- .../all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults | 6 ++++++ .../esp32/sdkconfig_m5stack_rpc.defaults | 6 ++++++ examples/chef/esp32/partitions.csv | 2 +- examples/light-switch-app/esp32/main/DeviceCallbacks.cpp | 2 +- .../light-switch-app/esp32/main/include/DeviceCallbacks.h | 2 +- 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index da12476696bce9..efb408f80bfc26 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -56,7 +56,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:66 + image: ghcr.io/project-chip/chip-build-esp32:67 options: --user root steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index cdfdee65148aff..fb0d2bc29b5b8d 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:66 + image: ghcr.io/project-chip/chip-build-esp32:67 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -126,7 +126,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:66 + image: ghcr.io/project-chip/chip-build-esp32:67 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index acced0da5d9849..6dff2dadc3d533 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:66 + image: ghcr.io/project-chip/chip-build-esp32-qemu:67 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 97468ec3b5ce0c..481def01c629c6 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:66 + image: ghcr.io/project-chip/chip-build-esp32:67 steps: - name: Checkout diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults index 56fed5d65e6797..3f1168ecb907ec 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults @@ -82,3 +82,9 @@ CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE=1024 CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP=y + +# Memory Optimizations +CONFIG_NIMBLE_MAX_CONNECTIONS=1 +CONFIG_BTDM_CTRL_BLE_MAX_CONN=1 +CONFIG_BT_NIMBLE_ROLE_CENTRAL=n +CONFIG_BT_NIMBLE_ROLE_OBSERVER=n diff --git a/examples/all-clusters-minimal-app/esp32/sdkconfig_m5stack_rpc.defaults b/examples/all-clusters-minimal-app/esp32/sdkconfig_m5stack_rpc.defaults index 56fed5d65e6797..d2eaffb9bfd15b 100644 --- a/examples/all-clusters-minimal-app/esp32/sdkconfig_m5stack_rpc.defaults +++ b/examples/all-clusters-minimal-app/esp32/sdkconfig_m5stack_rpc.defaults @@ -72,6 +72,12 @@ CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y +# Memory Optimizations +CONFIG_NIMBLE_MAX_CONNECTIONS=1 +CONFIG_BTDM_CTRL_BLE_MAX_CONN=1 +CONFIG_BT_NIMBLE_ROLE_CENTRAL=n +CONFIG_BT_NIMBLE_ROLE_OBSERVER=n + # Build chip tests CONFIG_BUILD_CHIP_TESTS=y diff --git a/examples/chef/esp32/partitions.csv b/examples/chef/esp32/partitions.csv index c0855b66229dc4..c84d53a64b6e59 100644 --- a/examples/chef/esp32/partitions.csv +++ b/examples/chef/esp32/partitions.csv @@ -3,4 +3,4 @@ nvs, data, nvs, , 0xC000, phy_init, data, phy, , 0x1000, # Factory partition size about 1.9MB -factory, app, factory, , 1945K, +factory, app, factory, , 2M, diff --git a/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp b/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp index 795c433436330e..8fb0dabd95dec7 100644 --- a/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp @@ -35,7 +35,7 @@ using namespace chip::System; using namespace chip::app::Clusters; void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, ClusterId clusterId, AttributeId attributeId, - uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) + uint8_t type, uint16_t size, uint8_t * value) { ESP_LOGI(TAG, "PostAttributeChangeCallback - Cluster ID: '0x%" PRIx32 "', EndPoint ID: '0x%x', Attribute ID: '0x%" PRIx32 "'", clusterId, endpointId, attributeId); diff --git a/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h b/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h index 93c53cbfd37e97..7d9c0b00b32861 100644 --- a/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h +++ b/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h @@ -33,7 +33,7 @@ class AppDeviceCallbacks : public CommonDeviceCallbacks { public: virtual void PostAttributeChangeCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint8_t type, uint16_t size, uint8_t * value); + uint8_t type, uint16_t size, uint8_t * value) override; private: void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); From 923619aedf0f3ddce76fc968c2a6b280dc06570e Mon Sep 17 00:00:00 2001 From: sumaky <63414112+sumaky@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:20:46 +0530 Subject: [PATCH 26/40] DRLK Test Plan -Aliro Update (#34638) * Add files via upload * Update Test_TC_DRLK_2_1.yaml Aliro Attributes * Update PICS.yaml for Aliro PICS * Update PICS.yaml * Update PICS.yaml-Formatting * Update PICS.yaml * Update Test_TC_DRLK_2_13.yaml - PICS:PICS_SKIP_SAMPLE_APP * Update Test_TC_DRLK_2_1.yaml-PICS_SKIP_SAMPLE_APP * Update PICS.yaml * Update PICS.yaml * Update ci-pics-values-update DRLKA0080 * Update ci-pics-values-Aliro * Update PICS.yaml * Update ci-pics-values-Aliro Cmds and Feature PICS * Update Test_TC_DRLK_2_13.yaml * formatted using prettier * Update PICS.yaml-prettier * Update Test_TC_DRLK_2_13.yaml * Update Test_TC_DRLK_2_1.yaml * Restyled by prettier-yaml * Update Test_TC_DRLK_2_13.yaml * Update ciTests.json-Added DRLK 2.1 and 2.13 * Update ciTests.json * Update ciTests.json * Restyled by whitespace * Restyled by prettier-json * Update Test_TC_DRLK_2_1.yaml fixed the values in the list as hex in step 41b removed PICS_SKIP_SAMPLE_APP * deleted DRLK_2_13 yaml file. will be covered in python script * Update ci-pics-values * Update PICS.yaml removed readonly type of PICS * Update ci-pics-values-removed readonly pics * Update ciTests.json-restored * updated the Aliro labels without readonly , updated the ids to DRLK.S.A0028.ReadOnly and DRLK.S.A002c.ReadOnly * Removed PICS for step 37 * Restyled by whitespace * Restyled by prettier-yaml --------- Co-authored-by: Restyled.io Co-authored-by: chaitanya jandhyala --- src/app/tests/suites/certification/PICS.yaml | 54 ++++ .../certification/Test_TC_DRLK_2_1.yaml | 286 +++++++++++++++++- .../tests/suites/certification/ci-pics-values | 14 + 3 files changed, 345 insertions(+), 9 deletions(-) diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 836e71e3964e40..8a3e1fce94326f 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -2738,6 +2738,46 @@ PICS: - label: "Does the DUT(server) support the ExpiringUserTimeOut attribute?" id: DRLK.S.A0035 + - label: + "Does the DUT(server) support the AliroReaderVerificationKey attribute" + id: DRLK.S.A0080 + + - label: + "Does the DUT(server) support the AliroReaderGroupIdentifier attribute" + id: DRLK.S.A0081 + + - label: + "Does the DUT(server) support the AliroReaderGroupSubIdentifier + attribute" + id: DRLK.S.A0082 + + - label: + "Does the DUT(server) support the + AliroExpeditedTransactionSupportedProtocolVersions attribute" + id: DRLK.S.A0083 + + - label: "Does the DUT(server) support the AliroGroupResolvingKey attribute" + id: DRLK.S.A0084 + + - label: + "Does the DUT(server) support the AliroSupportedBLEUWBProtocolVersions + attribute" + id: DRLK.S.A0085 + + - label: + "Does the DUT(server) support the AliroBLEAdvertisingVersion attribute" + id: DRLK.S.A0086 + + - label: + "Does the DUT(server) support the + NumberOfAliroCredentialIssuerKeysSupported attribute" + id: DRLK.S.A0087 + + - label: + "Does the DUT(server) support the NumberOfAliroEndpointKeysSupported + attribute" + id: DRLK.S.A0088 + # #Server ReadOnly attribute # @@ -2869,6 +2909,12 @@ PICS: - label: "Does the DUT(server) support the Unbolt Door command?" id: DRLK.S.C27.Rsp + - label: "Does the DUT(server) support the SetAliroReaderConfig command?" + id: DRLK.S.C28.Rsp + + - label: "Does the DUT(server) support the ClearAliroReaderConfig command?" + id: DRLK.S.C29.Rsp + # # server / commandsGenerated # @@ -2970,6 +3016,14 @@ PICS: - label: "Does the DUT(server) support the Lock supports unbolting feature?" id: DRLK.S.F0c + - label: "Does the DUT(server) support AliroProvisioning feature?" + id: DRLK.S.F0d + + - label: + "Does the DUT(server) support Bluetooth LE + UWB Access Control Flow + feature?" + id: DRLK.S.F0e + # # server / manually # diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index e84b1ebdbc8459..8bce2046d74897 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -1551,8 +1551,18 @@ tests: response: value: NumberOfCredentialsSupportedPerUserValue - - label: "Cleanup the created user" - PICS: DRLK.S.F00 && DRLK.S.F07 + - label: "Step 36: TH sends ClearCredential Command to DUT" + PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp + command: "ClearCredential" + timedInteractionTimeoutMs: 1000 + arguments: + values: + - name: "Credential" + value: { CredentialType: 1, CredentialIndex: 1 } + + - label: + "Step 37: TH sends ClearUser Command to DUT with the UserIndex as 1" + PICS: DRLK.S.F07 && DRLK.S.C1d.Rsp command: "ClearUser" timedInteractionTimeoutMs: 1000 arguments: @@ -1560,11 +1570,269 @@ tests: - name: "UserIndex" value: 1 - - label: "Clean the created credential" - PICS: DRLK.S.F00 && DRLK.S.F07 && DRLK.S.C26.Rsp - command: "ClearCredential" - timedInteractionTimeoutMs: 1000 + - label: "Step 38a: TH reads AliroReaderVerificationKey attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0080 + command: "readAttribute" + attribute: "AliroReaderVerificationKey" + response: + saveAs: verificationkey + constraints: + type: octet_string + minLength: 65 + + - label: + "Step 38b: TH writes AliroReaderVerificationKey attribute as an octstr + value of length 65 which is different from verificationkey" + PICS: DRLK.S.F0d && DRLK.S.A0080 + command: "writeAttribute" + attribute: "AliroReaderVerificationKey" arguments: - values: - - name: "Credential" - value: { CredentialType: 1, CredentialIndex: 1 } + value: "047a4c992d753924cdf3779a3c84fec2debaa6f0b3084450878acc7ddcce7856ae57b1ebbe2561015103dd7474c2a183675378ec55f1e465ac3436bf3dd5ca54d4" + response: + error: UNSUPPORTED_WRITE + + - label: "Step 38c: TH reads AliroReaderVerificationKey attribute from DUT" + + PICS: DRLK.S.F0d && DRLK.S.A0080 + command: "readAttribute" + attribute: "AliroReaderVerificationKey" + response: + value: verificationkey + + - label: "Step 39a: TH reads AliroReaderGroupIdentifier attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0081 + command: "readAttribute" + attribute: "AliroReaderGroupIdentifier" + response: + saveAs: aliroreadergrpidentifier + constraints: + type: octet_string + minLength: 16 + - label: + "Step 39b: TH writes AliroReaderGroupIdentifier attribute as octstr + value of length 16 which is different from aliroreadergrpidentifier" + PICS: DRLK.S.F0d && DRLK.S.A0081 + command: "writeAttribute" + attribute: "AliroReaderVerificationKey" + arguments: + value: "047a4c992d753924" + response: + error: UNSUPPORTED_WRITE + + - label: "Step 39c: TH reads AliroReaderGroupIdentifier attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0081 + command: "readAttribute" + attribute: "AliroReaderGroupIdentifier" + response: + value: aliroreadergrpidentifier + - label: + "Step 40a: TH reads AliroReaderGroupSubIdentifier attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0082 + command: "readAttribute" + attribute: "AliroReaderGroupSubIdentifier" + response: + saveAs: aliroreadergrpsubidentifier + constraints: + type: octet_string + minLength: 16 + + - label: + "Step 40b: TH writes AliroReaderGroupSubIdentifier attribute as octstr + value of length 16 which is different from aliroreadergrpsubidentifier" + PICS: DRLK.S.F0d && DRLK.S.A0082 + command: "writeAttribute" + attribute: "AliroReaderGroupSubIdentifier" + arguments: + value: "047a4c992d75368" + response: + error: UNSUPPORTED_WRITE + + - label: "Step 40c: TH reads AliroReaderGroupIdentifier attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0082 + command: "readAttribute" + attribute: "AliroReaderGroupSubIdentifier" + response: + value: aliroreadergrpsubidentifier + + - label: + "Step 41a: TH reads AliroExpeditedTransactionSupportedProtocolVersions + attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0083 + command: "readAttribute" + attribute: "AliroExpeditedTransactionSupportedProtocolVersions" + response: + saveAs: aliroprotocolversion + constraints: + type: list + maxLength: 16 + - label: + "Step 41b: TH writes + AliroExpeditedTransactionSupportedProtocolVersions attribute as list + which is different from aliroprotocolversion" + PICS: DRLK.S.F0d && DRLK.S.A0083 + command: "writeAttribute" + attribute: "AliroExpeditedTransactionSupportedProtocolVersions" + arguments: + value: ["0x1", "0x2"] + response: + error: UNSUPPORTED_WRITE + - label: + "Step 41c: TH reads AliroExpeditedTransactionSupportedProtocolVersions + attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0083 + command: "readAttribute" + attribute: "AliroExpeditedTransactionSupportedProtocolVersions" + response: + value: aliroprotocolversion + + - label: "Step 42a: TH reads AliroGroupResolvingKey attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0084 + command: "readAttribute" + attribute: "AliroGroupResolvingKey" + response: + saveAs: alirogrpresolvingkey + constraints: + type: octet_string + minLength: 16 + + - label: + "Step 42b: TH writes AliroGroupResolvingKey attribute as octstr value + of length 16 which is different from alirogrpresolvingkey" + PICS: DRLK.S.F0d && DRLK.S.A0084 + command: "writeAttribute" + attribute: "AliroGroupResolvingKey" + arguments: + value: "047a4c992d75368" + response: + error: UNSUPPORTED_WRITE + + - label: "Step 42c: TH reads AliroGroupResolvingKey attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0084 + command: "readAttribute" + attribute: "AliroGroupResolvingKey" + response: + value: alirogrpresolvingkey + - label: + "Step 43a: TH reads AliroSupportedBLEUWBProtocolVersions attribute + from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0085 + command: "readAttribute" + attribute: "AliroSupportedBLEUWBProtocolVersions" + response: + saveAs: alirobleuwbprotocolversion + constraints: + type: octet_string + minLength: 16 + + - label: + "Step 43b: TH writes AliroSupportedBLEUWBProtocolVersions attribute as + list which is different from alirobleuwbprotocolversion" + PICS: DRLK.S.F0d && DRLK.S.A0085 + command: "writeAttribute" + attribute: "AliroSupportedBLEUWBProtocolVersions" + arguments: + value: "047a4c992d75368" + response: + error: UNSUPPORTED_WRITE + + - label: "Step 43c: TH reads AliroGroupResolvingKey attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0085 + command: "readAttribute" + attribute: "AliroSupportedBLEUWBProtocolVersions" + response: + value: alirobleuwbprotocolversion + + - label: "Step 44a: TH reads AliroBLEAdvertisingVersion attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0086 + command: "readAttribute" + attribute: "AliroBLEAdvertisingVersion" + response: + saveAs: alirobleadvversion + constraints: + type: int8u + minValue: 0 + maxValue: 255 + + - label: + "Step 44b: TH writes AliroBLEAdvertisingVersion attribute as any value + different from alirobleadvversion" + PICS: DRLK.S.F0d && DRLK.S.A0086 + command: "writeAttribute" + attribute: "AliroBLEAdvertisingVersion" + arguments: + value: 85 + response: + error: UNSUPPORTED_WRITE + + - label: "Step 44c: TH reads AliroBLEAdvertisingVersion attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0086 + command: "readAttribute" + attribute: "AliroBLEAdvertisingVersion" + response: + value: alirobleadvversion + + - label: + "Step 45a: TH reads NumberOfAliroCredentialIssuerKeysSupported + attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0087 + command: "readAttribute" + attribute: "NumberOfAliroCredentialIssuerKeysSupported" + response: + saveAs: alirokeysupported + constraints: + type: int16u + minValue: 0 + maxValue: 65534 + + - label: + "Step 45b: TH writes NumberOfAliroCredentialIssuerKeysSupported + attribute as any value different from alirokeysupported" + PICS: DRLK.S.F0d && DRLK.S.A0087 + command: "writeAttribute" + attribute: "NumberOfAliroCredentialIssuerKeysSupported" + arguments: + value: 30 + response: + error: UNSUPPORTED_WRITE + + - label: + "Step 45c: TH reads NumberOfAliroCredentialIssuerKeysSupported + attribute from DUT" + PICS: DRLK.S.F0d && DRLK.S.A0087 + command: "readAttribute" + attribute: "NumberOfAliroCredentialIssuerKeysSupported" + response: + value: alirokeysupported + + - label: + "Step 46a: TH reads NumberOfAliroEndpointKeysSupported attribute from + DUT" + PICS: DRLK.S.F0d && DRLK.S.A0088 + command: "readAttribute" + attribute: "NumberOfAliroEndpointKeysSupported" + response: + saveAs: aliroepkeysupported + constraints: + type: int16u + minValue: 0 + maxValue: 65534 + + - label: + "Step 46b: TH writes NumberOfAliroEndpointKeysSupported attribute as + any value different from aliroepkeysupported" + PICS: DRLK.S.F0d && DRLK.S.A0088 + command: "writeAttribute" + attribute: "NumberOfAliroEndpointKeysSupported" + arguments: + value: 1000 + response: + error: UNSUPPORTED_WRITE + + - label: + "Step 46c: TH reads NumberOfAliroEndpointKeysSupported attribute from + DUT" + PICS: DRLK.S.F0d && DRLK.S.A0088 + command: "readAttribute" + attribute: "NumberOfAliroEndpointKeysSupported" + response: + value: aliroepkeysupported diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index fe5ffcdab753b1..5aa8dba1f684a8 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1519,11 +1519,21 @@ DRLK.S.A0031=1 DRLK.S.A0032=1 DRLK.S.A0033=1 DRLK.S.A0035=0 +DRLK.S.A0080=0 +DRLK.S.A0081=0 +DRLK.S.A0082=0 +DRLK.S.A0083=0 +DRLK.S.A0084=0 +DRLK.S.A0085=0 +DRLK.S.A0086=0 +DRLK.S.A0087=0 +DRLK.S.A0088=0 #ReadOnly attributes DRLK.S.A0028.ReadOnly=1 DRLK.S.A002c.ReadOnly=1 + #write attributes DRLK.S.M.SimulateNotFullyLocked=1 DRLK.S.M.DetectLockJammed=1 @@ -1564,6 +1574,8 @@ DRLK.S.F08=1 DRLK.S.F0a=1 DRLK.S.F0b=1 DRLK.S.F0c=1 +DRLK.S.F0d=0 +DRLK.S.F0e=0 # Server Commands DRLK.S.C00.Rsp=1 @@ -1585,6 +1597,8 @@ DRLK.S.C22.Rsp=1 DRLK.S.C24.Rsp=1 DRLK.S.C26.Rsp=1 DRLK.S.C27.Rsp=1 +DRLK.S.C28.Rsp=0 +DRLK.S.C29.Rsp=0 DRLK.S.C0c.Tx=1 DRLK.S.C0f.Tx=1 DRLK.S.C12.Tx=1 From 6f845262f0e4d64f279978d3e47993b2320445df Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Aug 2024 12:28:37 -0400 Subject: [PATCH 27/40] Add tests for MTR*NameForID APIs. (#34687) --- .../CHIPTests/MTRClusterNamesTests.m | 48 +++++++++++++++++++ .../Matter.xcodeproj/project.pbxproj | 4 ++ 2 files changed, 52 insertions(+) create mode 100644 src/darwin/Framework/CHIPTests/MTRClusterNamesTests.m diff --git a/src/darwin/Framework/CHIPTests/MTRClusterNamesTests.m b/src/darwin/Framework/CHIPTests/MTRClusterNamesTests.m new file mode 100644 index 00000000000000..a609e191ef9775 --- /dev/null +++ b/src/darwin/Framework/CHIPTests/MTRClusterNamesTests.m @@ -0,0 +1,48 @@ +/** + * 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. + */ + +#import +#import + +@interface MTRClusterNamesTests : XCTestCase + +@end + +@implementation MTRClusterNamesTests + +- (void)testClusterNames +{ + XCTAssertEqualObjects(MTRClusterNameForID(MTRClusterIDTypeOnOffID), @"OnOff"); + XCTAssertEqualObjects(MTRClusterNameForID(0x0101), @"DoorLock"); + XCTAssertEqualObjects(MTRClusterNameForID(12345678), @""); +} + +- (void)testAttributeNames +{ + XCTAssertEqualObjects(MTRAttributeNameForID(MTRClusterIDTypeOnOffID, MTRAttributeIDTypeClusterOnOffAttributeOnOffID), @"OnOff"); + XCTAssertEqualObjects(MTRAttributeNameForID(MTRClusterIDTypeOnOffID, MTRAttributeIDTypeClusterOnOffAttributeOnTimeID), @"OnTime"); + XCTAssertEqualObjects(MTRAttributeNameForID(12345678, 0), @""); + XCTAssertEqualObjects(MTRAttributeNameForID(MTRClusterIDTypeOnOffID, 12345678), @""); +} + +- (void)testEventNames +{ + XCTAssertEqualObjects(MTREventNameForID(MTRClusterIDTypeAccessControlID, MTREventIDTypeClusterAccessControlEventAccessControlEntryChangedID), @"AccessControlEntryChanged"); + XCTAssertEqualObjects(MTREventNameForID(12345678, 0), @""); + XCTAssertEqualObjects(MTREventNameForID(MTRClusterIDTypeAccessControlID, 12345678), @""); +} + +@end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index b23605ce2eaa4e..055a6c9efbcc3e 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -182,6 +182,7 @@ 516415FD2B6ACA8300D5CE11 /* MTRServerAccessControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 516415FB2B6ACA8300D5CE11 /* MTRServerAccessControl.h */; }; 516415FF2B6B132200D5CE11 /* DataModelHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516415FE2B6B132200D5CE11 /* DataModelHandler.cpp */; }; 516416012B6B483C00D5CE11 /* MTRIMDispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 516416002B6B483C00D5CE11 /* MTRIMDispatch.mm */; }; + 5165A4B32C5AB978002B9799 /* MTRClusterNamesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5165A4B22C5AB978002B9799 /* MTRClusterNamesTests.m */; }; 51669AF02913204400F4AA36 /* MTRBackwardsCompatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */; }; 5173A47529C0E2ED00F67F48 /* MTRFabricInfo_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5173A47229C0E2ED00F67F48 /* MTRFabricInfo_Internal.h */; }; 5173A47629C0E2ED00F67F48 /* MTRFabricInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5173A47329C0E2ED00F67F48 /* MTRFabricInfo.mm */; }; @@ -596,6 +597,7 @@ 516415FB2B6ACA8300D5CE11 /* MTRServerAccessControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRServerAccessControl.h; sourceTree = ""; }; 516415FE2B6B132200D5CE11 /* DataModelHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataModelHandler.cpp; path = util/DataModelHandler.cpp; sourceTree = ""; }; 516416002B6B483C00D5CE11 /* MTRIMDispatch.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRIMDispatch.mm; sourceTree = ""; }; + 5165A4B22C5AB978002B9799 /* MTRClusterNamesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRClusterNamesTests.m; sourceTree = ""; }; 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRBackwardsCompatTests.m; sourceTree = ""; }; 5173A47229C0E2ED00F67F48 /* MTRFabricInfo_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRFabricInfo_Internal.h; sourceTree = ""; }; 5173A47329C0E2ED00F67F48 /* MTRFabricInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRFabricInfo.mm; sourceTree = ""; }; @@ -1407,6 +1409,7 @@ 3DFCB3282966684500332B35 /* MTRCertificateInfoTests.m */, 517BF3F2282B62CB00A8B7DB /* MTRCertificateTests.m */, 51339B1E2A0DA64D00C798C1 /* MTRCertificateValidityTests.m */, + 5165A4B22C5AB978002B9799 /* MTRClusterNamesTests.m */, 1EE0805C2A448756008A03C2 /* MTRCommissionableBrowserTests.m */, 518D3F842AA14006008E0007 /* MTRControllerAdvertisingTests.m */, 99C65E0F267282F1003402F6 /* MTRControllerTests.m */, @@ -2050,6 +2053,7 @@ 51E24E73274E0DAC007CCF6E /* MTRErrorTestUtils.mm in Sources */, 519498322A25581C00B3BABE /* MTRSetupPayloadInitializationTests.m in Sources */, 51A2F1322A00402A00F03298 /* MTRDataValueParserTests.m in Sources */, + 5165A4B32C5AB978002B9799 /* MTRClusterNamesTests.m in Sources */, 51E95DF82A78110900A434F0 /* MTRPerControllerStorageTests.m in Sources */, 51D9CB0B2BA37DCE0049D6DB /* MTRDSTOffsetTests.m in Sources */, ); From 5f6f3f16f4083c7961c1fb76caa74269d4e0731c Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:09:48 +0200 Subject: [PATCH 28/40] fixing type hints errors on python controller code (#34415) * fixing mypy errors * restyled * add new files to BUILD.gn * mypy: fixing p256keypair.py * more mypy fixes * adding workaround to allow type hinting ctypes pointers * more mypy fixes * more mypy fixes * Restyled by autopep8 --------- Co-authored-by: Restyled.io --- src/controller/python/BUILD.gn | 2 + src/controller/python/chip/ChipDeviceCtrl.py | 92 ++++++------ .../python/chip/clusters/Attribute.py | 142 ++++++++---------- .../python/chip/clusters/CHIPClusters.py | 2 +- .../python/chip/clusters/ClusterObjects.py | 24 +-- src/controller/python/chip/clusters/enum.py | 2 +- .../python/chip/credentials/__init__.py | 0 src/controller/python/chip/crypto/__init__.py | 0 .../python/chip/crypto/p256keypair.py | 26 +++- .../python/chip/interaction_model/delegate.py | 28 ++-- src/controller/python/chip/native/__init__.py | 19 ++- src/controller/python/chip/tlv/tlvlist.py | 2 +- .../templates/python-CHIPClusters-py.zapt | 2 +- 13 files changed, 172 insertions(+), 169 deletions(-) create mode 100644 src/controller/python/chip/credentials/__init__.py create mode 100644 src/controller/python/chip/crypto/__init__.py diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn index 57822f9ff34602..58d9cb1f7c4622 100644 --- a/src/controller/python/BUILD.gn +++ b/src/controller/python/BUILD.gn @@ -179,7 +179,9 @@ chip_python_wheel_action("chip-core") { "chip/commissioning/commissioning_flow_blocks.py", "chip/commissioning/pase.py", "chip/configuration/__init__.py", + "chip/credentials/__init__.py", "chip/credentials/cert.py", + "chip/crypto/__init__.py", "chip/crypto/fabric.py", "chip/crypto/p256keypair.py", "chip/discovery/__init__.py", diff --git a/src/controller/python/chip/ChipDeviceCtrl.py b/src/controller/python/chip/ChipDeviceCtrl.py index 91c83e8954fa37..5989a42977aafc 100644 --- a/src/controller/python/chip/ChipDeviceCtrl.py +++ b/src/controller/python/chip/ChipDeviceCtrl.py @@ -40,10 +40,10 @@ import threading import typing from ctypes import (CDLL, CFUNCTYPE, POINTER, Structure, byref, c_bool, c_char, c_char_p, c_int, c_int32, c_size_t, c_uint8, - c_uint16, c_uint32, c_uint64, c_void_p, create_string_buffer, pointer, py_object, resize, string_at) + c_uint16, c_uint32, c_uint64, c_void_p, cast, create_string_buffer, pointer, py_object, resize, string_at) from dataclasses import dataclass -import dacite +import dacite # type: ignore from . import FabricAdmin from . import clusters as Clusters @@ -104,10 +104,10 @@ class CommissioningParameters: @dataclass class NOCChain: - nocBytes: bytes - icacBytes: bytes - rcacBytes: bytes - ipkBytes: bytes + nocBytes: typing.Optional[bytes] + icacBytes: typing.Optional[bytes] + rcacBytes: typing.Optional[bytes] + ipkBytes: typing.Optional[bytes] adminSubject: int @@ -170,7 +170,7 @@ def __eq__(self, other): _OnCheckInCompleteFunct = CFUNCTYPE(None, ScopedNodeId) _OnCheckInCompleteWaitListLock = threading.Lock() -_OnCheckInCompleteWaitList = dict() +_OnCheckInCompleteWaitList: typing.Dict[ScopedNodeId, set] = dict() @_OnCheckInCompleteFunct @@ -183,7 +183,7 @@ def _OnCheckInComplete(scopedNodeId: ScopedNodeId): callback(scopedNodeId) -def RegisterOnActiveCallback(scopedNodeId: ScopedNodeId, callback: typing.Callable[None, [ScopedNodeId]]): +def RegisterOnActiveCallback(scopedNodeId: ScopedNodeId, callback: typing.Callable[[ScopedNodeId], None]): ''' Registers a callback when the device with given (fabric index, node id) becomes active. Does nothing if the callback is already registered. @@ -194,7 +194,7 @@ def RegisterOnActiveCallback(scopedNodeId: ScopedNodeId, callback: typing.Callab _OnCheckInCompleteWaitList[scopedNodeId] = waitList -def UnregisterOnActiveCallback(scopedNodeId: ScopedNodeId, callback: typing.Callable[None, [ScopedNodeId]]): +def UnregisterOnActiveCallback(scopedNodeId: ScopedNodeId, callback: typing.Callable[[ScopedNodeId], None]): ''' Unregisters a callback when the device with given (fabric index, node id) becomes active. Does nothing if the callback has not been registered. @@ -218,7 +218,7 @@ def OnCheckInCallback(nodeid): RegisterOnActiveCallback(scopedNodeId, OnCheckInCallback) try: - asyncio.wait_for(future, timeout=timeoutSeconds) + await asyncio.wait_for(future, timeout=timeoutSeconds) finally: UnregisterOnActiveCallback(scopedNodeId, OnCheckInCallback) @@ -273,7 +273,7 @@ class CommissioningContext(CallbackContext): This context also resets commissioning related device controller state. """ - def __init__(self, devCtrl: ChipDeviceController, lock: asyncio.Lock) -> None: + def __init__(self, devCtrl: ChipDeviceControllerBase, lock: asyncio.Lock) -> None: super().__init__(lock) self._devCtrl = devCtrl @@ -434,12 +434,12 @@ def closeTCPConnectionWithPeer(self): class ChipDeviceControllerBase(): - activeList = set() + activeList: typing.Set = set() def __init__(self, name: str = ''): self.devCtrl = None self._ChipStack = builtins.chipStack - self._dmLib = None + self._dmLib: typing.Any = None self._InitLib() @@ -484,8 +484,8 @@ def HandleCommissioningComplete(nodeId: int, err: PyChipError): def HandleFabricCheck(nodeId): self._fabricCheckNodeId = nodeId - def HandleOpenWindowComplete(nodeid: int, setupPinCode: int, setupManualCode: str, - setupQRCode: str, err: PyChipError) -> None: + def HandleOpenWindowComplete(nodeid: int, setupPinCode: int, setupManualCode: bytes, + setupQRCode: bytes, err: PyChipError) -> None: if err.is_success: LOGGER.info("Open Commissioning Window complete setting nodeid {} pincode to {}".format(nodeid, setupPinCode)) commissioningParameters = CommissioningParameters( @@ -576,10 +576,6 @@ def _finish_init(self): def _enablePairingCompleteCallback(self, value: bool): self._dmLib.pychip_ScriptDevicePairingDelegate_SetExpectingPairingComplete(self.pairingDelegate, value) - @property - def fabricAdmin(self) -> FabricAdmin.FabricAdmin: - return self._fabricAdmin - @property def nodeId(self) -> int: return self._nodeId @@ -618,7 +614,7 @@ def Shutdown(self): ChipDeviceController.activeList.remove(self) self._isActive = False - def ShutdownAll(): + def ShutdownAll(self): ''' Shut down all active controllers and reclaim any used resources. ''' # @@ -947,7 +943,7 @@ def GetClusterHandler(self): return self._Cluster - async def FindOrEstablishPASESession(self, setupCode: str, nodeid: int, timeoutMs: int = None) -> typing.Optional[DeviceProxyWrapper]: + async def FindOrEstablishPASESession(self, setupCode: str, nodeid: int, timeoutMs: typing.Optional[int] = None) -> typing.Optional[DeviceProxyWrapper]: ''' Returns CommissioneeDeviceProxy if we can find or establish a PASE connection to the specified device''' self.CheckIsActive() returnDevice = c_void_p(None) @@ -963,7 +959,9 @@ async def FindOrEstablishPASESession(self, setupCode: str, nodeid: int, timeoutM if res.is_success: return DeviceProxyWrapper(returnDevice, DeviceProxyWrapper.DeviceProxyType.COMMISSIONEE, self._dmLib) - def GetConnectedDeviceSync(self, nodeid, allowPASE=True, timeoutMs: int = None, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): + return None + + def GetConnectedDeviceSync(self, nodeid, allowPASE=True, timeoutMs: typing.Optional[int] = None, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): ''' Gets an OperationalDeviceProxy or CommissioneeDeviceProxy for the specified Node. nodeId: Target's Node ID @@ -976,7 +974,7 @@ def GetConnectedDeviceSync(self, nodeid, allowPASE=True, timeoutMs: int = None, self.CheckIsActive() returnDevice = c_void_p(None) - returnErr = None + returnErr: typing.Any = None deviceAvailableCV = threading.Condition() if allowPASE: @@ -1032,7 +1030,7 @@ async def WaitForActive(self, nodeid, *, timeoutSeconds=30.0, stayActiveDuration await WaitForCheckIn(ScopedNodeId(nodeid, self._fabricIndex), timeoutSeconds=timeoutSeconds) return await self.SendCommand(nodeid, 0, Clusters.IcdManagement.Commands.StayActiveRequest(stayActiveDuration=stayActiveDurationMs)) - async def GetConnectedDevice(self, nodeid, allowPASE: bool = True, timeoutMs: int = None, + async def GetConnectedDevice(self, nodeid, allowPASE: bool = True, timeoutMs: typing.Optional[int] = None, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): ''' Gets an OperationalDeviceProxy or CommissioneeDeviceProxy for the specified Node. @@ -1180,9 +1178,9 @@ async def TestOnlySendCommandTimedRequestFlagWithNoTimedInvoke(self, nodeid: int return await future async def SendCommand(self, nodeid: int, endpoint: int, payload: ClusterObjects.ClusterCommand, responseType=None, - timedRequestTimeoutMs: typing.Union[None, int] = None, - interactionTimeoutMs: typing.Union[None, int] = None, busyWaitMs: typing.Union[None, int] = None, - suppressResponse: typing.Union[None, bool] = None, + timedRequestTimeoutMs: typing.Optional[int] = None, + interactionTimeoutMs: typing.Optional[int] = None, busyWaitMs: typing.Optional[int] = None, + suppressResponse: typing.Optional[bool] = None, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): ''' Send a cluster-object encapsulated command to a node and get returned a future that can be awaited upon to receive @@ -1255,7 +1253,7 @@ async def SendBatchCommands(self, nodeid: int, commands: typing.List[ClusterComm res.raise_on_error() return await future - def SendGroupCommand(self, groupid: int, payload: ClusterObjects.ClusterCommand, busyWaitMs: typing.Union[None, int] = None): + def SendGroupCommand(self, groupid: int, payload: ClusterObjects.ClusterCommand, busyWaitMs: typing.Optional[int] = None): ''' Send a group cluster-object encapsulated command to a group_id and get returned a future that can be awaited upon to get confirmation command was sent. @@ -1274,8 +1272,8 @@ def SendGroupCommand(self, groupid: int, payload: ClusterObjects.ClusterCommand, async def WriteAttribute(self, nodeid: int, attributes: typing.List[typing.Tuple[int, ClusterObjects.ClusterAttributeDescriptor]], - timedRequestTimeoutMs: typing.Union[None, int] = None, - interactionTimeoutMs: typing.Union[None, int] = None, busyWaitMs: typing.Union[None, int] = None, + timedRequestTimeoutMs: typing.Optional[int] = None, + interactionTimeoutMs: typing.Optional[int] = None, busyWaitMs: typing.Optional[int] = None, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): ''' Write a list of attributes on a target node. @@ -1315,7 +1313,7 @@ async def WriteAttribute(self, nodeid: int, return await future def WriteGroupAttribute( - self, groupid: int, attributes: typing.List[typing.Tuple[ClusterObjects.ClusterAttributeDescriptor, int]], busyWaitMs: typing.Union[None, int] = None): + self, groupid: int, attributes: typing.List[typing.Tuple[ClusterObjects.ClusterAttributeDescriptor, int]], busyWaitMs: typing.Optional[int] = None): ''' Write a list of attributes on a target group. @@ -1429,7 +1427,7 @@ def _parseEventPathTuple(self, pathTuple: typing.Union[ else: raise ValueError("Unsupported Attribute Path") - async def Read(self, nodeid: int, attributes: typing.List[typing.Union[ + async def Read(self, nodeid: int, attributes: typing.Optional[typing.List[typing.Union[ None, # Empty tuple, all wildcard typing.Tuple[int], # Endpoint # Wildcard endpoint, Cluster id present @@ -1440,9 +1438,9 @@ async def Read(self, nodeid: int, attributes: typing.List[typing.Union[ typing.Tuple[int, typing.Type[ClusterObjects.Cluster]], # Concrete path typing.Tuple[int, typing.Type[ClusterObjects.ClusterAttributeDescriptor]] - ]] = None, - dataVersionFilters: typing.List[typing.Tuple[int, typing.Type[ClusterObjects.Cluster], int]] = None, events: typing.List[ - typing.Union[ + ]]] = None, + dataVersionFilters: typing.Optional[typing.List[typing.Tuple[int, typing.Type[ClusterObjects.Cluster], int]]] = None, events: typing.Optional[typing.List[ + typing.Union[ None, # Empty tuple, all wildcard typing.Tuple[str, int], # all wildcard with urgency set typing.Tuple[int, int], # Endpoint, @@ -1454,9 +1452,9 @@ async def Read(self, nodeid: int, attributes: typing.List[typing.Union[ typing.Tuple[int, typing.Type[ClusterObjects.Cluster], int], # Concrete path typing.Tuple[int, typing.Type[ClusterObjects.ClusterEvent], int] - ]] = None, + ]]] = None, eventNumberFilter: typing.Optional[int] = None, - returnClusterObject: bool = False, reportInterval: typing.Tuple[int, int] = None, + returnClusterObject: bool = False, reportInterval: typing.Optional[typing.Tuple[int, int]] = None, fabricFiltered: bool = True, keepSubscriptions: bool = False, autoResubscribe: bool = True, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): ''' @@ -1535,7 +1533,7 @@ async def Read(self, nodeid: int, attributes: typing.List[typing.Union[ keepSubscriptions=keepSubscriptions, autoResubscribe=autoResubscribe).raise_on_error() return await future - async def ReadAttribute(self, nodeid: int, attributes: typing.List[typing.Union[ + async def ReadAttribute(self, nodeid: int, attributes: typing.Optional[typing.List[typing.Union[ None, # Empty tuple, all wildcard typing.Tuple[int], # Endpoint # Wildcard endpoint, Cluster id present @@ -1546,9 +1544,9 @@ async def ReadAttribute(self, nodeid: int, attributes: typing.List[typing.Union[ typing.Tuple[int, typing.Type[ClusterObjects.Cluster]], # Concrete path typing.Tuple[int, typing.Type[ClusterObjects.ClusterAttributeDescriptor]] - ]], dataVersionFilters: typing.List[typing.Tuple[int, typing.Type[ClusterObjects.Cluster], int]] = None, + ]]], dataVersionFilters: typing.Optional[typing.List[typing.Tuple[int, typing.Type[ClusterObjects.Cluster], int]]] = None, returnClusterObject: bool = False, - reportInterval: typing.Tuple[int, int] = None, + reportInterval: typing.Optional[typing.Tuple[int, int]] = None, fabricFiltered: bool = True, keepSubscriptions: bool = False, autoResubscribe: bool = True, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): ''' @@ -1631,7 +1629,7 @@ async def ReadEvent(self, nodeid: int, events: typing.List[typing.Union[ typing.Tuple[int, typing.Type[ClusterObjects.ClusterEvent], int] ]], eventNumberFilter: typing.Optional[int] = None, fabricFiltered: bool = True, - reportInterval: typing.Tuple[int, int] = None, + reportInterval: typing.Optional[typing.Tuple[int, int]] = None, keepSubscriptions: bool = False, autoResubscribe: bool = True, payloadCapability: int = TransportPayloadCapability.MRP_PAYLOAD): @@ -1936,7 +1934,7 @@ class ChipDeviceController(ChipDeviceControllerBase): ''' def __init__(self, opCredsContext: ctypes.c_void_p, fabricId: int, nodeId: int, adminVendorId: int, catTags: typing.List[int] = [ - ], paaTrustStorePath: str = "", useTestCommissioner: bool = False, fabricAdmin: FabricAdmin = None, name: str = None, keypair: p256keypair.P256Keypair = None): + ], paaTrustStorePath: str = "", useTestCommissioner: bool = False, fabricAdmin: typing.Optional[FabricAdmin.FabricAdmin] = None, name: str = '', keypair: typing.Optional[p256keypair.P256Keypair] = None): super().__init__( name or f"caIndex({fabricAdmin.caIndex:x})/fabricId(0x{fabricId:016X})/nodeId(0x{nodeId:016X})" @@ -1956,8 +1954,8 @@ def __init__(self, opCredsContext: ctypes.c_void_p, fabricId: int, nodeId: int, # TODO(erjiaqing@): Figure out how to control enableServerInteractions for a single device controller (node) self._externalKeyPair = keypair self._ChipStack.Call( - lambda: self._dmLib.pychip_OpCreds_AllocateController(c_void_p( - opCredsContext), pointer(devCtrl), pointer(pairingDelegate), fabricId, nodeId, adminVendorId, c_char_p(None if len(paaTrustStorePath) == 0 else str.encode(paaTrustStorePath)), useTestCommissioner, self._ChipStack.enableServerInteractions, c_catTags, len(catTags), None if keypair is None else keypair.native_object) + lambda: self._dmLib.pychip_OpCreds_AllocateController(cast( + opCredsContext, c_void_p), pointer(devCtrl), pointer(pairingDelegate), fabricId, nodeId, adminVendorId, c_char_p(None if len(paaTrustStorePath) == 0 else str.encode(paaTrustStorePath)), useTestCommissioner, self._ChipStack.enableServerInteractions, c_catTags, len(catTags), None if keypair is None else keypair.native_object) ).raise_on_error() self._fabricAdmin = fabricAdmin @@ -1977,7 +1975,7 @@ def caIndex(self) -> int: return self._caIndex @property - def fabricAdmin(self) -> FabricAdmin: + def fabricAdmin(self) -> FabricAdmin.FabricAdmin: return self._fabricAdmin async def Commission(self, nodeid) -> int: @@ -2218,7 +2216,7 @@ class BareChipDeviceController(ChipDeviceControllerBase): ''' def __init__(self, operationalKey: p256keypair.P256Keypair, noc: bytes, - icac: typing.Union[bytes, None], rcac: bytes, ipk: typing.Union[bytes, None], adminVendorId: int, name: str = None): + icac: typing.Union[bytes, None], rcac: bytes, ipk: typing.Union[bytes, None], adminVendorId: int, name: typing.Optional[str] = None): '''Creates a controller without AutoCommissioner. The allocated controller uses the noc, icac, rcac and ipk instead of the default, @@ -2246,7 +2244,7 @@ def __init__(self, operationalKey: p256keypair.P256Keypair, noc: bytes, self._ChipStack.Call( lambda: self._dmLib.pychip_OpCreds_AllocateControllerForPythonCommissioningFLow( - c_void_p(devCtrl), c_void_p(pairingDelegate), nativeKey, noc, len(noc), icac, len(icac) if icac else 0, rcac, len(rcac), ipk, len(ipk) if ipk else 0, adminVendorId, self._ChipStack.enableServerInteractions) + cast(devCtrl, c_void_p), cast(pairingDelegate, c_void_p), nativeKey, noc, len(noc), icac, len(icac) if icac else 0, rcac, len(rcac), ipk, len(ipk) if ipk else 0, adminVendorId, self._ChipStack.enableServerInteractions) ).raise_on_error() self._set_dev_ctrl(devCtrl, pairingDelegate) diff --git a/src/controller/python/chip/clusters/Attribute.py b/src/controller/python/chip/clusters/Attribute.py index 06e893aa963be4..84124814238969 100644 --- a/src/controller/python/chip/clusters/Attribute.py +++ b/src/controller/python/chip/clusters/Attribute.py @@ -27,16 +27,16 @@ from ctypes import CFUNCTYPE, POINTER, c_size_t, c_uint8, c_uint16, c_uint32, c_uint64, c_void_p, cast, py_object from dataclasses import dataclass, field from enum import Enum, unique -from typing import Any, Callable, Dict, List, Optional, Tuple, Union +from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Union import chip import chip.exceptions import chip.interaction_model import chip.tlv -import construct +import construct # type: ignore from chip.interaction_model import PyWriteAttributeData from chip.native import ErrorSDKPart, PyChipError -from rich.pretty import pprint +from rich.pretty import pprint # type: ignore from .ClusterObjects import Cluster, ClusterAttributeDescriptor, ClusterEvent @@ -58,9 +58,9 @@ class EventPriority(Enum): @dataclass(frozen=True) class AttributePath: - EndpointId: int = None - ClusterId: int = None - AttributeId: int = None + EndpointId: Optional[int] = None + ClusterId: Optional[int] = None + AttributeId: Optional[int] = None @staticmethod def from_cluster(EndpointId: int, Cluster: Cluster) -> AttributePath: @@ -80,12 +80,12 @@ def __str__(self) -> str: @dataclass(frozen=True) class DataVersionFilter: - EndpointId: int = None - ClusterId: int = None - DataVersion: int = None + EndpointId: Optional[int] = None + ClusterId: Optional[int] = None + DataVersion: Optional[int] = None @staticmethod - def from_cluster(EndpointId: int, Cluster: Cluster, DataVersion: int = None) -> AttributePath: + def from_cluster(EndpointId: int, Cluster: Cluster, DataVersion: int) -> DataVersionFilter: if Cluster is None: raise ValueError("Cluster cannot be None") return DataVersionFilter(EndpointId=EndpointId, ClusterId=Cluster.id, DataVersion=DataVersion) @@ -99,70 +99,67 @@ class TypedAttributePath: ''' Encapsulates an attribute path that has strongly typed references to cluster and attribute cluster object types. These types serve as keys into the attribute cache. ''' - ClusterType: Cluster = None - AttributeType: ClusterAttributeDescriptor = None - AttributeName: str = None - Path: AttributePath = None - - def __init__(self, ClusterType: Cluster = None, AttributeType: ClusterAttributeDescriptor = None, - Path: AttributePath = None): - ''' Only one of either ClusterType and AttributeType OR Path may be provided. - ''' - - # - # First, let's populate ClusterType and AttributeType. If it's already provided, - # we can continue onwards to deriving the label. Otherwise, we'll need to - # walk the attribute index to find the right type information. - # - if (ClusterType is not None and AttributeType is not None): - self.ClusterType = ClusterType - self.AttributeType = AttributeType - else: - if (Path is None): - raise ValueError("Path should have a valid value") - + ClusterType: Optional[Cluster] = None + AttributeType: Optional[ClusterAttributeDescriptor] = None + AttributeName: Optional[str] = None + Path: Optional[AttributePath] = None + ClusterId: Optional[int] = None + AttributeId: Optional[int] = None + + def __post_init__(self): + '''Only one of either ClusterType and AttributeType OR Path may be provided.''' + + if (self.ClusterType is not None and self.AttributeType is not None) and self.Path is not None: + raise ValueError("Only one of either ClusterType and AttributeType OR Path may be provided.") + if (self.ClusterType is None or self.AttributeType is None) and self.Path is None: + raise ValueError("Either ClusterType and AttributeType OR Path must be provided.") + + # if ClusterType and AttributeType were provided we can continue onwards to deriving the label. + # Otherwise, we'll need to walk the attribute index to find the right type information. + + # If Path is provided, derive ClusterType and AttributeType from it + if self.Path is not None: for cluster, attribute in _AttributeIndex: attributeType = _AttributeIndex[(cluster, attribute)][0] clusterType = _AttributeIndex[(cluster, attribute)][1] - if (clusterType.id == Path.ClusterId and attributeType.attribute_id == Path.AttributeId): + if clusterType.id == self.Path.ClusterId and attributeType.attribute_id == self.Path.AttributeId: self.ClusterType = clusterType self.AttributeType = attributeType break - if (self.ClusterType is None or self.AttributeType is None): - raise KeyError(f"No Schema found for Attribute {Path}") + if self.ClusterType is None or self.AttributeType is None: + raise KeyError(f"No Schema found for Attribute {self.Path}") # Next, let's figure out the label. for c_field in self.ClusterType.descriptor.Fields: - if (c_field.Tag != self.AttributeType.attribute_id): + if c_field.Tag != self.AttributeType.attribute_id: continue self.AttributeName = c_field.Label - if (self.AttributeName is None): - raise KeyError(f"Unable to resolve name for Attribute {Path}") + if self.AttributeName is None: + raise KeyError(f"Unable to resolve name for Attribute {self.Path}") - self.Path = Path self.ClusterId = self.ClusterType.id self.AttributeId = self.AttributeType.attribute_id @dataclass(frozen=True) class EventPath: - EndpointId: int = None - ClusterId: int = None - EventId: int = None - Urgent: int = None + EndpointId: Optional[int] = None + ClusterId: Optional[int] = None + EventId: Optional[int] = None + Urgent: Optional[int] = None @staticmethod - def from_cluster(EndpointId: int, Cluster: Cluster, EventId: int = None, Urgent: int = None) -> "EventPath": + def from_cluster(EndpointId: int, Cluster: Cluster, EventId: Optional[int] = None, Urgent: Optional[int] = None) -> "EventPath": if Cluster is None: raise ValueError("Cluster cannot be None") return EventPath(EndpointId=EndpointId, ClusterId=Cluster.id, EventId=EventId, Urgent=Urgent) @staticmethod - def from_event(EndpointId: int, Event: ClusterEvent, Urgent: int = None) -> "EventPath": + def from_event(EndpointId: int, Event: ClusterEvent, Urgent: Optional[int] = None) -> "EventPath": if Event is None: raise ValueError("Event cannot be None") return EventPath(EndpointId=EndpointId, ClusterId=Event.cluster_id, EventId=Event.event_id, Urgent=Urgent) @@ -173,23 +170,13 @@ def __str__(self) -> str: @dataclass class EventHeader: - EndpointId: int = None - ClusterId: int = None - EventId: int = None - EventNumber: int = None - Priority: EventPriority = None - Timestamp: int = None - TimestampType: EventTimestampType = None - - def __init__(self, EndpointId: int = None, ClusterId: int = None, - EventId: int = None, EventNumber=None, Priority=None, Timestamp=None, TimestampType=None): - self.EndpointId = EndpointId - self.ClusterId = ClusterId - self.EventId = EventId - self.EventNumber = EventNumber - self.Priority = Priority - self.Timestamp = Timestamp - self.TimestampType = TimestampType + EndpointId: Optional[int] = None + ClusterId: Optional[int] = None + EventId: Optional[int] = None + EventNumber: Optional[int] = None + Priority: Optional[EventPriority] = None + Timestamp: Optional[int] = None + TimestampType: Optional[EventTimestampType] = None def __str__(self) -> str: return (f"{self.EndpointId}/{self.ClusterId}/{self.EventId}/" @@ -247,7 +234,7 @@ class ValueDecodeFailure: ''' TLVValue: Any = None - Reason: Exception = None + Reason: Optional[Exception] = None @dataclass @@ -431,15 +418,16 @@ def handle_attribute_view(endpointId, clusterId, attributeId, attributeType): class SubscriptionTransaction: def __init__(self, transaction: AsyncReadTransaction, subscriptionId, devCtrl): - self._onResubscriptionAttemptedCb = DefaultResubscriptionAttemptedCallback - self._onAttributeChangeCb = DefaultAttributeChangeCallback - self._onEventChangeCb = DefaultEventChangeCallback - self._onErrorCb = DefaultErrorCallback + self._onResubscriptionAttemptedCb: Callable[[SubscriptionTransaction, + int, int], None] = DefaultResubscriptionAttemptedCallback + self._onAttributeChangeCb: Callable[[TypedAttributePath, SubscriptionTransaction], None] = DefaultAttributeChangeCallback + self._onEventChangeCb: Callable[[EventReadResult, SubscriptionTransaction], None] = DefaultEventChangeCallback + self._onErrorCb: Callable[[int, SubscriptionTransaction], None] = DefaultErrorCallback self._readTransaction = transaction self._subscriptionId = subscriptionId self._devCtrl = devCtrl self._isDone = False - self._onResubscriptionSucceededCb = None + self._onResubscriptionSucceededCb: Optional[Callable[[SubscriptionTransaction], None]] = None self._onResubscriptionSucceededCb_isAsync = False self._onResubscriptionAttemptedCb_isAsync = False @@ -647,10 +635,10 @@ def __init__(self, future: Future, eventLoop, devCtrl, returnClusterObject: bool self._event_loop = eventLoop self._future = future self._subscription_handler = None - self._events = [] + self._events: List[EventReadResult] = [] self._devCtrl = devCtrl self._cache = AttributeCache(returnClusterObject=returnClusterObject) - self._changedPathSet = set() + self._changedPathSet: Set[AttributePath] = set() self._pReadClient = None self._pReadCallback = None self._resultError: Optional[PyChipError] = None @@ -809,7 +797,7 @@ class AsyncWriteTransaction: def __init__(self, future: Future, eventLoop): self._event_loop = eventLoop self._future = future - self._resultData = [] + self._resultData: List[AttributeWriteResult] = [] self._resultError: Optional[PyChipError] = None def handleResponse(self, path: AttributePath, status: int): @@ -1014,9 +1002,9 @@ def WriteGroupAttributes(groupId: int, devCtrl: c_void_p, attributes: List[Attri def Read(future: Future, eventLoop, device, devCtrl, - attributes: List[AttributePath] = None, dataVersionFilters: List[DataVersionFilter] = None, - events: List[EventPath] = None, eventNumberFilter: Optional[int] = None, returnClusterObject: bool = True, - subscriptionParameters: SubscriptionParameters = None, + attributes: Optional[List[AttributePath]] = None, dataVersionFilters: Optional[List[DataVersionFilter]] = None, + events: Optional[List[EventPath]] = None, eventNumberFilter: Optional[int] = None, returnClusterObject: bool = True, + subscriptionParameters: Optional[SubscriptionParameters] = None, fabricFiltered: bool = True, keepSubscriptions: bool = False, autoResubscribe: bool = True) -> PyChipError: if (not attributes) and dataVersionFilters: raise ValueError( @@ -1132,9 +1120,9 @@ def Read(future: Future, eventLoop, device, devCtrl, def ReadAttributes(future: Future, eventLoop, device, devCtrl, - attributes: List[AttributePath], dataVersionFilters: List[DataVersionFilter] = None, + attributes: List[AttributePath], dataVersionFilters: Optional[List[DataVersionFilter]] = None, returnClusterObject: bool = True, - subscriptionParameters: SubscriptionParameters = None, fabricFiltered: bool = True) -> int: + subscriptionParameters: Optional[SubscriptionParameters] = None, fabricFiltered: bool = True) -> int: return Read(future=future, eventLoop=eventLoop, device=device, devCtrl=devCtrl, attributes=attributes, dataVersionFilters=dataVersionFilters, events=None, returnClusterObject=returnClusterObject, @@ -1143,7 +1131,7 @@ def ReadAttributes(future: Future, eventLoop, device, devCtrl, def ReadEvents(future: Future, eventLoop, device, devCtrl, events: List[EventPath], eventNumberFilter=None, returnClusterObject: bool = True, - subscriptionParameters: SubscriptionParameters = None, fabricFiltered: bool = True) -> int: + subscriptionParameters: Optional[SubscriptionParameters] = None, fabricFiltered: bool = True) -> int: return Read(future=future, eventLoop=eventLoop, device=device, devCtrl=devCtrl, attributes=None, dataVersionFilters=None, events=events, eventNumberFilter=eventNumberFilter, returnClusterObject=returnClusterObject, diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index cc0b5aaa65a4b2..5ab0ac895b659b 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -15549,7 +15549,7 @@ def __init__(self, chipstack): def GetClusterInfoById(self, cluster_id: int): data = ChipClusters._CLUSTER_ID_DICT.get(cluster_id, None) if not data: - raise exceptions.UnknownCluster(cluster_id) + raise exceptions.UnknownCluster(f"Cluster ID: {cluster_id}") return data def ListClusterInfo(self): diff --git a/src/controller/python/chip/clusters/ClusterObjects.py b/src/controller/python/chip/clusters/ClusterObjects.py index bf07544af9e888..ddafe87bf2c89d 100644 --- a/src/controller/python/chip/clusters/ClusterObjects.py +++ b/src/controller/python/chip/clusters/ClusterObjects.py @@ -22,7 +22,7 @@ from chip import ChipUtility, tlv from chip.clusters.Types import Nullable, NullValue -from dacite import from_dict +from dacite import from_dict # type: ignore def GetUnionUnderlyingType(typeToCheck, matchingType=None): @@ -52,8 +52,8 @@ def GetUnionUnderlyingType(typeToCheck, matchingType=None): @dataclass class ClusterObjectFieldDescriptor: Label: str = '' - Tag: int = None - Type: type = None + Tag: typing.Optional[int] = None + Type: type = type(None) def _PutSingleElementToTLV(self, tag, val, elementType, writer: tlv.TLVWriter, debugPath: str = '?'): if issubclass(elementType, ClusterObject): @@ -113,13 +113,13 @@ def PutFieldToTLV(self, tag, val, writer: tlv.TLVWriter, debugPath: str = '?'): class ClusterObjectDescriptor: Fields: List[ClusterObjectFieldDescriptor] - def GetFieldByTag(self, tag: int) -> ClusterObjectFieldDescriptor: + def GetFieldByTag(self, tag: int) -> typing.Optional[ClusterObjectFieldDescriptor]: for _field in self.Fields: if _field.Tag == tag: return _field return None - def GetFieldByLabel(self, label: str) -> ClusterObjectFieldDescriptor: + def GetFieldByLabel(self, label: str) -> typing.Optional[ClusterObjectFieldDescriptor]: for _field in self.Fields: if _field.Label == label: return _field @@ -140,7 +140,7 @@ def _ConvertNonArray(self, debugPath: str, elementType, value: Any) -> Any: return elementType.descriptor.TagDictToLabelDict(debugPath, value) def TagDictToLabelDict(self, debugPath: str, tlvData: Dict[int, Any]) -> Dict[str, Any]: - ret = {} + ret: typing.Dict[Any, Any] = {} for tag, value in tlvData.items(): descriptor = self.GetFieldByTag(tag) if not descriptor: @@ -156,7 +156,7 @@ def TagDictToLabelDict(self, debugPath: str, tlvData: Dict[int, Any]) -> Dict[st realType = GetUnionUnderlyingType(descriptor.Type) if (realType is None): raise ValueError( - f"Field {debugPath}.{self.Label} has no valid underlying data model type") + f"Field {debugPath}.{descriptor.Label} has no valid underlying data model type") valueType = realType else: @@ -175,7 +175,7 @@ def TagDictToLabelDict(self, debugPath: str, tlvData: Dict[int, Any]) -> Dict[st def TLVToDict(self, tlvBuf: bytes) -> Dict[str, Any]: tlvData = tlv.TLVReader(tlvBuf).get().get('Any', {}) - return self.TagDictToLabelDict([], tlvData) + return self.TagDictToLabelDict('', tlvData) def DictToTLVWithWriter(self, debugPath: str, tag, data: Mapping, writer: tlv.TLVWriter): writer.startStructure(tag) @@ -209,11 +209,11 @@ def descriptor(cls): # The below dictionaries will be filled dynamically # and are used for quick lookup/mapping from cluster/attribute id to the correct class -ALL_CLUSTERS = {} -ALL_ATTRIBUTES = {} +ALL_CLUSTERS: typing.Dict = {} +ALL_ATTRIBUTES: typing.Dict = {} # These need to be separate because there can be overlap in command ids for commands and responses. -ALL_ACCEPTED_COMMANDS = {} -ALL_GENERATED_COMMANDS = {} +ALL_ACCEPTED_COMMANDS: typing.Dict = {} +ALL_GENERATED_COMMANDS: typing.Dict = {} class ClusterCommand(ClusterObject): diff --git a/src/controller/python/chip/clusters/enum.py b/src/controller/python/chip/clusters/enum.py index ce545ebe88e727..73c41e6386cf1a 100644 --- a/src/controller/python/chip/clusters/enum.py +++ b/src/controller/python/chip/clusters/enum.py @@ -17,7 +17,7 @@ from threading import Lock -from aenum import IntEnum, extend_enum +from aenum import IntEnum, extend_enum # type: ignore # Flag on whether we should map unknown enum values to kUnknownEnumValue. _map_missing_enum_to_unknown_enum_value = True diff --git a/src/controller/python/chip/credentials/__init__.py b/src/controller/python/chip/credentials/__init__.py new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/src/controller/python/chip/crypto/__init__.py b/src/controller/python/chip/crypto/__init__.py new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/src/controller/python/chip/crypto/p256keypair.py b/src/controller/python/chip/crypto/p256keypair.py index 3267601b3b3e0f..30198eabee44ff 100644 --- a/src/controller/python/chip/crypto/p256keypair.py +++ b/src/controller/python/chip/crypto/p256keypair.py @@ -17,10 +17,21 @@ import abc import hashlib -from ctypes import CFUNCTYPE, POINTER, c_bool, c_char, c_size_t, c_uint8, c_uint32, c_void_p, memmove, py_object, string_at +from ctypes import (CFUNCTYPE, POINTER, _Pointer, c_bool, c_char, c_size_t, c_uint8, c_uint32, c_void_p, cast, memmove, py_object, + string_at) +from typing import TYPE_CHECKING from chip import native -from ecdsa import ECDH, NIST256p, SigningKey +from ecdsa import ECDH, NIST256p, SigningKey # type: ignore + +# WORKAROUND: Create a subscriptable pointer type (with square brackets) to ensure compliance of type hinting with ctypes +if not TYPE_CHECKING: + class pointer_fix: + @classmethod + def __class_getitem__(cls, item): + return POINTER(item) + _Pointer = pointer_fix + _pychip_P256Keypair_ECDSA_sign_msg_func = CFUNCTYPE( c_bool, py_object, POINTER(c_uint8), c_size_t, POINTER(c_uint8), POINTER(c_size_t)) @@ -31,18 +42,18 @@ @ _pychip_P256Keypair_ECDSA_sign_msg_func -def _pychip_ECDSA_sign_msg(self_: 'P256Keypair', message_buf: POINTER(c_uint8), message_size: int, signature_buf: POINTER(c_uint8), signature_buf_size: POINTER(c_size_t)) -> bool: +def _pychip_ECDSA_sign_msg(self_: 'P256Keypair', message_buf: _Pointer[c_uint8], message_size: int, signature_buf: _Pointer[c_uint8], signature_buf_size: _Pointer[c_size_t]) -> bool: res = self_.ECDSA_sign_msg(string_at(message_buf, message_size)[:]) memmove(signature_buf, res, len(res)) - signature_buf_size.content = len(res) + signature_buf_size.contents.value = len(res) return True @ _pychip_P256Keypair_ECDH_derive_secret_func -def _pychip_ECDH_derive_secret(self_: 'P256Keypair', remote_pubkey: POINTER(c_uint8), out_secret_buf: POINTER(c_uint8), out_secret_buf_size: POINTER(c_uint32)) -> bool: +def _pychip_ECDH_derive_secret(self_: 'P256Keypair', remote_pubkey: _Pointer[c_uint8], out_secret_buf: _Pointer[c_uint8], out_secret_buf_size: _Pointer[c_uint32]) -> bool: res = self_.ECDH_derive_secret(string_at(remote_pubkey, P256_PUBLIC_KEY_LENGTH)[:]) memmove(out_secret_buf, res, len(res)) - out_secret_buf_size.content = len(res) + out_secret_buf_size.contents.value = len(res) return True @@ -95,7 +106,8 @@ def UpdatePublicKey(self) -> None: generates a new keypair. ''' handle = native.GetLibraryHandle() - handle.pychip_P256Keypair_UpdatePubkey(c_void_p(self.native_object), self.public_key, len(self.public_key)).raise_on_error() + handle.pychip_P256Keypair_UpdatePubkey(cast(self._native_obj, c_void_p), + self.public_key, len(self.public_key)).raise_on_error() @abc.abstractproperty def public_key(self) -> bytes: diff --git a/src/controller/python/chip/interaction_model/delegate.py b/src/controller/python/chip/interaction_model/delegate.py index 4741e5f2f74482..201abe4bc7b5f9 100644 --- a/src/controller/python/chip/interaction_model/delegate.py +++ b/src/controller/python/chip/interaction_model/delegate.py @@ -16,14 +16,14 @@ import ctypes import threading -import typing from ctypes import CFUNCTYPE, POINTER, c_uint8, c_uint32, c_uint64, c_void_p from dataclasses import dataclass +from typing import Any, Dict, Optional import chip.exceptions import chip.native import chip.tlv -from construct import Int8ul, Int16ul, Int32ul, Int64ul, Struct +from construct import Int8ul, Int16ul, Int32ul, Int64ul, Struct # type: ignore # The type should match CommandStatus in interaction_model/Delegate.h # CommandStatus should not contain padding @@ -101,14 +101,14 @@ class EventPath: class AttributeReadResult: path: AttributePath status: int - value: 'typing.Any' + value: 'Any' dataVersion: int @dataclass class EventReadResult: path: EventPath - value: 'typing.Any' + value: 'Any' @dataclass @@ -119,12 +119,12 @@ class AttributeWriteResult: @dataclass class SessionParameters: - sessionIdleInterval: typing.Optional[int] - sessionActiveInterval: typing.Optional[int] - sessionActiveThreshold: typing.Optional[int] - dataModelRevision: typing.Optional[int] - interactionModelRevision: typing.Optional[int] - specficiationVersion: typing.Optional[int] + sessionIdleInterval: Optional[int] + sessionActiveInterval: Optional[int] + sessionActiveThreshold: Optional[int] + dataModelRevision: Optional[int] + interactionModelRevision: Optional[int] + specficiationVersion: Optional[int] maxPathsPerInvoke: int @@ -244,15 +244,15 @@ class TestOnlyPyOnDoneInfo(ctypes.Structure): _OnCommandResponseFunct = CFUNCTYPE(None, c_uint64, c_uint32) _OnWriteResponseStatusFunct = CFUNCTYPE(None, c_void_p, c_uint32) -_commandStatusDict = dict() -_commandIndexStatusDict = dict() +_commandStatusDict: Dict[int, Any] = dict() +_commandIndexStatusDict: Dict[int, Any] = dict() _commandStatusLock = threading.RLock() _commandStatusCV = threading.Condition(_commandStatusLock) -_attributeDict = dict() +_attributeDict: Dict[int, Any] = dict() _attributeDictLock = threading.RLock() -_writeStatusDict = dict() +_writeStatusDict: Dict[int, Any] = dict() _writeStatusDictLock = threading.RLock() # A placeholder commandHandle, will be removed once we decouple CommandSender with CHIPClusters diff --git a/src/controller/python/chip/native/__init__.py b/src/controller/python/chip/native/__init__.py index 9ee94c61ddaa7f..518339017b587c 100644 --- a/src/controller/python/chip/native/__init__.py +++ b/src/controller/python/chip/native/__init__.py @@ -23,7 +23,7 @@ from dataclasses import dataclass import chip.exceptions -import construct +import construct # type: ignore class Library(enum.Enum): @@ -84,7 +84,9 @@ class PyChipError(ctypes.Structure): def raise_on_error(self) -> None: if self.code != 0: - raise self.to_exception() + exception = self.to_exception() + if exception is not None: # Ensure exception is not None to avoid mypy error and only raise valid exceptions + raise exception @property def is_success(self) -> bool: @@ -103,20 +105,21 @@ def value(self) -> int: return (self.code) & 0xFFFFFF @property - def sdk_part(self) -> ErrorSDKPart: + def sdk_part(self) -> typing.Optional[ErrorSDKPart]: if not self.is_sdk_error: return None return ErrorSDKPart((self.code >> 8) & 0x07) @property - def sdk_code(self) -> int: + def sdk_code(self) -> typing.Optional[int]: if not self.is_sdk_error: return None return self.code & 0xFF - def to_exception(self) -> typing.Union[None, chip.exceptions.ChipStackError]: + def to_exception(self) -> typing.Optional[chip.exceptions.ChipStackError]: if not self.is_success: return chip.exceptions.ChipStackError.from_chip_error(self) + return None def __str__(self): buf = ctypes.create_string_buffer(256) @@ -204,14 +207,14 @@ def Set(self, methodName: str, resultType, argumentTypes: list): @dataclass class _Handle: - dll: ctypes.CDLL = None + dll: ctypes.CDLL initialized: bool = False _nativeLibraryHandles: typing.Dict[Library, _Handle] = {} -def _GetLibraryHandle(lib: Library, expectAlreadyInitialized: bool) -> ctypes.CDLL: +def _GetLibraryHandle(lib: Library, expectAlreadyInitialized: bool) -> _Handle: """Get a memoized _Handle to the chip native code dll.""" global _nativeLibraryHandles @@ -236,7 +239,7 @@ def _GetLibraryHandle(lib: Library, expectAlreadyInitialized: bool) -> ctypes.CD return handle -def Init(bluetoothAdapter: int = None): +def Init(bluetoothAdapter: typing.Optional[int] = None): CommonStackParams = construct.Struct( "BluetoothAdapterId" / construct.Int32ul, ) diff --git a/src/controller/python/chip/tlv/tlvlist.py b/src/controller/python/chip/tlv/tlvlist.py index a9afaa3e2bb26e..ffeb324968c50c 100644 --- a/src/controller/python/chip/tlv/tlvlist.py +++ b/src/controller/python/chip/tlv/tlvlist.py @@ -169,7 +169,7 @@ def __rich_repr__(self): def __iter__(self) -> """TLVList.Iterator""": return TLVList.Iterator(iter(self._data)) - def __eq__(self, rhs: "TLVList") -> bool: + def __eq__(self, rhs: object) -> bool: if not isinstance(rhs, TLVList): return False return self._data == rhs._data diff --git a/src/controller/python/templates/python-CHIPClusters-py.zapt b/src/controller/python/templates/python-CHIPClusters-py.zapt index 06af555401f199..284cd650a0a772 100644 --- a/src/controller/python/templates/python-CHIPClusters-py.zapt +++ b/src/controller/python/templates/python-CHIPClusters-py.zapt @@ -70,7 +70,7 @@ class ChipClusters: def GetClusterInfoById(self, cluster_id: int): data = ChipClusters._CLUSTER_ID_DICT.get(cluster_id, None) if not data: - raise exceptions.UnknownCluster(cluster_id) + raise exceptions.UnknownCluster(f"Cluster ID: {cluster_id}") return data def ListClusterInfo(self): From 53e94d6a0a175316f5a47c6c5ccbac79c201ac5a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Aug 2024 15:33:12 -0400 Subject: [PATCH 29/40] Enable Aliro bits in example lock-app. (#34657) * Enable Aliro bits in example lock-app. Fixes the FeatureMap on the cluster to enable the Aliro bits as well, and correctly marks the parts that are implemented via AttributeAccessInterface. * Adjust Test_TC_DRLK_2_9 to not fail when Aliro is supported. * Fix issues in test script. --- examples/lock-app/lock-common/lock-app.matter | 13 +- examples/lock-app/lock-common/lock-app.zap | 162 ++++++- .../certification/Test_TC_DRLK_2_1.yaml | 16 +- .../certification/Test_TC_DRLK_2_9.yaml | 15 +- .../tests/suites/certification/ci-pics-values | 26 +- .../zcl/zcl-with-test-extensions.json | 9 + src/app/zap-templates/zcl/zcl.json | 9 + .../zap-generated/attributes/Accessors.cpp | 442 ------------------ .../zap-generated/attributes/Accessors.h | 60 --- 9 files changed, 230 insertions(+), 522 deletions(-) diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 5ee4744f901fde..143d3c67f19031 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -3079,11 +3079,20 @@ 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 = 0x1DB3; + ram attribute featureMap default = 0x7DB3; ram attribute clusterRevision default = 7; handle command LockDoor; @@ -3111,6 +3120,8 @@ endpoint 1 { handle command GetCredentialStatusResponse; handle command ClearCredential; handle command UnboltDoor; + handle command SetAliroReaderConfig; + handle command ClearAliroReaderConfig; } } diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 8e25d9248c1429..30fe0db47c2fa8 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -5851,6 +5851,22 @@ "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": [ @@ -6270,6 +6286,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": "", + "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": "", + "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": "", + "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": "", + "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": "", + "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": "", + "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": "", + "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": "", + "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": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -6344,7 +6504,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x1DB3", + "defaultValue": "0x7DB3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index 8bce2046d74897..519ffa8780f673 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -1579,6 +1579,7 @@ tests: constraints: type: octet_string minLength: 65 + maxLength: 65 - label: "Step 38b: TH writes AliroReaderVerificationKey attribute as an octstr @@ -1608,6 +1609,8 @@ tests: constraints: type: octet_string minLength: 16 + maxLength: 16 + - label: "Step 39b: TH writes AliroReaderGroupIdentifier attribute as octstr value of length 16 which is different from aliroreadergrpidentifier" @@ -1635,6 +1638,7 @@ tests: constraints: type: octet_string minLength: 16 + maxLength: 16 - label: "Step 40b: TH writes AliroReaderGroupSubIdentifier attribute as octstr @@ -1665,6 +1669,7 @@ tests: constraints: type: list maxLength: 16 + - label: "Step 41b: TH writes AliroExpeditedTransactionSupportedProtocolVersions attribute as list @@ -1673,9 +1678,10 @@ tests: command: "writeAttribute" attribute: "AliroExpeditedTransactionSupportedProtocolVersions" arguments: - value: ["0x1", "0x2"] + value: ["\x01", "\x02"] response: error: UNSUPPORTED_WRITE + - label: "Step 41c: TH reads AliroExpeditedTransactionSupportedProtocolVersions attribute from DUT" @@ -1694,6 +1700,7 @@ tests: constraints: type: octet_string minLength: 16 + maxLength: 16 - label: "Step 42b: TH writes AliroGroupResolvingKey attribute as octstr value @@ -1712,6 +1719,7 @@ tests: attribute: "AliroGroupResolvingKey" response: value: alirogrpresolvingkey + - label: "Step 43a: TH reads AliroSupportedBLEUWBProtocolVersions attribute from DUT" @@ -1721,8 +1729,8 @@ tests: response: saveAs: alirobleuwbprotocolversion constraints: - type: octet_string - minLength: 16 + type: list + maxLength: 16 - label: "Step 43b: TH writes AliroSupportedBLEUWBProtocolVersions attribute as @@ -1731,7 +1739,7 @@ tests: command: "writeAttribute" attribute: "AliroSupportedBLEUWBProtocolVersions" arguments: - value: "047a4c992d75368" + value: ["\x01", "\x02"] response: error: UNSUPPORTED_WRITE diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml index 0c10f9fa7ba058..0c0a372b175d7e 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml @@ -431,7 +431,7 @@ tests: - label: "Step 14: TH sends Clear Credential Command to DUT with the following fields: a)CredentialType as 8(Invalid value) b)CredentialIndex as 2" - PICS: DRLK.S.F08 && DRLK.S.C26.Rsp + PICS: DRLK.S.F08 && DRLK.S.C26.Rsp && !DRLK.S.F0d command: "ClearCredential" timedInteractionTimeoutMs: 10000 arguments: @@ -441,6 +441,19 @@ tests: response: error: INVALID_COMMAND + - label: + "Step 14: TH sends Clear Credential Command to DUT with the following + fields: a)CredentialType as 9(Invalid value) b)CredentialIndex as 2" + PICS: DRLK.S.F08 && DRLK.S.C26.Rsp && DRLK.S.F0d + command: "ClearCredential" + timedInteractionTimeoutMs: 10000 + arguments: + values: + - name: "Credential" + value: { CredentialType: 9, CredentialIndex: 2 } + response: + error: INVALID_COMMAND + - label: "Cleanup the first created user" command: "ClearUser" timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 5aa8dba1f684a8..a8601fbd27d3ef 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1519,15 +1519,15 @@ DRLK.S.A0031=1 DRLK.S.A0032=1 DRLK.S.A0033=1 DRLK.S.A0035=0 -DRLK.S.A0080=0 -DRLK.S.A0081=0 -DRLK.S.A0082=0 -DRLK.S.A0083=0 -DRLK.S.A0084=0 -DRLK.S.A0085=0 -DRLK.S.A0086=0 -DRLK.S.A0087=0 -DRLK.S.A0088=0 +DRLK.S.A0080=1 +DRLK.S.A0081=1 +DRLK.S.A0082=1 +DRLK.S.A0083=1 +DRLK.S.A0084=1 +DRLK.S.A0085=1 +DRLK.S.A0086=1 +DRLK.S.A0087=1 +DRLK.S.A0088=1 #ReadOnly attributes DRLK.S.A0028.ReadOnly=1 @@ -1574,8 +1574,8 @@ DRLK.S.F08=1 DRLK.S.F0a=1 DRLK.S.F0b=1 DRLK.S.F0c=1 -DRLK.S.F0d=0 -DRLK.S.F0e=0 +DRLK.S.F0d=1 +DRLK.S.F0e=1 # Server Commands DRLK.S.C00.Rsp=1 @@ -1597,8 +1597,8 @@ DRLK.S.C22.Rsp=1 DRLK.S.C24.Rsp=1 DRLK.S.C26.Rsp=1 DRLK.S.C27.Rsp=1 -DRLK.S.C28.Rsp=0 -DRLK.S.C29.Rsp=0 +DRLK.S.C28.Rsp=1 +DRLK.S.C29.Rsp=1 DRLK.S.C0c.Tx=1 DRLK.S.C0f.Tx=1 DRLK.S.C12.Tx=1 diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 44de496f06f544..d826188bbfd700 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -211,6 +211,15 @@ "CurrentMode", "FeatureMap" ], + "Door Lock": [ + "AliroReaderVerificationKey", + "AliroReaderGroupIdentifier", + "AliroReaderGroupSubIdentifier", + "AliroGroupResolvingKey", + "AliroBLEAdvertisingVersion", + "NumberOfAliroCredentialIssuerKeysSupported", + "NumberOfAliroEndpointKeysSupported" + ], "Energy EVSE": [ "State", "SupplyState", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index a72b44ee03084a..a5d48c88b540a0 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -209,6 +209,15 @@ "CurrentMode", "FeatureMap" ], + "Door Lock": [ + "AliroReaderVerificationKey", + "AliroReaderGroupIdentifier", + "AliroReaderGroupSubIdentifier", + "AliroGroupResolvingKey", + "AliroBLEAdvertisingVersion", + "NumberOfAliroCredentialIssuerKeysSupported", + "NumberOfAliroEndpointKeysSupported" + ], "Energy EVSE": [ "State", "SupplyState", 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 ca6df3d1c72e99..aaabdae8055e4b 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 @@ -18438,448 +18438,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu } // namespace ExpiringUserTimeout -namespace AliroReaderVerificationKey { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - if (value.IsNull()) - { - ChipLogError(Zcl, "Null Nullable passed to DoorLock::AliroReaderVerificationKey::Get"); - return Protocols::InteractionModel::Status::Failure; - } - - uint8_t zclString[65 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - value.SetNull(); - return Protocols::InteractionModel::Status::Success; - } - auto & span = value.Value(); - - VerifyOrReturnError(span.size() == 65, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(span.data(), &zclString[1], 65); - span.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(65 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 65, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[65 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - - static_assert(65 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 65, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[65 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - uint8_t zclString[1] = { 0xFF }; - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) -{ - uint8_t zclString[1] = { 0xFF }; - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(chip::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(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace AliroReaderVerificationKey - -namespace AliroReaderGroupIdentifier { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - if (value.IsNull()) - { - ChipLogError(Zcl, "Null Nullable passed to DoorLock::AliroReaderGroupIdentifier::Get"); - return Protocols::InteractionModel::Status::Failure; - } - - uint8_t zclString[16 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - value.SetNull(); - return Protocols::InteractionModel::Status::Success; - } - auto & span = value.Value(); - - VerifyOrReturnError(span.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(span.data(), &zclString[1], 16); - span.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - uint8_t zclString[1] = { 0xFF }; - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) -{ - uint8_t zclString[1] = { 0xFF }; - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(chip::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(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace AliroReaderGroupIdentifier - -namespace AliroReaderGroupSubIdentifier { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) -{ - uint8_t zclString[16 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - - VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -} // namespace AliroReaderGroupSubIdentifier - -namespace AliroGroupResolvingKey { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) -{ - if (value.IsNull()) - { - ChipLogError(Zcl, "Null Nullable passed to DoorLock::AliroGroupResolvingKey::Get"); - return Protocols::InteractionModel::Status::Failure; - } - - uint8_t zclString[16 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - value.SetNull(); - return Protocols::InteractionModel::Status::Success; - } - auto & span = value.Value(); - - VerifyOrReturnError(span.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(span.data(), &zclString[1], 16); - span.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty) -{ - uint8_t zclString[1] = { 0xFF }; - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint) -{ - uint8_t zclString[1] = { 0xFF }; - return emberAfWriteAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, ZCL_OCTET_STRING_ATTRIBUTE_TYPE); -} - -Protocols::InteractionModel::Status Set(chip::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(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) -{ - if (value.IsNull()) - { - return SetNull(endpoint); - } - - return Set(endpoint, value.Value()); -} - -} // namespace AliroGroupResolvingKey - -namespace AliroBLEAdvertisingVersion { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::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(chip::EndpointId endpoint, uint8_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(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_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::DoorLock::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace AliroBLEAdvertisingVersion - -namespace NumberOfAliroCredentialIssuerKeysSupported { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::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(chip::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(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::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::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace NumberOfAliroCredentialIssuerKeysSupported - -namespace NumberOfAliroEndpointKeysSupported { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::DoorLock::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(chip::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(endpoint, Clusters::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::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::DoorLock::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace NumberOfAliroEndpointKeysSupported - namespace FeatureMap { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_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 ea344fcc49b7cd..85a8aabd8791cc 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 @@ -2994,66 +2994,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t valu Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); } // namespace ExpiringUserTimeout -namespace AliroReaderVerificationKey { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - DataModel::Nullable & value); // octet_string -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace AliroReaderVerificationKey - -namespace AliroReaderGroupIdentifier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - DataModel::Nullable & value); // octet_string -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace AliroReaderGroupIdentifier - -namespace AliroReaderGroupSubIdentifier { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::MutableByteSpan & value); // octet_string -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty); -} // namespace AliroReaderGroupSubIdentifier - -namespace AliroGroupResolvingKey { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, - DataModel::Nullable & value); // octet_string -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::ByteSpan value, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint); -Protocols::InteractionModel::Status SetNull(chip::EndpointId endpoint, MarkAttributeDirty markDirty); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value, - MarkAttributeDirty markDirty); -} // namespace AliroGroupResolvingKey - -namespace AliroBLEAdvertisingVersion { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace AliroBLEAdvertisingVersion - -namespace NumberOfAliroCredentialIssuerKeysSupported { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace NumberOfAliroCredentialIssuerKeysSupported - -namespace NumberOfAliroEndpointKeysSupported { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace NumberOfAliroEndpointKeysSupported - namespace FeatureMap { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); From 4c1f3250a6deaefc750eb074da2ad15f3c2f173e Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 2 Aug 2024 01:17:24 +0530 Subject: [PATCH 30/40] [ESP32] Configure the event logging buffers to reduce dram overflow in all-clusters-app for m5stack (#34718) --- .../all-clusters-app/esp32/sdkconfig_m5stack.defaults | 6 ++++++ .../esp32/sdkconfig_m5stack_rpc.defaults | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults index 287262d17e57cc..8c30112f96d500 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults @@ -73,3 +73,9 @@ CONFIG_BUILD_CHIP_TESTS=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Reduce the event loggin buffer to reduce the DRAM usage +# TODO: remove this once the underlying issue is fixed +CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE=512 +CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE=512 +CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE=512 diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults index 3f1168ecb907ec..f7aba926a4df67 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults @@ -78,9 +78,6 @@ CONFIG_BUILD_CHIP_TESTS=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y -# to avoid dram overflow, reduce the critical loggin buffer to 1K -CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE=1024 - CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP=y # Memory Optimizations @@ -88,3 +85,9 @@ CONFIG_NIMBLE_MAX_CONNECTIONS=1 CONFIG_BTDM_CTRL_BLE_MAX_CONN=1 CONFIG_BT_NIMBLE_ROLE_CENTRAL=n CONFIG_BT_NIMBLE_ROLE_OBSERVER=n + +# Reduce the event loggin buffer to reduce the DRAM overflow +# TODO: remove this once the underlying issue is fixed +CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE=512 +CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE=512 +CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE=512 From 7dd6b4b701e739ba2a671bd630975ca16a3278c7 Mon Sep 17 00:00:00 2001 From: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:09:42 -0700 Subject: [PATCH 31/40] Fix PICS code, add a test that was missed (#34713) * Fix PICS code, add a test that was missed * Editorial fix --------- Co-authored-by: raju-apple <84206864+raju-apple@users.noreply.github.com> --- src/python_testing/TC_TSTAT_4_2.py | 38 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/python_testing/TC_TSTAT_4_2.py b/src/python_testing/TC_TSTAT_4_2.py index 5f53debfa024a0..9a8a8733830cec 100644 --- a/src/python_testing/TC_TSTAT_4_2.py +++ b/src/python_testing/TC_TSTAT_4_2.py @@ -117,11 +117,11 @@ def steps_TC_TSTAT_4_2(self) -> list[TestStep]: TestStep("1", "Commissioning, already done", is_commissioning=True), TestStep("2", "TH writes to the Presets attribute without calling the StartPresetsSchedulesEditRequest command", - "Verify that the Presets attribute was not updated."), + " Verify that the write request returns INVALID_IN_STATE error since the client didn't send a request to edit the presets by calling StartPresetsSchedulesEditRequest command."), TestStep("3", "TH writes to the Presets attribute after calling the StartPresetsSchedulesEditRequest command but doesn't call CommitPresetsSchedulesRequest to commit", - "Verify that the Presets attribute was not updated."), + "Verify that the Presets attribute was not updated since CommitPresetsSchedulesRequest command was not called."), TestStep("4", "TH writes to the Presets attribute after calling the StartPresetsSchedulesEditRequest command and calls CommitPresetsSchedulesRequest to commit", - "Verify that the Presets attribute was updated."), + "Verify that the Presets attribute was updated with new presets."), TestStep("5", "TH writes to the Presets attribute with a built-in preset removed", "Verify that the CommitPresetsSchedulesRequest returned UNSUPPORTED_ACCESS (0x7e)."), TestStep("6", "TH writes to the Presets attribute with a preset removed whose handle matches the value in the ActivePresetHandle attribute", @@ -132,11 +132,13 @@ def steps_TC_TSTAT_4_2(self) -> list[TestStep]: "Verify that the CommitPresetsSchedulesRequest returned CONSTRAINT_ERROR (0x87)."), TestStep("9", "TH writes to the Presets attribute with a new preset having a preset handle that doesn't exist in the Presets attribute", "Verify that the CommitPresetsSchedulesRequest returned NOT_FOUND (0x8b)."), - TestStep("10", "TH writes to the Presets attribute with a non built-in preset modified to be built-in", + TestStep("10", "TH writes to the Presets attribute with duplicate presets", + "Verify that the CommitPresetsSchedulesRequest returned CONSTRAINT_ERROR (0x87)."), + TestStep("11", "TH writes to the Presets attribute with a non built-in preset modified to be built-in", "Verify that the CommitPresetsSchedulesRequest returned UNSUPPORTED_ACCESS (0x7e)."), - TestStep("11", "TH writes to the Presets attribute with a preset that doesn't support names in the PresetTypeFeatures bitmap but has a name", + TestStep("12", "TH writes to the Presets attribute with a preset that doesn't support names in the PresetTypeFeatures bitmap but has a name", "Verify that the CommitPresetsSchedulesRequest returned CONSTRAINT_ERROR (0x87)."), - TestStep("12", "TH writes to the Presets attribute but calls the CancelPresetsSchedulesEditRequest command to cancel the edit request", + TestStep("13", "TH writes to the Presets attribute but calls the CancelPresetsSchedulesEditRequest command to cancel the edit request", "Verify that the edit request was cancelled"), ] @@ -161,7 +163,7 @@ async def test_TC_TSTAT_4_2(self): asserts.assert_true(status_ok, "Presets write did not return InvalidInState as expected") self.step("3") - if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp")): await self.send_edit_preset_request_command() # Write to the presets attribute after calling StartPresetsSchedulesEditRequest command @@ -292,6 +294,24 @@ async def test_TC_TSTAT_4_2(self): # Send the StartPresetsSchedulesEditRequest command await self.send_edit_preset_request_command() + # Write to the presets attribute after adding a duplicate preset with handle (b'\x03') + test_presets = copy.deepcopy(new_presets_with_handle) + test_presets.append(cluster.Structs.PresetStruct( + presetHandle=b'\x03', presetScenario=cluster.Enums.PresetScenarioEnum.kSleep, name="Sleep", coolingSetpoint=2700, heatingSetpoint=1900, builtIn=False)) + + status = await self.write_presets(endpoint=endpoint, presets=test_presets) + status_ok = (status == Status.Success) + asserts.assert_true(status_ok, "Presets write did not return Success as expected") + + # Send the CommitPresetsSchedulesRequest command and expect ConstraintError + await self.send_commit_preset_request_command(expected_status=Status.ConstraintError) + + self.step("11") + if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): + + # Send the StartPresetsSchedulesEditRequest command + await self.send_edit_preset_request_command() + # Write to the presets attribute after setting the builtIn flag to True for preset with handle (b'\x03') test_presets = copy.deepcopy(new_presets_with_handle) test_presets[2].builtIn = True @@ -303,7 +323,7 @@ async def test_TC_TSTAT_4_2(self): # Send the CommitPresetsSchedulesRequest command and expect UnsupportedAccess await self.send_commit_preset_request_command(expected_status=Status.UnsupportedAccess) - self.step("11") + self.step("12") if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): # Send the StartPresetsSchedulesEditRequest command @@ -320,7 +340,7 @@ async def test_TC_TSTAT_4_2(self): # Send the CommitPresetsSchedulesRequest command and expect ConstraintError await self.send_commit_preset_request_command(expected_status=Status.ConstraintError) - self.step("12") + self.step("13") if self.pics_guard(self.check_pics("TSTAT.S.F08") and self.check_pics("TSTAT.S.A0050") and self.check_pics("TSTAT.S.C07.Rsp") and self.check_pics("TSTAT.S.C09.Rsp")): # Send the StartPresetsSchedulesEditRequest command From d0d91272068f267cf880f9d56787ca28da885673 Mon Sep 17 00:00:00 2001 From: Jae Son <12516308+jaehs6sam@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:04:22 -0500 Subject: [PATCH 32/40] Occupancy Sensing cluster Python test scripts (#34572) * Occupancy Sensing cluster Python test scripts Consolidate previous TC-OCC-xx test script PRs (PR 34490, PR 34491, PR 34492, PR 34523) into this one upload. * Update TC_OCC_2_1.py * Update TC_OCC_2_2.py syntax error * Update TC_OCC_2_3.py * Update TC_OCC_3_1.py * Update TC_OCC_3_2.py * Update TC_OCC_2_1.py Accommodated recent test plan attribute conformance and Cecille comments * Update TC_OCC_2_2.py Reflected table 2.7.6.2 * Update TC_OCC_2_3.py Modified according to comments * Update TC_OCC_3_1.py Add CLI * Update TC_OCC_3_2.py Fixed some errors and added some random values for subscription testing * Update TC_OCC_2_1.py Updated more detail test step failure description. * Update TC_OCC_3_1.py Updating some of user input call according to comments. * Update TC_OCC_2_1.py python code bug fixing * Update TC_OCC_2_2.py python bug fixing * Update TC_OCC_2_3.py python bug fix * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py step numbering fix * Update TC_OCC_3_2.py * Update TC_OCC_3_2.py * Update TC_OCC_3_1.py * Update TC_OCC_2_3.py * Update TC_OCC_2_2.py * Update TC_OCC_2_1.py * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update src/python_testing/TC_OCC_2_1.py Co-authored-by: C Freeman * Update TC_OCC_2_2.py Fixed bitmap conditional statement * Update TC_OCC_3_1.py * Update TC_OCC_2_1.py Add additional changes according to comments received. * Update TC_OCC_3_1.py * Update TC_OCC_3_2.py test step change * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py update on PIR * Update TC_OCC_2_2.py * Update TC_OCC_2_1.py restyled * Update TC_OCC_2_2.py restyled * Update TC_OCC_2_3.py restyled * Update TC_OCC_3_1.py restyled * Update TC_OCC_3_2.py restyled * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Update TC_OCC_2_1.py * Restyle * Update TC_OCC_2_2.py bitmap conditional statement revised * Update TC_OCC_2_2.py Bitmap matching statement update * Update TC_OCC_3_1.py * Update src/python_testing/TC_OCC_2_2.py typo Co-authored-by: Andrei Litvin * Update src/python_testing/TC_OCC_2_2.py Co-authored-by: Andrei Litvin * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py rewriting sensor type check * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py * Update TC_OCC_2_2.py * Restyle * Proposal for TC_OCC bitmap compares * Fix typo * Fix map * Update TC_OCC_3_2.py added else on conditional statement. * Update TC_OCC_3_2.py put skip back * Restyle * Typo fixes and enable some tests in CI * Fix OCC_2_1 to run in CI * Fix all clusters for TC_OCC_2_2 and some logging * make all TC_OCC_2_* pass * Restyle * Enable tests in ci --------- Co-authored-by: C Freeman Co-authored-by: Andrei Litvin Co-authored-by: Andrei Litvin --- .github/workflows/tests.yaml | 3 + .../all-clusters-app.matter | 10 +- .../all-clusters-common/all-clusters-app.zap | 44 ++- .../src/occupancy-sensing-stub.cpp | 2 +- src/python_testing/TC_OCC_2_1.py | 278 ++++++++++++++++++ src/python_testing/TC_OCC_2_2.py | 132 +++++++++ src/python_testing/TC_OCC_2_3.py | 127 ++++++++ src/python_testing/TC_OCC_3_1.py | 126 ++++++++ src/python_testing/TC_OCC_3_2.py | 248 ++++++++++++++++ 9 files changed, 959 insertions(+), 11 deletions(-) create mode 100644 src/python_testing/TC_OCC_2_1.py create mode 100644 src/python_testing/TC_OCC_2_2.py create mode 100644 src/python_testing/TC_OCC_2_3.py create mode 100644 src/python_testing/TC_OCC_3_1.py create mode 100644 src/python_testing/TC_OCC_3_2.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5e38c6c341bea6..c19eccb9a30457 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -571,6 +571,9 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_TestEventTrigger.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TestBatchInvoke.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TestGroupTableReports.py' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_1.py' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_2.py' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_3.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPCREDS_3_1.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPCREDS_3_2.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_1.py' 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 f69ed20583379c..eb172fa54dcff9 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 @@ -9025,10 +9025,11 @@ endpoint 1 { server cluster OccupancySensing { ram attribute occupancy; ram attribute occupancySensorType; - ram attribute occupancySensorTypeBitmap; + ram attribute occupancySensorTypeBitmap default = 1; ram attribute holdTime default = 10; callback attribute holdTimeLimits; - ram attribute featureMap default = 0x01; + ram attribute PIROccupiedToUnoccupiedDelay default = 10; + ram attribute featureMap default = 0x02; ram attribute clusterRevision default = 5; } @@ -9502,10 +9503,11 @@ endpoint 2 { server cluster OccupancySensing { ram attribute occupancy; ram attribute occupancySensorType; - ram attribute occupancySensorTypeBitmap; + ram attribute occupancySensorTypeBitmap default = 1; ram attribute holdTime default = 20; callback attribute holdTimeLimits; - ram attribute featureMap default = 0x01; + ram attribute PIROccupiedToUnoccupiedDelay default = 10; + ram attribute featureMap default = 0x02; ram attribute clusterRevision default = 5; } } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 7b3ccf977dbc2b..cde6889cd93f19 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -16678,7 +16678,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -16726,7 +16726,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -19103,7 +19103,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -19141,6 +19141,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "PIROccupiedToUnoccupiedDelay", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -19151,7 +19167,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0x02", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25244,7 +25260,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "1", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -25282,6 +25298,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "PIROccupiedToUnoccupiedDelay", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "FeatureMap", "code": 65532, @@ -25292,7 +25324,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "0x02", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp index dcbb90ff659bcb..776e108911aaef 100644 --- a/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp @@ -36,7 +36,7 @@ void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId) VerifyOrDie(!gAttrAccess[endpointId]); gAttrAccess[endpointId] = std::make_unique( - BitMask(OccupancySensing::Feature::kOther)); + BitMask(OccupancySensing::Feature::kPassiveInfrared)); OccupancySensing::Structs::HoldTimeLimitsStruct::Type holdTimeLimits = { .holdTimeMin = 1, diff --git a/src/python_testing/TC_OCC_2_1.py b/src/python_testing/TC_OCC_2_1.py new file mode 100644 index 00000000000000..cf39a7eff5a111 --- /dev/null +++ b/src/python_testing/TC_OCC_2_1.py @@ -0,0 +1,278 @@ +# +# 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. +# +# There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 4 +# [TC-OCC-3.2] test precedure step 3a, 3c + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_OCC_2_1(MatterBaseTest): + async def read_occ_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.OccupancySensing + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + def desc_TC_OCC_2_1(self) -> str: + return "[TC-OCC-2.1] Attributes with DUT as Server" + + def steps_TC_OCC_2_1(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep(2, "Read Occupancy attribute."), + TestStep(3, "Read OccupancySensorType attribute."), + TestStep(4, "Read OccupancySensorTypeBitmap attribute."), + TestStep(5, "Read HoldTimeLimits attribute, if supported"), + TestStep(6, "Read HoldTime attribute, if supported"), + TestStep(7, "Read PIROccupiedToUnoccupiedDelay attribute, if supported"), + TestStep(8, "Read PIRUnoccupiedToOccupiedDelay attribute, if supported"), + TestStep(9, "Read PIRUnoccupiedToOccupiedThreshold attribute, if supported"), + TestStep(10, "Read UltrasonicOccupiedToUnoccupiedDelay attribute, if supported"), + TestStep(11, "Read UltrasonicUnoccupiedToOccupiedDelay attribute, if supported"), + TestStep(12, "Read UltrasonicUnoccupiedToOccupiedThreshold attribute, if supported"), + TestStep(13, "Read PhysicalContactOccupiedToUnoccupiedDelay attribute, if supported"), + TestStep(14, "Read PhysicalContactUnoccupiedToOccupiedDelay attribute, if supported"), + TestStep(15, "Read PhysicalContactUnoccupiedToOccupiedThreshold attribute, if supported") + ] + return steps + + def pics_TC_OCC_2_1(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + @async_test_body + async def test_TC_OCC_2_1(self): + + endpoint = self.user_params.get("endpoint", 1) + + self.step(1) + attributes = Clusters.OccupancySensing.Attributes + attribute_list = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList) + + self.step(2) + asserts.assert_in(attributes.Occupancy.attribute_id, attribute_list, "Occupancy attribute is mandatory") + occupancy_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.Occupancy) + asserts.assert_less_equal(occupancy_dut, 0b00000001, "Occupancy attribute is not in valid range") + + self.step(3) + asserts.assert_in(attributes.OccupancySensorType.attribute_id, attribute_list, + "OccupancySensorType attribute is a mandatory attribute.") + + occupancy_sensor_type_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.OccupancySensorType) + asserts.assert_less(occupancy_sensor_type_dut, Clusters.Objects.OccupancySensing.Enums.OccupancySensorTypeEnum.kUnknownEnumValue, + "OccupancySensorType is not in valid range") + asserts.assert_in(occupancy_sensor_type_dut, {Clusters.Objects.OccupancySensing.Enums.OccupancySensorTypeEnum.kPir, + Clusters.Objects.OccupancySensing.Enums.OccupancySensorTypeEnum.kUltrasonic, + Clusters.Objects.OccupancySensing.Enums.OccupancySensorTypeEnum.kPIRAndUltrasonic, + Clusters.Objects.OccupancySensing.Enums.OccupancySensorTypeEnum.kPhysicalContact}, "OccupancySensorType is not in valid range") + self.step(4) + asserts.assert_in(attributes.OccupancySensorTypeBitmap.attribute_id, attribute_list, + "OccupancySensorTypeBitmap attribute is a mandatory attribute.") + + occupancy_sensor_type_bitmap_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.OccupancySensorTypeBitmap) + asserts.assert_less_equal(occupancy_sensor_type_bitmap_dut, 0b00000111, + "OccupancySensorTypeBitmap attribute is not in valid range") + + self.step(5) + if attributes.HoldTimeLimits.attribute_id in attribute_list: + asserts.assert_in(attributes.HoldTime.attribute_id, attribute_list, "HoldTime attribute conformance failed.") + hold_time_limits_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTimeLimits) + asserts.assert_less_equal(hold_time_limits_dut.holdTimeMin, hold_time_limits_dut.holdTimeMax, + "HoldTimeMin is not in valid range") + asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMin, 0, "HoldTimeMin is not in valid range") + asserts.assert_less_equal(hold_time_limits_dut.holdTimeMax, 0xFFFE, "HoldTimeMin is not in valid range") + asserts.assert_greater_equal(hold_time_limits_dut.holdTimeMax, + hold_time_limits_dut.holdTimeMin, "HoldTimeMin is not in valid range") + asserts.assert_less_equal(hold_time_limits_dut.holdTimeDefault, + hold_time_limits_dut.holdTimeMax, "HoldTimeMin is not in valid range") + asserts.assert_greater_equal(hold_time_limits_dut.holdTimeDefault, + hold_time_limits_dut.holdTimeMin, "HoldTimeMin is not in valid range") + else: + logging.info("HoldTimeLimits not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(6) + if attributes.HoldTime.attribute_id in attribute_list: + hold_time_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTime) + hold_time_limits_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTimeLimits) + + asserts.assert_less_equal(hold_time_dut, hold_time_limits_dut.holdTimeMax, "HoldTime attribute is out of range") + asserts.assert_greater_equal(hold_time_dut, hold_time_limits_dut.holdTimeMin, "HoldTime attribute is out of range") + else: + logging.info("HoldTime not supported. The rest of legacy attribute test can be skipped") + self.skip_all_remaining_steps(7) + return + + self.step(7) + if attributes.PIROccupiedToUnoccupiedDelay.attribute_id in attribute_list: + has_pir_bitmap = (occupancy_sensor_type_bitmap_dut & + Clusters.OccupancySensing.Bitmaps.OccupancySensorTypeBitmap.kPir) != 0 + has_ultrasonic_bitmap = (occupancy_sensor_type_bitmap_dut & + Clusters.OccupancySensing.Bitmaps.OccupancySensorTypeBitmap.kUltrasonic) != 0 + has_phy_bitmap = (occupancy_sensor_type_bitmap_dut & + Clusters.OccupancySensing.Bitmaps.OccupancySensorTypeBitmap.kPhysicalContact) != 0 + if has_pir_bitmap or (not has_ultrasonic_bitmap and not has_phy_bitmap): + pir_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIROccupiedToUnoccupiedDelay) + asserts.assert_less_equal(pir_otou_delay_dut, 0xFFFE, "PIROccupiedToUnoccupiedDelay is not in valid range") + asserts.assert_greater_equal(pir_otou_delay_dut, 0, "PIROccupiedToUnoccupiedDelay is not in valid range") + else: + logging.info("PIROccupiedToUnoccupiedDelay conformance failed") + asserts.fail( + f"PIROccupiedToUnoccupiedDelay conformance is incorrect: {has_pir_bitmap}, {has_ultrasonic_bitmap}, {has_phy_bitmap}") + else: + logging.info("PIROccupiedToUnoccupiedDelay not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(8) + if attributes.PIRUnoccupiedToOccupiedDelay.attribute_id in attribute_list: + has_delay = attributes.PIRUnoccupiedToOccupiedDelay.attribute_id in attribute_list + has_threshold = attributes.PIRUnoccupiedToOccupiedThreshold.attribute_id in attribute_list + asserts.assert_equal(has_delay, has_threshold, "PIRUnoccupiedToOccupiedDelay conformance failure") + pir_utoo_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIRUnoccupiedToOccupiedDelay) + asserts.assert_less_equal(pir_utoo_delay_dut, 0xFFFE, "PIRUnoccupiedToOccupiedDelay is not in valid range") + asserts.assert_greater_equal(pir_utoo_delay_dut, 0, "PIRUnoccupiedToOccupiedDelay is not in valid range") + else: + logging.info("PIRUnoccupiedToOccupiedDelay not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(9) + if attributes.PIRUnoccupiedToOccupiedThreshold.attribute_id in attribute_list: + has_delay = attributes.PIRUnoccupiedToOccupiedDelay.attribute_id in attribute_list + has_threshold = attributes.PIRUnoccupiedToOccupiedThreshold.attribute_id in attribute_list + asserts.assert_equal(has_delay, has_threshold, "PIRUnoccupiedToOccupiedThreshold conformance failure") + pir_utoo_threshold_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIRUnoccupiedToOccupiedThreshold) + asserts.assert_less_equal(pir_utoo_threshold_dut, 0xFE, "PIRUnoccupiedToOccupiedThreshold is not in valid range") + asserts.assert_greater_equal(pir_utoo_threshold_dut, 0, "PIRUnoccupiedToOccupiedThreshold is not in valid range") + else: + logging.info("PIRUnoccupiedToOccupiedThreshold not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(10) + if attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list: + has_ultrasonic_bitmap = (occupancy_sensor_type_bitmap_dut & + Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kUltrasonic) != 0 + has_ultrasonic_delay = attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list + asserts.assert_equal(has_ultrasonic_bitmap, has_ultrasonic_delay, "Bad conformance on Ultrasonic bitmap") + + ultrasonic_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.UltrasonicOccupiedToUnoccupiedDelay) + asserts.assert_less_equal(ultrasonic_otou_delay_dut, 0xFFFE, + "UltrasonicOccupiedToUnoccupiedDelay is not in valid range") + asserts.assert_greater_equal(ultrasonic_otou_delay_dut, 0, "UltrasonicOccupiedToUnoccupiedDelay is not in valid range") + + else: + logging.info("UltrasonicOccupiedToUnoccupiedDelay not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(11) + if attributes.UltrasonicUnoccupiedToOccupiedDelay.attribute_id in attribute_list: + has_delay = attributes.UltrasonicUnoccupiedToOccupiedDelay.attribute_id in attribute_list + has_threshold = attributes.UltrasonicUnoccupiedToOccupiedThreshold.attribute_id in attribute_list + asserts.assert_equal(has_delay, has_threshold, "UltrasonicUnoccupiedToOccupiedDelay conformance failure") + + ultrasonic_utoo_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.UltrasonicUnoccupiedToOccupiedDelay) + asserts.assert_less_equal(ultrasonic_utoo_delay_dut, 0xFFFE, + "UltrasonicUnoccupiedToOccupiedDelay is not in valid range") + asserts.assert_greater_equal(ultrasonic_utoo_delay_dut, 0, "UltrasonicUnoccupiedToOccupiedDelay is not in valid range") + else: + logging.info("UltrasonicUnoccupiedToOccupiedDelay not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(12) + if attributes.UltrasonicUnoccupiedToOccupiedThreshold.attribute_id in attribute_list: + has_delay = attributes.UltrasonicUnoccupiedToOccupiedDelay.attribute_id in attribute_list + has_threshold = attributes.UltrasonicUnoccupiedToOccupiedThreshold.attribute_id in attribute_list + asserts.assert_equal(has_delay, has_threshold, "UltrasonicUnoccupiedToOccupiedThreshold conformance failure") + + ultrasonic_utoo_threshold_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.UltrasonicUnoccupiedToOccupiedThreshold) + asserts.assert_less_equal(ultrasonic_utoo_threshold_dut, 0xFE, + "UltrasonicUnoccupiedToOccupiedThreshold is not in valid range") + asserts.assert_greater_equal(ultrasonic_utoo_threshold_dut, 0, + "UltrasonicUnoccupiedToOccupiedThreshold is not in valid range") + + else: + logging.info("UltrasonicUnoccupiedToOccupiedThreshold not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(13) + if attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list: + has_phycon_bitmap = (occupancy_sensor_type_bitmap_dut & + Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kPhysicalContact) != 0 + has_phycon_delay = attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list + asserts.assert_equal(has_phycon_bitmap, has_phycon_delay, "Bad conformance on PhysicalContact bitmap") + phycontact_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PhysicalContactOccupiedToUnoccupiedDelay) + asserts.assert_less_equal(phycontact_otou_delay_dut, 0xFFFE, + "PhysicalContactOccupiedToUnoccupiedDelay is not in valid range") + asserts.assert_greater_equal(phycontact_otou_delay_dut, 0, + "PhysicalContactOccupiedToUnoccupiedDelay is not in valid range") + + else: + logging.info("PhysicalContactOccupiedToUnoccupiedDelay not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(14) + if attributes.PhysicalContactUnoccupiedToOccupiedDelay.attribute_id in attribute_list: + has_delay = attributes.PhysicalContactUnoccupiedToOccupiedDelay.attribute_id in attribute_list + has_threshold = attributes.PhysicalContactUnoccupiedToOccupiedThreshold.attribute_id in attribute_list + asserts.assert_equal(has_delay, has_threshold, "PhysicalContactUnoccupiedToOccupiedDelay conformance failure") + + phycontact_utoo_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PhysicalContactUnoccupiedToOccupiedDelay) + asserts.assert_less_equal(phycontact_utoo_delay_dut, 0xFFFE, + "PhysicalContactUnoccupiedToOccupiedDelay is not in valid range") + asserts.assert_greater_equal(phycontact_utoo_delay_dut, 0, + "PhysicalContactUnoccupiedToOccupiedDelay is not in valid range") + + else: + logging.info("PhysicalContactUnoccupiedToOccupiedDelay not supported. Test step skipped") + self.mark_current_step_skipped() + + self.step(15) + if attributes.PhysicalContactUnoccupiedToOccupiedThreshold.attribute_id in attribute_list: + has_delay = attributes.PhysicalContactUnoccupiedToOccupiedDelay.attribute_id in attribute_list + has_threshold = attributes.PhysicalContactUnoccupiedToOccupiedThreshold.attribute_id in attribute_list + asserts.assert_equal(has_delay, has_threshold, "PhysicalContactUnoccupiedToOccupiedThreshold conformance failure") + + phycontact_utoo_threshold_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PhysicalContactUnoccupiedToOccupiedThreshold) + asserts.assert_less_equal(phycontact_utoo_threshold_dut, 0xFE, + "PhysicalContactUnoccupiedToOccupiedThreshold is not in valid range") + asserts.assert_greater_equal(phycontact_utoo_threshold_dut, 0, + "PhysicalContactUnoccupiedToOccupiedThreshold is not in valid range") + + else: + logging.info("PhysicalContactUnoccupiedToOccupiedThreshold not supported. Test step skipped") + self.mark_current_step_skipped() + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py new file mode 100644 index 00000000000000..e27bbf30ebcade --- /dev/null +++ b/src/python_testing/TC_OCC_2_2.py @@ -0,0 +1,132 @@ +# +# 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. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_OCC_2_2(MatterBaseTest): + async def read_occ_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.OccupancySensing + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + def desc_TC_OCC_2_2(self) -> str: + return "[TC-OCC-2.2] OccupancySensorTypeBitmap and OccupancySensorType interdependency with server as DUT" + + def steps_TC_OCC_2_2(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep(2, "Read OccupancySensorType attribute selection based on FeatureMap Bitmap."), + TestStep(3, "Read OccupancySensorTypeBitmap attribute selection based on FeatureMap Bitmap.") + ] + return steps + + def pics_TC_OCC_2_2(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + @async_test_body + async def test_TC_OCC_2_2(self): + + endpoint = self.user_params.get("endpoint", 1) + + attributes = Clusters.OccupancySensing.Attributes + feature_map = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.FeatureMap) + + self.step(1) + attribute_list = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList) + + self.step(2) + # OccupancySensorType will be determined by FeatureMap matching table at 2.7.6.2. + asserts.assert_in(attributes.OccupancySensorType.attribute_id, attribute_list, + "OccupancySensorType attribute is a mandatory attribute.") + occupancy_sensor_type_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.OccupancySensorType) + + # For validation purposes, 2.7.6.2 table describes what feature flags map to what type of sensors + TypeEnum = Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum + + Y = True + N = False + # Map is PIR, US, PHY => expected sensor type + # odd Y/N mapping to make the table align nicely + mappings = { + (N, N, N): TypeEnum.kPir, + (Y, N, N): TypeEnum.kPir, + (N, Y, N): TypeEnum.kUltrasonic, + (Y, Y, N): TypeEnum.kPIRAndUltrasonic, + (N, N, Y): TypeEnum.kPhysicalContact, + (Y, N, Y): TypeEnum.kPir, + (N, Y, Y): TypeEnum.kUltrasonic, + (Y, Y, Y): TypeEnum.kPIRAndUltrasonic, + } + + FeatureBit = Clusters.OccupancySensing.Bitmaps.Feature + expected = mappings.get( + ( + (feature_map & FeatureBit.kPassiveInfrared) != 0, + (feature_map & FeatureBit.kUltrasonic) != 0, + (feature_map & FeatureBit.kPhysicalContact) != 0 + )) + + asserts.assert_equal( + occupancy_sensor_type_dut, + expected, + f"Sensor Type should be f{expected}" + ) + + self.step(3) + # OccupancySensorTypeBitmap will be determined by FeatureMap matching table at 2.7.6.2. + asserts.assert_in(attributes.OccupancySensorTypeBitmap.attribute_id, attribute_list, + "OccupancySensorTypeBitmap attribute is a mandatory attribute.") + + occupancy_sensor_type_bitmap_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.OccupancySensorTypeBitmap) + + # Feature map must match the sensor type bitmap + must_match_bits = [ + (Clusters.OccupancySensing.Bitmaps.OccupancySensorTypeBitmap.kPir, + Clusters.OccupancySensing.Bitmaps.Feature.kPassiveInfrared, "PIR"), + (Clusters.OccupancySensing.Bitmaps.OccupancySensorTypeBitmap.kUltrasonic, + Clusters.OccupancySensing.Bitmaps.Feature.kUltrasonic, "Ultrasonic"), + (Clusters.OccupancySensing.Bitmaps.OccupancySensorTypeBitmap.kPhysicalContact, + Clusters.OccupancySensing.Bitmaps.Feature.kPhysicalContact, "Physical contact"), + ] + + for sensor_bit, feature_bit, name in must_match_bits: + asserts.assert_equal( + (occupancy_sensor_type_bitmap_dut & sensor_bit) != 0, + (feature_map & feature_bit) != 0, + f"Feature bit and sensor bitmap must be equal for {name} (BITMAP: 0x{occupancy_sensor_type_bitmap_dut:02X}, FEATUREMAP: 0x{feature_map:02X})" + ) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OCC_2_3.py b/src/python_testing/TC_OCC_2_3.py new file mode 100644 index 00000000000000..0184b670c6b306 --- /dev/null +++ b/src/python_testing/TC_OCC_2_3.py @@ -0,0 +1,127 @@ +# +# 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. +# + +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === + +import logging + +import chip.clusters as Clusters +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_OCC_2_3(MatterBaseTest): + async def read_occ_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.OccupancySensing + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + def desc_TC_OCC_2_3(self) -> str: + return "[TC-OCC-2.3] HoldTime Backward Compatibility Test with server as DUT" + + def steps_TC_OCC_2_3(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH", is_commissioning=True), + TestStep(2, "DUT supports HoldTime attribute. If DUT doesn’t support it, then stop and exit this test case."), + TestStep(3, "Based on the feature flag value table, read OccupancySensorType attribute from DUT"), + TestStep(4, "If TH reads 0 - PIR, TH reads PIROccupiedToUnoccupiedDelay attribute and its value should be same as HoldTime"), + TestStep(5, "If TH reads 1 - Ultrasonic, TH reads UltrasonicOccupiedToUnoccupiedDelay attribute and its value should be same as HoldTime"), + TestStep(6, "If TH reads 2 - PHY, TH reads PhysicalContactOccupiedToUnoccupiedDelay attribute and its value should be same as HoldTime") + ] + return steps + + def pics_TC_OCC_2_3(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + @async_test_body + async def test_TC_OCC_2_3(self): + + endpoint = self.user_params.get("endpoint", 1) + + self.step(1) + attributes = Clusters.OccupancySensing.Attributes + attribute_list = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList) + + self.step(2) + if attributes.HoldTime.attribute_id in attribute_list: + occupancy_hold_time_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTime) + else: + logging.info("No HoldTime attribute supports. Terminate this test case") + + self.step(3) + if attributes.OccupancySensorType.attribute_id in attribute_list: + occupancy_sensor_type_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.OccupancySensorType) + + asserts.assert_less_equal(occupancy_sensor_type_dut, 3, "OccupancySensorType attribute is out of range") + asserts.assert_greater_equal(occupancy_sensor_type_dut, 0, "OccupancySensorType attribute is out of range") + else: + logging.info("OccupancySensorType attribute doesn't exist. Test step skipped") + + if occupancy_sensor_type_dut == Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kPir: + self.step(4) + occupancy_pir_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIROccupiedToUnoccupiedDelay) + + asserts.assert_equal(occupancy_pir_otou_delay_dut, occupancy_hold_time_dut, + "HoldTime attribute value is not equal to PIROccupiedToUnoccupiedDelay") + self.skip_step(5) + self.skip_step(6) + + elif occupancy_sensor_type_dut == Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kUltrasonic: + self.step(4) + occupancy_pir_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIROccupiedToUnoccupiedDelay) + + asserts.assert_equal(occupancy_pir_otou_delay_dut, occupancy_hold_time_dut, + "HoldTime attribute value is not equal to PIROccupiedToUnoccupiedDelay") + self.step(5) + occupancy_us_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.UltrasonicOccupiedToUnoccupiedDelay) + + asserts.assert_equal(occupancy_us_otou_delay_dut, occupancy_hold_time_dut, + "HoldTime attribute value is not equal to UltrasonicOccupiedToUnoccupiedDelay") + self.skip_step(6) + + elif occupancy_sensor_type_dut == Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kPIRAndUltrasonic: + occupancy_pirus_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIROccupiedToUnoccupiedDelay) + + asserts.assert_equal(occupancy_pirus_otou_delay_dut, occupancy_hold_time_dut, + "HoldTime attribute value is not equal to PIROccupiedToUnoccupiedDelay") + + elif occupancy_sensor_type_dut == Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kPhysicalContact: + self.skip_step(4) + self.skip_step(5) + self.step(6) + occupancy_phy_otou_delay_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PhysicalContactOccupiedToUnoccupiedDelay) + + asserts.assert_equal(occupancy_phy_otou_delay_dut, occupancy_hold_time_dut, + "HoldTime attribute value is not equal to PhysicalContactOccupiedToUnoccupiedDelay") + else: + logging.info("OccupancySensorType attribute value is out of range") + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OCC_3_1.py b/src/python_testing/TC_OCC_3_1.py new file mode 100644 index 00000000000000..4380866333f339 --- /dev/null +++ b/src/python_testing/TC_OCC_3_1.py @@ -0,0 +1,126 @@ +# +# 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. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${TYPE_OF_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === +# There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 4 +# [TC-OCC-3.2] test precedure step 3c + +import logging +import time + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.interaction_model import Status +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_OCC_3_1(MatterBaseTest): + async def read_occ_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.OccupancySensing + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + def desc_TC_OCC_3_1(self) -> str: + return "[TC-OCC-3.1] Primary functionality with server as DUT" + + def steps_TC_OCC_3_1(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH and obtain DUT attribute list.", is_commissioning=True), + TestStep(2, "Change DUT HoldTime attribute value to 10 seconds."), + TestStep(3, "Do not trigger DUT occupancy sensing for the period of HoldTime. TH reads Occupancy attribute from DUT."), + TestStep(4, "Trigger DUT occupancy sensing to change the occupancy state and start a timer."), + TestStep(5, "After 10 seconds, TH reads Occupancy attribute from DUT.") + ] + return steps + + def pics_TC_OCC_3_1(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + @async_test_body + async def test_TC_OCC_3_1(self): + + endpoint = self.user_params.get("endpoint", 1) + node_id = self.matter_test_config.dut_node_ids[0] + hold_time = 10 # 10 seconds for occupancy state hold time + + self.step(1) # commissioning and getting cluster attribute list + attributes = Clusters.OccupancySensing.Attributes + attribute_list = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList) + + self.step(2) + if attributes.HoldTime.attribute_id in attribute_list: + # write 10 as a HoldTime attibute + write_res = await ChipDeviceCtrl.WriteAttribute(node_id, [(endpoint, attributes.HoldTime(hold_time))]) + asserts.assert_equal(write_res[0].status, Status.Success, "Write HoldTime failed") + + else: + logging.info("No HoldTime attribute supports. Will test only occupancy attribute triggering functionality") + + self.step(3) + # check if Occupancy attribute is 0 + occupancy_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.Occupancy) + + # if occupancy is on, then wait until the sensor occupancy state is 0. + if occupancy_dut == 1: + # Don't trigger occupancy sensor to render occupancy attribute to 0 + if attributes.HoldTime.attribute_id in attribute_list: + time.sleep(hold_time + 2) # add some extra 2 seconds to ensure hold time has passed. + else: # a user wait until a sensor specific time to change occupancy attribute to 0. This is the case where the sensor doesn't support HoldTime. + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is detection ready state (occupancy attribute = 0)") + + # check sensor occupancy state is 0 for the next test step + occupancy_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 0, "Occupancy attribute is still 1.") + + self.step(4) + # Trigger occupancy sensor to change Occupancy attribute value to 1 => TESTER ACTION on DUT + self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after a sensor occupancy is triggered.") + + # And then check if Occupancy attribute has changed. + occupancy_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 1, "Occupancy state is not changed to 1") + + self.step(5) + # check if Occupancy attribute is back to 0 after HoldTime attribute period + # Tester should not be triggering the sensor for this test step. + if attributes.HoldTime.attribute_id in attribute_list: + + # Start a timer based on HoldTime + time.sleep(hold_time+2) # add some extra 2 seconds to ensure hold time has passed. + + occupancy_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.Occupancy) + asserts.assert_equal(occupancy_dut, 0, "Occupancy state is not 0 after HoldTime period") + + else: + logging.info("HoldTime attribute not supported. Skip this return to 0 timing test procedure.") + self.skip_step(5) + + +if __name__ == "__main__": + default_matter_test_main() diff --git a/src/python_testing/TC_OCC_3_2.py b/src/python_testing/TC_OCC_3_2.py new file mode 100644 index 00000000000000..3624f1044c40e8 --- /dev/null +++ b/src/python_testing/TC_OCC_3_2.py @@ -0,0 +1,248 @@ +# +# Copyright (c) 2024 Project CHIP (Matter) 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. +# +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${TYPE_OF_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# === END CI TEST ARGUMENTS === +# TODO: There are CI issues to be followed up for the test cases below that implements manually controlling sensor device for +# the occupancy state ON/OFF change. +# [TC-OCC-3.1] test procedure step 4 +# [TC-OCC-3.2] test precedure step 3a, 3c + +import logging +import queue +import time +from typing import Any + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.clusters.Attribute import TypedAttributePath +from matter_testing_support import (AttributeValue, ClusterAttributeChangeAccumulator, MatterBaseTest, TestStep, async_test_body, + default_matter_test_main) +from mobly import asserts + + +class TC_OCC_3_2(MatterBaseTest): + async def read_occ_attribute_expect_success(self, endpoint, attribute): + cluster = Clusters.Objects.OccupancySensing + return await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attribute) + + def _await_sequence_of_reports(self, report_queue: queue.Queue, endpoint_id: int, attribute: TypedAttributePath, sequence: list[Any], timeout_sec: float): + start_time = time.time() + elapsed = 0.0 + time_remaining = timeout_sec + + sequence_idx = 0 + actual_values = [] + + while time_remaining > 0: + expected_value = sequence[sequence_idx] + logging.info(f"Expecting value {expected_value} for attribute {attribute} on endpoint {endpoint_id}") + try: + item: AttributeValue = report_queue.get(block=True, timeout=time_remaining) + + # Track arrival of all values for the given attribute. + if item.endpoint_id == endpoint_id and item.attribute == attribute: + actual_values.append(item.value) + + if item.value == expected_value: + logging.info(f"Got expected attribute change {sequence_idx+1}/{len(sequence)} for attribute {attribute}") + sequence_idx += 1 + else: + asserts.assert_equal(item.value, expected_value, + msg="Did not get expected attribute value in correct sequence.") + + # We are done waiting when we have accumulated all results. + if sequence_idx == len(sequence): + logging.info("Got all attribute changes, done waiting.") + return + except queue.Empty: + # No error, we update timeouts and keep going + pass + + elapsed = time.time() - start_time + time_remaining = timeout_sec - elapsed + + asserts.fail(f"Did not get full sequence {sequence} in {timeout_sec:.1f} seconds. Got {actual_values} before time-out.") + + def desc_TC_OCC_3_2(self) -> str: + return "[TC-OCC-3.2] Subscription Report Verification with server as DUT" + + def steps_TC_OCC_3_2(self) -> list[TestStep]: + steps = [ + TestStep(1, "Commission DUT to TH if not already done", is_commissioning=True), + TestStep(2, "TH establishes a wildcard subscription to all attributes on Occupancy Sensing Cluster on the endpoint under test. Subscription min interval = 0 and max interval = 30 seconds."), + TestStep("3a", "Do not trigger DUT for occupancy state change."), + TestStep("3b", "TH reads DUT Occupancy attribute and saves the initial value as initial"), + TestStep("3c", "Trigger DUT to change the occupancy state."), + TestStep("3d", "TH awaits a ReportDataMessage containing an attribute report for DUT Occupancy attribute."), + TestStep("4a", "Check if DUT supports HoldTime attribute, If not supported, then stop and skip the rest of test cases."), + TestStep("4b", "TH reads DUT HoldTime attribute and saves the initial value as initial"), + TestStep("4c", "TH writes a different value to DUT HoldTime attribute."), + TestStep("4d", "TH awaits a ReportDataMessage containing an attribute report for DUT HoldTime attribute."), + TestStep("5a", "Check if DUT supports DUT feature flag PIR or OTHER, If not supported, then stop and skip to 6a."), + TestStep("5b", "TH reads DUT PIROccupiedToUnoccupiedDelay attribute and saves the initial value as initial"), + TestStep("5c", "TH writes a different value to DUT PIROccupiedToUnoccupiedDelay attribute."), + TestStep("5d", "TH awaits a ReportDataMessage containing an attribute report for DUT PIROccupiedToUnoccupiedDelay attribute."), + TestStep("6a", "Check if DUT supports DUT feature flag US, If not supported, then stop and skip to 7a."), + TestStep("6b", "TH reads DUT UltrasonicOccupiedToUnoccupiedDelay attribute and saves the initial value as initial"), + TestStep("6c", "TH writes a different value to DUT UltrasonicOccupiedToUnoccupiedDelay attribute."), + TestStep("6d", "TH awaits a ReportDataMessage containing an attribute report for DUT UltrasonicOccupiedToUnoccupiedDelay attribute."), + TestStep("7a", "Check if DUT supports DUT feature flag PHY, If not supported, terminate this test case."), + TestStep("7b", "TH reads DUT PhysicalContactOccupiedToUnoccupiedDelay attribute and saves the initial value as initial"), + TestStep("7c", "TH writes a different value to DUT PhysicalContactOccupiedToUnoccupiedDelay attribute."), + TestStep("7d", "TH awaits a ReportDataMessage containing an attribute report for DUT PhysicalContactOccupiedToUnoccupiedDelay attribute.") + ] + return steps + + def pics_TC_OCC_3_2(self) -> list[str]: + pics = [ + "OCC.S", + ] + return pics + + @async_test_body + async def test_TC_OCC_3_2(self): + + endpoint = self.user_params.get("endpoint", 1) + endpoint_id = self.matter_test_config.endpoint + node_id = self.matter_test_config.dut_node_ids[0] + post_prompt_settle_delay_seconds = 10.0 + cluster = Clusters.Objects.OccupancySensing + attributes = Clusters.OccupancySensing.Attributes + occupancy_sensor_type_bitmap_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.OccupancySensorTypeBitmap) + + self.step(1) + attribute_list = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.AttributeList) + + self.step(2) + # min interval = 0, and max interval = 30 seconds + attrib_listener = ClusterAttributeChangeAccumulator(Clusters.Objects.OccupancySensing) + await attrib_listener.start(ChipDeviceCtrl, node_id, endpoint=endpoint_id) + + # TODO - Will add Namepiped to assimilate the manual sensor untrigger here + self.step("3a") + self.wait_for_user_input(prompt_msg="Type any letter and press ENTER after DUT goes back to unoccupied state.") + + self.step("3b") + if attributes.Occupancy.attribute_id in attribute_list: + initial_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.Occupancy) + asserts.assert_equal(initial_dut, 0, "Occupancy attribute is still detected state") + + # TODO - Will add Namepiped to assimilate the manual sensor trigger here + self.step("3c") + self.wait_for_user_input( + prompt_msg="Type any letter and press ENTER after the sensor occupancy is triggered and its occupancy state changed.") + + self.step("3d") + self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.Occupancy, sequence=[ + 0, 1], timeout_sec=post_prompt_settle_delay_seconds) + + self.step("4a") + if attributes.HoldTime.attribute_id not in attribute_list: + logging.info("No HoldTime attribute supports. Terminate this test case") + self.skip_all_remaining_steps("4b") + + self.step("4b") + initial_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.HoldTime) + + self.step("4c") + # write a different a HoldTime attibute + diff_val = 12 + await ChipDeviceCtrl.WriteAttribute(node_id, [(endpoint, attributes.HoldTime(diff_val))]) + + self.step("4d") + self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.HoldTime, sequence=[ + initial_dut, diff_val], timeout_sec=post_prompt_settle_delay_seconds) + + self.step("5a") + if (occupancy_sensor_type_bitmap_dut & Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kPir) == 0: + logging.info("No PIR timing attribute supports. Skip this test cases, 5b, 5c, 5d") + self.skip_step("5b") + self.skip_test("5c") + self.skip_step("5d") + else: + self.step("5b") + if attributes.PIROccupiedToUnoccupiedDelay.attribute_id in attribute_list: + initial_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.PIROccupiedToUnoccupiedDelay) + + else: + logging.info("No PIROccupiedToUnoccupiedDelay attribute supports. Terminate this test case") + + self.step("5c") + # write the new attribute value + diff_val = 11 + await ChipDeviceCtrl.WriteAttribute(node_id, [(endpoint, attributes.PIROccupiedToUnoccupiedDelay(diff_val))]) + + self.step("5d") + self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.PIROccupiedToUnoccupiedDelay, sequence=[ + initial_dut, diff_val], timeout_sec=post_prompt_settle_delay_seconds) + + self.step("6a") + if (occupancy_sensor_type_bitmap_dut & Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kUltrasonic) == 0: + logging.info("No Ultrasonic timing attribute supports. Skip this test cases, 6b, 6c, 6d") + self.skip_step("6b") + self.skip_test("6c") + self.skip_step("6d") + else: + self.step("6b") + if attributes.UltrasonicOccupiedToUnoccupiedDelay.attribute_id in attribute_list: + initial_dut = await self.read_occ_attribute_expect_success(endpoint=endpoint, attribute=attributes.UltrasonicOccupiedToUnoccupiedDelay) + + else: + logging.info("No UltrasonicOccupiedToUnoccupiedDelay attribute supports. Skip this test case") + + self.step("6c") + # write the new attribute value + diff_val = 14 + await ChipDeviceCtrl.WriteAttribute(node_id, [(endpoint, attributes.UltrasonicOccupiedToUnoccupiedDelay(diff_val))]) + + self.step("6d") + self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.UltrasonicOccupiedToUnoccupiedDelay, sequence=[ + initial_dut, diff_val], timeout_sec=post_prompt_settle_delay_seconds) + + self.step("7a") + if (occupancy_sensor_type_bitmap_dut & Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum.kPhysicalContact) == 0: + logging.info("No Physical contact timing attribute supports. Skip this test case") + self.skip_all_remaining_steps("7b") + + self.step("7b") + if attributes.PhysicalContactOccupiedToUnoccupiedDelay.attribute_id in attribute_list: + initial_dut = await self.t_success(endpoint=endpoint, attribute=attributes.PhysicalContactOccupiedToUnoccupiedDelay) + + else: + logging.info("No PhysicalContactOccupiedToUnoccupiedDelay attribute supports. Skip this test case") + + self.step("7c") + # write the new attribute value + diff_val = 9 + await ChipDeviceCtrl.WriteAttribute(node_id, [(endpoint, attributes.PhysicalContactOccupiedToUnoccupiedDelay(diff_val))]) + + self.step("7d") + self._await_sequence_of_reports(report_queue=attrib_listener.attribute_queue, endpoint_id=endpoint_id, attribute=cluster.Attributes.PhysicalContactOccupiedToUnoccupiedDelay, sequence=[ + initial_dut, diff_val], timeout_sec=post_prompt_settle_delay_seconds) + + +if __name__ == "__main__": + default_matter_test_main() From d139a42933eeddbe5459d059a97968b247533172 Mon Sep 17 00:00:00 2001 From: mkardous-silabs <84793247+mkardous-silabs@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:58:33 -0400 Subject: [PATCH 33/40] Update ICDM 2.1 Test Script (#34714) --- src/python_testing/TC_ICDM_2_1.py | 16 ++- .../test_testing/test_TC_ICDM_2_1.py | 99 +++++++++++-------- 2 files changed, 72 insertions(+), 43 deletions(-) diff --git a/src/python_testing/TC_ICDM_2_1.py b/src/python_testing/TC_ICDM_2_1.py index ac20cf2c001fb0..63b27c64d6d8fa 100644 --- a/src/python_testing/TC_ICDM_2_1.py +++ b/src/python_testing/TC_ICDM_2_1.py @@ -109,6 +109,7 @@ def steps_TC_ICDM_2_1(self) -> list[TestStep]: TestStep( 9, "TH reads from the DUT the UserActiveModeTriggerInstruction attribute"), TestStep(10, "TH reads from the DUT the OperatingMode attribute."), + TestStep(11, "TH reads from the DUT the MaximumCheckInBackoff attribute."), ] return steps @@ -254,8 +255,9 @@ async def test_TC_ICDM_2_1(self): "UserActiveModeTriggerInstruction is not in the correct format for the associated UserActiveModeTriggerHint") if uatHintInstructionDepedentBitmap > 0 and uatHintInstructionDepedentBitmap in kUatColorInstructionBitMask: - # TODO: https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/9194 - asserts.assert_true(False, "Nothing to do for now") + pattern = re.compile(r'^[0-9A-F]{6}$') + asserts.assert_true(pattern.match(userActiveModeTriggerInstruction), + "UserActiveModeTriggerInstruction is not in the correct format for the associated UserActiveModeTriggerHint") else: # Check if the UserActiveModeTriggerInstruction was required asserts.assert_false(uatHintInstructionDepedentBitmap in kUatInstructionMandatoryBitMask, @@ -272,6 +274,16 @@ async def test_TC_ICDM_2_1(self): asserts.assert_less( operatingMode, modes.kUnknownEnumValue, "OperatingMode can only have 0 and 1 as valid values") + self.step(11) + if self.pics_guard(self.check_pics("ICDM.S.A0009")): + maximumCheckInBackOff = await self._read_icdm_attribute_expect_success(attributes.MaximumCheckInBackOff) + + asserts.assert_true(self.is_valid_uint32_value(maximumCheckInBackOff), + "MaximumCheckInBackOff attribute is not a valid uint32.") + asserts.assert_greater_equal(maximumCheckInBackOff, idleModeDuration, + "MaximumCheckInBack attribute is not greater or euqal to the IdleModeDuration") + asserts.assert_less_equal(maximumCheckInBackOff, 64800, + "MaximumCheckInBackOff attribute is greater than maximum value (64800).") if __name__ == "__main__": diff --git a/src/python_testing/test_testing/test_TC_ICDM_2_1.py b/src/python_testing/test_testing/test_TC_ICDM_2_1.py index 5069eb6ed9d0a7..a337b91ccef41d 100755 --- a/src/python_testing/test_testing/test_TC_ICDM_2_1.py +++ b/src/python_testing/test_testing/test_TC_ICDM_2_1.py @@ -41,6 +41,7 @@ class ICDMData(): UserActiveModeTriggerHint: int UserActiveModeTriggerInstruction: string OperatingMode: c.Enums.OperatingModeEnum + MaximumCheckInBackOff: int expect_pass: bool @@ -57,145 +58,161 @@ class ICDMData(): # -------- # IdleModeDuration under minimum (< 1) ICDMData(0, 0, 0, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, False), + c.Enums.OperatingModeEnum.kSit, 64800, False), # IdleModeDuration at minimum ICDMData(0, 1, 0, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, True), + c.Enums.OperatingModeEnum.kSit, 64800, True), # IdleModeDuration at maximum ICDMData(0, 64800, 100, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, True), + c.Enums.OperatingModeEnum.kSit, 64800, True), # IdleModeDuration over maximum (>64800) ICDMData(0, 64801, 100, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, False), + c.Enums.OperatingModeEnum.kSit, 64800, False), # IdleModeDuration < ActiveModeDuration ICDMData(0, 1, 1001, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, False), + c.Enums.OperatingModeEnum.kSit, 64800, False), # -------- # Test cases to validate ActiveModeDuration # -------- # ActiveModeDuration under minimum ICDMData(0, 100, -1, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, False), + c.Enums.OperatingModeEnum.kSit, 64800, False), # ActiveModeDuration at minimum ICDMData(0, 100, 0, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, True), + c.Enums.OperatingModeEnum.kSit, 64800, True), # ActiveModeDuration at maximum - value is max IdleModeDuration value - 1 ICDMData(0, 64800, 0x3DCC4FF, 100, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, True), + c.Enums.OperatingModeEnum.kSit, 64800, True), # -------- # Test cases to validate ActiveModeThreshold # -------- # ActiveModeThreshold < minimum ICDMData(0, 1, 0, -1, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, False), + c.Enums.OperatingModeEnum.kSit, 64800, False), # ActiveModeThreshold at SIT minimum ICDMData(0, 1, 0, 0, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, True), + c.Enums.OperatingModeEnum.kSit, 64800, True), # ActiveModeThreshold under LIT minimum ICDMData(0x7, 1, 0, 4999, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # ActiveModeThreshold at LIT minimum ICDMData(0x7, 1, 0, 5000, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # ActiveModeThreshold at Maximum ICDMData(0, 1, 0, 0xFFFF, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, True), + c.Enums.OperatingModeEnum.kSit, 64800, True), # ActiveModeThreshold over Maximum ICDMData(0, 1, 0, 0x10000, [], 0, 2, 0, "", - c.Enums.OperatingModeEnum.kSit, False), + c.Enums.OperatingModeEnum.kSit, 64800, False), # -------- # Test cases to validate ClientsSupportedPerFabric # -------- # ClientsSupportedPerFabric under minimum (< 1) ICDMData(0, 1, 0, 100, [], 0, 0, 0, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # ClientsSupportedPerFabric at minimum ICDMData(0, 1, 0, 100, [], 0, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # ClientsSupportedPerFabric at maximum ICDMData(0, 1, 0, 100, [], 0, 255, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # ClientsSupportedPerFabric > maximum ICDMData(0, 1, 0, 100, [], 0, 256, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # -------- # Test cases to validate RegisteredClients # -------- # Incorrect type ICDMData(0, 1, 0, 100, 0, 0, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # Correct type ICDMData(0, 1, 0, 100, [], 0, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # -------- # Test cases to validate ICDCounter # -------- # ICDCounter under minimum (< 0) ICDMData(0, 1, 0, 100, [], -1, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # ICDCounter at minimum ICDMData(0, 1, 0, 100, [], 0, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # ICDCounter at maximum ICDMData(0, 1, 0, 100, [], 0xFFFFFFFF, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # ICDCounter over maximum ICDMData(0, 1, 0, 100, [], 0x100000000, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # -------- # Test cases to validate UserActiveModeTriggerHint # -------- # UserActiveModeTriggerHint outsite valid range ICDMData(0, 1, 0, 100, [], 0, 1, 0x1FFFF, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # UserActiveModeTriggerHint outsite valid range ICDMData(0, 1, 0, 100, [], 0, 1, -1, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # UserActiveModeTriggerHint with no hints ICDMData(0, 1, 0, 100, [], 0, 1, 0, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # UserActiveModeTriggerHint wiht two instruction depedent bits set ICDMData(0, 1, 0, 100, [], 0, 1, uat.kCustomInstruction | uat.kActuateSensorSeconds, "", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # -------- # Test cases to validate UserActiveModeTriggerInstruction # -------- # UserActiveModeTriggerInstruction with wrong encoding ICDMData(0, 1, 0, 100, [], 0, 1, uat.kCustomInstruction, "Hello\uD83D\uDE00World", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # UserActiveModeTriggerInstruction with empty string ICDMData(0, 1, 0, 100, [], 0, 1, uat.kCustomInstruction, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # UserActiveModeTriggerInstruction with empty string ICDMData(0, 1, 0, 100, [], 0, 1, uat.kCustomInstruction, "", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # UserActiveModeTriggerInstruction with max string length ICDMData(0, 1, 0, 100, [], 0, 1, uat.kCustomInstruction, long_string, - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # UserActiveModeTriggerInstruction > max string length ICDMData(0, 1, 0, 100, [], 0, 1, uat.kCustomInstruction, too_long_string, - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # UserActiveModeTriggerInstruction invalid number - Trailing 0s ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "001", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # UserActiveModeTriggerInstruction invalid number - Letters ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "not a number", - c.Enums.OperatingModeEnum.kLit, False), + c.Enums.OperatingModeEnum.kLit, 64800, False), # UserActiveModeTriggerInstruction Valid number ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorLightsBlink, "", c.Enums.OperatingModeEnum.kLit, 64800, False), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorLightsBlink, "AAAAAAA", c.Enums.OperatingModeEnum.kLit, 64800, False), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorLightsBlink, "AAAAA", c.Enums.OperatingModeEnum.kLit, 64800, False), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorLightsBlink, "AAAAAK", c.Enums.OperatingModeEnum.kLit, 64800, False), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorLightsBlink, "012345", c.Enums.OperatingModeEnum.kLit, 64800, True), # -------- # Test cases to validate OpertingMode # -------- # OpertingMode with negative value ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", - -1, False), + -1, 64800, False), # OpertingMode with Accepted value ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", - c.Enums.OperatingModeEnum.kLit, True), + c.Enums.OperatingModeEnum.kLit, 64800, True), # OpertingMode with unkown value ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", - c.Enums.OperatingModeEnum.kUnknownEnumValue, False), + c.Enums.OperatingModeEnum.kUnknownEnumValue, 64800, False), + # -------- + # Test cases to validate MaximumCheckInBackOff + # -------- + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", + c.Enums.OperatingModeEnum.kUnknownEnumValue, 0, False), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", + c.Enums.OperatingModeEnum.kSit, 1, True), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", + c.Enums.OperatingModeEnum.kSit, 64800, True), + ICDMData(0, 1, 0, 100, [], 0, 1, uat.kActuateSensorSeconds, "100000", + c.Enums.OperatingModeEnum.kSit, 64801, False), ] @@ -205,13 +222,13 @@ def test_spec_to_attribute_cache(test_icdm: ICDMData) -> Attribute.AsyncReadTran resp.attributes = {0: {c: {attr.FeatureMap: test_icdm.FeatureMap, attr.IdleModeDuration: test_icdm.IdleModeDuration, attr.ActiveModeDuration: test_icdm.ActiveModeDuration, attr.ActiveModeThreshold: test_icdm.ActiveModeThreshold, attr.RegisteredClients: test_icdm.RegisteredClients, attr.ICDCounter: test_icdm.ICDCounter, attr.ClientsSupportedPerFabric: test_icdm.ClientsSupportedPerFabric, attr.UserActiveModeTriggerHint: test_icdm.UserActiveModeTriggerHint, - attr.UserActiveModeTriggerInstruction: test_icdm.UserActiveModeTriggerInstruction, attr.OperatingMode: test_icdm.OperatingMode}}} + attr.UserActiveModeTriggerInstruction: test_icdm.UserActiveModeTriggerInstruction, attr.OperatingMode: test_icdm.OperatingMode, attr.MaximumCheckInBackOff: test_icdm.MaximumCheckInBackOff}}} return resp def main(): pics = {"ICDM.S.A0000": True, "ICDM.S.A0001": True, "ICDM.S.A0002": True, "ICDM.S.A0003": True, "ICDM.S.A0004": True, - "ICDM.S.A0005": True, "ICDM.S.A0006": True, "ICDM.S.A0007": True, "ICDM.S.A0008": True, } + "ICDM.S.A0005": True, "ICDM.S.A0006": True, "ICDM.S.A0007": True, "ICDM.S.A0008": True, "ICDM.S.A0009": True, } test_runner = MockTestRunner( 'TC_ICDM_2_1', 'TC_ICDM_2_1', 'test_TC_ICDM_2_1', 0, pics) From 65c388aa6a118cca4217dd8d59ab535ae4c101a0 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Aug 2024 13:03:11 -0400 Subject: [PATCH 34/40] Disable the tizen qemu job (#34737) Co-authored-by: Andrei Litvin --- .github/workflows/qemu.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 6dff2dadc3d533..be2320f975beae 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -75,7 +75,12 @@ jobs: name: Tizen runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + # NOTE: job temporarely disabled as it seems flaky. The flake does not result in usable + # logs so the current theory is that we run out of space. This is unusual as + # larger docker images succeed at bootstrap, however it needs more investigation + # to detect an exact/real root cause. + if: false + # if: github.actor != 'restyled-io[bot]' container: image: ghcr.io/project-chip/chip-build-tizen-qemu:54 From 75fcadbe58acfb15174c49db2a5d28538a46a1f4 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Fri, 2 Aug 2024 10:04:42 -0700 Subject: [PATCH 35/40] Created automated test TC_ADMIN_1_9: (#34342) * Created automated test TC_ADMIN_1_9: - Follows test steps in test plan PR #https://github.com/CHIP-Specifications/chip-test-plans/pull/4267: -- TH1 able to open commissioning window on DUT -- TH2 Fails to connect to endpoint for 20 iterations with correct payload but incorrect passcode -- TH2 Fails to connect to endpoint due to commissioning window being closed after the 20th failed attempt -- TH1 able to open commissioning window on the endpoint again -- TH1 able to revoke commissioning window on the endpoint * Restyled by autopep8 * Updated TC_CADMIN_1_9 test: - Replaced method to get incorrect pincode with using correct pincode in test step 4. * Update src/python_testing/TC_CADMIN_1_9.py Changing test async function to correct name, thank you Cecille! Co-authored-by: C Freeman * Update src/python_testing/TC_CADMIN_1_9.py Co-authored-by: C Freeman * Update src/python_testing/TC_CADMIN_1_9.py Co-authored-by: C Freeman * Updated tests.yaml and TC_CADMIN_1_9.py: - Added test module TC_CADMIN_1_9 into tests.yaml script - Created new steps method to contain test steps, then call those in variables in main test code area. - Inserted comment for why sleep time duration is needed between test steps 3 and 4, moved sleep time duration into main test code area - Added setting variable for duration of commissioning window using maxCumulativeFailsafeSeconds * Restyled by autopep8 * Updated TC_CADMIN_1_9 test module: - added CI argument blocks to attempt to get test to run in CI * Updated TC_CADMIN_1_9: - Changed method for setting setupPinCode as in CI/CD pipeline it was failing previously. * Restyled by autopep8 * Updated TC_CADMIN_1_9: - Changed factory reset to false to attempt running in CI/CD pipeline * Updated TC_CADMIN_1_9: - Changed factory reset back to true as commissioning failed in CI/CD pipeline without it being set to true * Updated TC_CADMIN_1_9: - Removed PICS call in CI/CD as not needed - Turned off quiet mode when running test in CI/CD pipeline to help flush out current issue * Updated TC_CADMIN_1_9: - Added back removing PICS from script args for running CI/CD pipeline to see if this gets pipeline working again. * Updated TC_CADMIN_1_9: - Added an additional await to see if we can get test to pass in CI/CD pipeline * Updated TC_CADMIN_1_9: - Changed method in which CommissionOnNetwork was being established, needed to run through asserts module. - Added await async method for opening commissioning window. * Updated TC_CADMIN_1_9: - Turned quiet mode back on for CI/CD pipeline for this test as test is now passing. --------- Co-authored-by: Restyled.io Co-authored-by: C Freeman --- .github/workflows/tests.yaml | 1 + src/python_testing/TC_CADMIN_1_9.py | 139 ++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 src/python_testing/TC_CADMIN_1_9.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c19eccb9a30457..adf04727976032 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -511,6 +511,7 @@ jobs: scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_AccessChecker.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CC_2_2.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CC_10_1.py' + scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CADMIN_1_9.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CGEN_2_4.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_CNET_1_4.py' scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_DA_1_2.py' diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py new file mode 100644 index 00000000000000..f37e3723ed1055 --- /dev/null +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -0,0 +1,139 @@ +# +# 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. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: ${ALL_CLUSTERS_APP} +# test-runner-run/run1/factoryreset: True +# test-runner-run/run1/quiet: True +# test-runner-run/run1/app-args: --discriminator 1234 --KVS kvs1 --trace-to json:${TRACE_APP}.json +# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto --PICS src/app/tests/suites/certification/ci-pics-values +# === END CI TEST ARGUMENTS === + +import logging +import random +from time import sleep + +import chip.clusters as Clusters +from chip import ChipDeviceCtrl +from chip.ChipDeviceCtrl import CommissioningParameters +from chip.exceptions import ChipStackError +from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main +from mobly import asserts + + +class TC_CADMIN_1_9(MatterBaseTest): + async def OpenCommissioningWindow(self) -> CommissioningParameters: + try: + cluster = Clusters.GeneralCommissioning + attribute = cluster.Attributes.BasicCommissioningInfo + duration = await self.read_single_attribute_check_success(endpoint=0, cluster=cluster, attribute=attribute) + params = await self.th1.OpenCommissioningWindow( + nodeid=self.dut_node_id, timeout=duration.maxCumulativeFailsafeSeconds, iteration=10000, discriminator=self.discriminator, option=1) + return params + + except Exception as e: + logging.exception('Error running OpenCommissioningWindow %s', e) + asserts.assert_true(False, 'Failed to open commissioning window') + + def steps_TC_CADMIN_1_9(self) -> list[TestStep]: + return [ + TestStep(1, "Commissioning, already done", is_commissioning=True), + TestStep( + 2, "TH1 opens commissioning window on DUT with duration set to value for maxCumulativeFailsafeSeconds"), + TestStep(3, "TH2 attempts to connect 20 times to endpoint with incorrect passcode"), + TestStep(4, "TH2 attempts to connect to endpoint with correct passcode"), + TestStep(5, "TH1 opening Commissioning Window one more time to validate ability to do so"), + TestStep(6, "TH1 revoking Commissioning Window"), + ] + + def generate_unique_random_value(self, value): + while True: + random_value = random.randint(10000000, 99999999) + if random_value != value: + return random_value + + async def CommissionOnNetwork( + self, setup_code: int + ): + ctx = asserts.assert_raises(ChipStackError) + with ctx: + await self.th2.CommissionOnNetwork( + nodeId=self.dut_node_id, setupPinCode=setup_code, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=self.discriminator) + errcode = ctx.exception.chip_error + return errcode + + async def CommissionAttempt( + self, setupPinCode: int, expectedErrCode: int): + + if expectedErrCode == 3: + for cycle in range(20): + logging.info("-----------------Current Iteration {}-------------------------".format(cycle+1)) + setup_code = self.generate_unique_random_value(setupPinCode) + errcode = await self.CommissionOnNetwork(setup_code) + logging.info('Commissioning complete done. Successful? {}, errorcode = {}, cycle={}'.format( + errcode.is_success, errcode, (cycle+1))) + asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') + asserts.assert_true(errcode.sdk_code == expectedErrCode, + 'Unexpected error code returned from CommissioningComplete') + + elif expectedErrCode == 50: + logging.info("-----------------Attempting connection expecting timeout-------------------------") + errcode = await self.CommissionOnNetwork(setupPinCode) + logging.info('Commissioning complete done. Successful? {}, errorcode = {}'.format(errcode.is_success, errcode)) + asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') + asserts.assert_true(errcode.sdk_code == expectedErrCode, 'Unexpected error code returned from CommissioningComplete') + + def pics_TC_CADMIN_1_9(self) -> list[str]: + return ["CADMIN.S"] + + @async_test_body + async def test_TC_CADMIN_1_9(self): + self.step(1) + + # Establishing TH1 and TH2 + self.th1 = self.default_controller + self.discriminator = random.randint(0, 4095) + th2_certificate_authority = self.certificate_authority_manager.NewCertificateAuthority() + th2_fabric_admin = th2_certificate_authority.NewFabricAdmin(vendorId=0xFFF1, fabricId=self.th1.fabricId + 1) + self.th2 = th2_fabric_admin.NewController(nodeId=2, useTestCommissioner=True) + + self.step(2) + params = await self.OpenCommissioningWindow() + setupPinCode = params.setupPinCode + + self.step(3) + await self.CommissionAttempt(setupPinCode, expectedErrCode=0x03) + # TODO: Found if we don't add sleep time after test completes that we get unexpected error code and response after the 21st iteration. + # Link to Bug Filed: https://github.com/project-chip/connectedhomeip/issues/34383 + sleep(1) + + self.step(4) + await self.CommissionAttempt(setupPinCode, expectedErrCode=0x32) + + self.step(5) + params = await self.OpenCommissioningWindow() + + self.step(6) + revokeCmd = Clusters.AdministratorCommissioning.Commands.RevokeCommissioning() + await self.th1.SendCommand(nodeid=self.dut_node_id, endpoint=0, payload=revokeCmd, timedRequestTimeoutMs=6000) + # The failsafe cleanup is scheduled after the command completes, so give it a bit of time to do that + sleep(1) + + +if __name__ == "__main__": + default_matter_test_main() From 2bd9d0b551852c089e2697d1c9e4a06ad80cdb0d Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Fri, 2 Aug 2024 22:58:05 +0530 Subject: [PATCH 36/40] [ESP32] Fix few typos in all-clusters-app m5stack sdkconfigs (#34729) --- examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults | 4 ++-- .../all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults index 8c30112f96d500..03691548ea91db 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack.defaults @@ -74,8 +74,8 @@ CONFIG_BUILD_CHIP_TESTS=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y -# Reduce the event loggin buffer to reduce the DRAM usage -# TODO: remove this once the underlying issue is fixed +# Reduce the event logging buffer to reduce the DRAM usage +# TODO: [ESP32] Fix the DRAM overflow in esp32 apps #34717 CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE=512 CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE=512 CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE=512 diff --git a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults index f7aba926a4df67..0a426dffd0066e 100644 --- a/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig_m5stack_rpc.defaults @@ -86,8 +86,8 @@ CONFIG_BTDM_CTRL_BLE_MAX_CONN=1 CONFIG_BT_NIMBLE_ROLE_CENTRAL=n CONFIG_BT_NIMBLE_ROLE_OBSERVER=n -# Reduce the event loggin buffer to reduce the DRAM overflow -# TODO: remove this once the underlying issue is fixed +# Reduce the event logging buffer to reduce the DRAM overflow +# TODO: [ESP32] Fix the DRAM overflow in esp32 apps #34717 CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE=512 CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE=512 CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE=512 From c124b812f48620a82f23bbdf7a39088f5f4c206c Mon Sep 17 00:00:00 2001 From: William Date: Fri, 2 Aug 2024 18:58:54 +0100 Subject: [PATCH 37/40] Update global data types to use the new XML representation (#34680) * Updated the golabl data type's XMLs, removing the cluster entries. * Zap generated after XML update. * Fixed namespaces used of global structs. * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../air-purifier-app.matter | 202 ++++++ .../air-quality-sensor-app.matter | 202 ++++++ .../all-clusters-app.matter | 202 ++++++ .../all-clusters-minimal-app.matter | 202 ++++++ .../bridge-common/bridge-app.matter | 202 ++++++ ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 202 ++++++ .../rootnode_airpurifier_73a6fe2651.matter | 202 ++++++ ...umiditysensor_thermostat_56de3d5f45.matter | 202 ++++++ ...ootnode_airqualitysensor_e63187f6c9.matter | 202 ++++++ ...ootnode_basicvideoplayer_0ff86e943b.matter | 202 ++++++ ...de_colortemperaturelight_hbUnzYVeyn.matter | 202 ++++++ .../rootnode_contactsensor_27f76aeaf5.matter | 202 ++++++ .../rootnode_contactsensor_lFAGG1bfRO.matter | 202 ++++++ .../rootnode_dimmablelight_bCwGYSDpoe.matter | 202 ++++++ ...tnode_dimmablepluginunit_f8a9a0b9d4.matter | 202 ++++++ .../rootnode_dishwasher_cc105034fe.matter | 202 ++++++ .../rootnode_doorlock_aNKYAreMXE.matter | 202 ++++++ ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 202 ++++++ .../devices/rootnode_fan_7N2TobIlOX.matter | 202 ++++++ .../rootnode_flowsensor_1zVxHedlaV.matter | 202 ++++++ .../rootnode_genericswitch_2dfff6e516.matter | 202 ++++++ .../rootnode_genericswitch_9866e35d0b.matter | 202 ++++++ ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 202 ++++++ .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 202 ++++++ .../rootnode_laundrywasher_fb10d238c8.matter | 202 ++++++ .../rootnode_lightsensor_lZQycTFcJK.matter | 202 ++++++ ...rootnode_occupancysensor_iHyVgifZuo.matter | 202 ++++++ .../rootnode_onofflight_bbs1b7IaOV.matter | 202 ++++++ .../rootnode_onofflight_samplemei.matter | 202 ++++++ ...ootnode_onofflightswitch_FsPlMr090Q.matter | 202 ++++++ ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 202 ++++++ .../rootnode_pressuresensor_s0qC9wLH4k.matter | 202 ++++++ .../devices/rootnode_pump_5f904818cc.matter | 202 ++++++ .../devices/rootnode_pump_a811bb33a0.matter | 202 ++++++ ...eraturecontrolledcabinet_ffdb696680.matter | 202 ++++++ ...ode_roboticvacuumcleaner_1807ff0c49.matter | 202 ++++++ ...tnode_roomairconditioner_9cf3607804.matter | 202 ++++++ .../rootnode_smokecoalarm_686fe0dcb8.matter | 202 ++++++ .../rootnode_speaker_RpzeXdimqA.matter | 202 ++++++ ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 202 ++++++ .../rootnode_thermostat_bm3fb8dhYi.matter | 202 ++++++ .../rootnode_windowcovering_RLCxaGi9Yx.matter | 202 ++++++ .../contact-sensor-app.matter | 202 ++++++ .../nxp/zap-lit/contact-sensor-app.matter | 202 ++++++ .../nxp/zap-sit/contact-sensor-app.matter | 202 ++++++ .../dishwasher-common/dishwasher-app.matter | 202 ++++++ .../energy-management-app.matter | 202 ++++++ .../fabric-bridge-app.matter | 202 ++++++ .../nxp/zap/laundry-washer-app.matter | 202 ++++++ .../light-switch-app.matter | 202 ++++++ .../light-switch-app/qpg/zap/switch.matter | 202 ++++++ .../data_model/lighting-app-ethernet.matter | 202 ++++++ .../data_model/lighting-app-thread.matter | 202 ++++++ .../data_model/lighting-app-wifi.matter | 202 ++++++ .../lighting-common/lighting-app.matter | 202 ++++++ .../nxp/zap/lighting-on-off.matter | 202 ++++++ examples/lighting-app/qpg/zap/light.matter | 202 ++++++ .../data_model/lighting-thread-app.matter | 202 ++++++ .../data_model/lighting-wifi-app.matter | 202 ++++++ .../lit-icd-common/lit-icd-server-app.matter | 202 ++++++ examples/lock-app/lock-common/lock-app.matter | 202 ++++++ examples/lock-app/nxp/zap/lock-app.matter | 202 ++++++ examples/lock-app/qpg/zap/lock.matter | 202 ++++++ .../log-source-common/log-source-app.matter | 202 ++++++ .../microwave-oven-app.matter | 202 ++++++ .../network-manager-app.matter | 202 ++++++ .../ota-provider-app.matter | 202 ++++++ .../ota-requestor-app.matter | 202 ++++++ .../placeholder/linux/apps/app1/config.matter | 202 ++++++ .../placeholder/linux/apps/app2/config.matter | 202 ++++++ examples/pump-app/pump-common/pump-app.matter | 202 ++++++ .../silabs/data_model/pump-thread-app.matter | 202 ++++++ .../silabs/data_model/pump-wifi-app.matter | 202 ++++++ .../pump-controller-app.matter | 202 ++++++ .../refrigerator-app.matter | 202 ++++++ examples/rvc-app/rvc-common/rvc-app.matter | 404 ++++++------ .../src/rvc-service-area-delegate.cpp | 26 +- .../smoke-co-alarm-app.matter | 202 ++++++ .../temperature-measurement.matter | 202 ++++++ .../nxp/zap/thermostat_matter_thread.matter | 202 ++++++ .../nxp/zap/thermostat_matter_wifi.matter | 202 ++++++ .../qpg/zap/thermostaticRadiatorValve.matter | 202 ++++++ .../thermostat-common/thermostat.matter | 202 ++++++ examples/tv-app/tv-common/tv-app.matter | 202 ++++++ .../tv-casting-common/tv-casting-app.matter | 202 ++++++ .../virtual-device-app.matter | 202 ++++++ examples/window-app/common/window-app.matter | 202 ++++++ .../service-area-cluster-objects.h | 22 +- .../service-area-server.cpp | 16 +- .../service-area-server/service-area-server.h | 17 +- .../zcl/data-model/chip/global-structs.xml | 10 - .../chip/semantic-tag-namespace-enums.xml | 14 - .../data_model/controller-clusters.matter | 522 ++++++--------- .../chip/devicecontroller/ChipStructs.java | 486 +++++++------- .../python/chip/clusters/Objects.py | 622 +++++++----------- .../MTRAttributeTLVValueDecoder.mm | 4 +- .../CHIP/zap-generated/MTRBaseClusters.h | 490 ++++++-------- .../CHIP/zap-generated/MTRStructsObjc.h | 39 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 169 ++--- .../zap-generated/cluster-enums-check.h | 246 +++---- .../app-common/zap-generated/cluster-enums.h | 455 +++++++------ .../zap-generated/cluster-objects.cpp | 200 +++--- .../zap-generated/cluster-objects.h | 131 ++-- .../cluster/ComplexArgumentParser.cpp | 102 +-- .../cluster/ComplexArgumentParser.h | 12 +- .../cluster/logging/DataModelLogger.cpp | 68 +- .../cluster/logging/DataModelLogger.h | 8 +- 107 files changed, 19009 insertions(+), 2224 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 993ad36232572f..6afbc96ec4e430 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index 391b5450b00993..80a93e41155b95 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; 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 eb172fa54dcff9..2b4fb13c868d48 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 @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 7db7a1c97c61b0..1f56b0d6f7f746 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index c403ecd9d40ff6..62fa99efa49f6f 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 2557a01f257fff..c2fdc613ff9eee 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index 5cc3baccb0aa62..6b6d2a9133839e 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 9e1548b7dd36c5..4e21ce7185ece0 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 22282b4b3a8ffe..fb5fd600d280a5 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 4fb0ed83478012..e93e6a668dbd62 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 31241e3a4ab637..8da8f1d4472762 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 6e7ce6b18132ea..4a2f72084620e4 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 657ce0dd5fe520..23672407e7c886 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 9495bcd7e6b61e..a32b134d6383c0 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index e3a97805d6c5e8..64dd2192d29af0 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index ceaeeecc4a7ef2..95af5647dd9d27 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index d07df97b8f173a..219f899194ff5b 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 06cefc49a5ce84..d846e358a907f9 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 2eb6abd966f095..493b69632f19ec 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 5c4452aabd8986..3df145b311d69a 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 76d90d2ad12398..7f7fecc0fad4fc 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 5216ad0a5a3829..25c5cb83071c67 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index cbbedfa6080098..5bff3298a54008 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 05fd620ffd7518..3a533a80b03adc 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 7d10d932eefd39..85e0b196fdda71 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index c7334375df90b2..02be0be6f65ad5 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index c3e38b16d96ad4..40a115b86c3be8 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 17b66ebe5303ba..6906c4f30ebbae 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 9492a186a67c3e..e374d50abab6e9 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 03046a45af8ac8..4ece174e50db4c 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index a25ba3dafb35ac..a5e61ac7fe7406 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 4c45232b369f02..327132ea97cf51 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index ed9e7c58a90e11..6c7e8d6ad9f128 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index d11ba11cc816be..9fb13cb006fd90 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 026a69ae346280..5743a39e49847a 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index a116ea0892b644..dd9fe887bef6a4 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 7603eca8a44a52..c3ef68e5e97da5 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index eab95df39549b2..671339d987c1a0 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 52446c519d4ec5..148afd99364923 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 3bafec9ed48427..bcb7f16079e3e2 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index c2b1ed117c6ff3..43f4bc7dace6bd 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index b318c7b3ed80b7..4dfbfbc41b8d9f 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index e1c580c030bc5a..c25e9c9f5b8757 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index b48d6984bafd07..efad0754f083a8 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index 6c033b5dfbac0d..9afa33bd3ea3d8 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index 7c27d4cfb63185..cb9872e9e66045 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; 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 af5c74ef27da4a..e9b0971aff8299 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 @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index 19cd327c7394ea..db107fcf5bac43 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index f0bffe95080d01..fd62482a477bcc 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index ea78ebf1d2fa5b..3dbb78723e7e09 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 95d6ae8194cc56..3b4bce66e4e99d 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 55f7f290e1f474..95ec4192b1d0eb 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 1b12b77e99a9fb..aaf03062417f4e 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 91d870bf308d5a..c2e58783befefb 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 923357f63d2d12..9f1ed514fcd5ca 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index f3f3aa85fa80a7..4fb8cc0cb2effc 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index fbc6127e636ab5..9897f1b594cf81 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 246770a4b57bd2..2fcf8a6f8c714d 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 179a3832a5e732..0b6601b5fdb135 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index f8db39db377c91..a2f535b3a30a8f 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 143d3c67f19031..8a259619dce5a6 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index f44c1531169ae0..97d6e3ae443c38 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 18ef74944ebc63..4bc5c6657d6574 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 829e40f870c1a3..7633792300c4dd 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index bdfe6910c5cffd..10eec889dee3bd 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index f8600afd71dc8c..152f81961ba5f6 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 4385f8b6d252df..e030d276cf954c 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 4afe132a484702..4d46808ccc9756 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index d956aee9081628..0592ef4e90ff49 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index e892c7ebcf9e1e..807c80a0099157 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index d766b7d9c61ff1..d6a3bd98a27dcb 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index cbc0ea3c2d65fc..d933e5fed1bca3 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index cbc0ea3c2d65fc..d933e5fed1bca3 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index be131b84c3a933..b65fb7a3151a26 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index eea5506b1c60db..3b6ed201671901 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index 53f280721d84de..e619edae8f0b29 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; @@ -1212,185 +1414,6 @@ cluster RvcOperationalState = 97 { provisional cluster ServiceArea = 336 { revision 1; // NOTE: Default/not specifically set - enum AreaTypeTag : enum8 { - kAisle = 0; - kAttic = 1; - kBackDoor = 2; - kBackYard = 3; - kBalcony = 4; - kBallroom = 5; - kBathroom = 6; - kBedroom = 7; - kBorder = 8; - kBoxroom = 9; - kBreakfastRoom = 10; - kCarport = 11; - kCellar = 12; - kCloakroom = 13; - kCloset = 14; - kConservatory = 15; - kCorridor = 16; - kCraftRoom = 17; - kCupboard = 18; - kDeck = 19; - kDen = 20; - kDining = 21; - kDrawingRoom = 22; - kDressingRoom = 23; - kDriveway = 24; - kElevator = 25; - kEnsuite = 26; - kEntrance = 27; - kEntryway = 28; - kFamilyRoom = 29; - kFoyer = 30; - kFrontDoor = 31; - kFrontYard = 32; - kGameRoom = 33; - kGarage = 34; - kGarageDoor = 35; - kGarden = 36; - kGardenDoor = 37; - kGuestBathroom = 38; - kGuestBedroom = 39; - kGuestRestroom = 40; - kGuestRoom = 41; - kGym = 42; - kHallway = 43; - kHearthRoom = 44; - kKidsRoom = 45; - kKidsBedroom = 46; - kKitchen = 47; - kLarder = 48; - kLaundryRoom = 49; - kLawn = 50; - kLibrary = 51; - kLivingRoom = 52; - kLounge = 53; - kMediaTVRoom = 54; - kMudRoom = 55; - kMusicRoom = 56; - kNursery = 57; - kOffice = 58; - kOutdoorKitchen = 59; - kOutside = 60; - kPantry = 61; - kParkingLot = 62; - kParlor = 63; - kPatio = 64; - kPlayRoom = 65; - kPoolRoom = 66; - kPorch = 67; - kPrimaryBathroom = 68; - kPrimaryBedroom = 69; - kRamp = 70; - kReceptionRoom = 71; - kRecreationRoom = 72; - kRestroom = 73; - kRoof = 74; - kSauna = 75; - kScullery = 76; - kSewingRoom = 77; - kShed = 78; - kSideDoor = 79; - kSideYard = 80; - kSittingRoom = 81; - kSnug = 82; - kSpa = 83; - kStaircase = 84; - kSteamRoom = 85; - kStorageRoom = 86; - kStudio = 87; - kStudy = 88; - kSunRoom = 89; - kSwimmingPool = 90; - kTerrace = 91; - kUtilityRoom = 92; - kWard = 93; - kWorkshop = 94; - } - - enum FloorSurfaceTag : enum8 { - kCarpet = 0; - kCeramic = 1; - kConcrete = 2; - kCork = 3; - kDeepCarpet = 4; - kDirt = 5; - kEngineeredWood = 6; - kGlass = 7; - kGrass = 8; - kHardwood = 9; - kLaminate = 10; - kLinoleum = 11; - kMat = 12; - kMetal = 13; - kPlastic = 14; - kPolishedConcrete = 15; - kRubber = 16; - kRug = 17; - kSand = 18; - kStone = 19; - kTatami = 20; - kTerrazzo = 21; - kTile = 22; - kVinyl = 23; - } - - enum LandmarkTag : enum8 { - kAirConditioner = 0; - kAirPurifier = 1; - kBackDoor = 2; - kBarStool = 3; - kBathMat = 4; - kBathtub = 5; - kBed = 6; - kBookshelf = 7; - kChair = 8; - kChristmasTree = 9; - kCoatRack = 10; - kCoffeeTable = 11; - kCookingRange = 12; - kCouch = 13; - kCountertop = 14; - kCradle = 15; - kCrib = 16; - kDesk = 17; - kDiningTable = 18; - kDishwasher = 19; - kDoor = 20; - kDresser = 21; - kLaundryDryer = 22; - kFan = 23; - kFireplace = 24; - kFreezer = 25; - kFrontDoor = 26; - kHighChair = 27; - kKitchenIsland = 28; - kLamp = 29; - kLitterBox = 30; - kMirror = 31; - kNightstand = 32; - kOven = 33; - kPetBed = 34; - kPetBowl = 35; - kPetCrate = 36; - kRefrigerator = 37; - kScratchingPost = 38; - kShoeRack = 39; - kShower = 40; - kSideDoor = 41; - kSink = 42; - kSofa = 43; - kStove = 44; - kTable = 45; - kToilet = 46; - kTrashCan = 47; - kLaundryWasher = 48; - kWindow = 49; - kWineCooler = 50; - } - enum OperationalStatusEnum : enum8 { kPending = 0; kOperating = 1; @@ -1398,23 +1421,6 @@ provisional cluster ServiceArea = 336 { kCompleted = 3; } - enum PositionTag : enum8 { - kLeft = 0; - kRight = 1; - kTop = 2; - kBottom = 3; - kMiddle = 4; - kRow = 5; - kColumn = 6; - kUnder = 7; - kNextTo = 8; - kAround = 9; - kOn = 10; - kAbove = 11; - kFrontOf = 12; - kBehind = 13; - } - enum SelectLocationsStatus : enum8 { kSuccess = 0; kUnsupportedLocation = 1; @@ -1434,12 +1440,6 @@ provisional cluster ServiceArea = 336 { kSelectWhileRunning = 0x2; } - struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; - } - struct LocationInfoStruct { nullable LocationDescriptorStruct locationInfo = 0; nullable LandmarkTag landmarkTag = 1; diff --git a/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp b/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp index 4c66b35b43fe60..d913f53d83e940 100644 --- a/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp @@ -40,32 +40,30 @@ CHIP_ERROR RvcServiceAreaDelegate::Init() // Location A has name, floor number, uses map XX GetInstance()->AddSupportedLocation( supportedLocationId_A, DataModel::Nullable(supportedMapId_XX), "My Location A"_span, - DataModel::Nullable(4), DataModel::Nullable(), - DataModel::Nullable(), DataModel::Nullable(), - DataModel::Nullable()); + DataModel::Nullable(4), DataModel::Nullable(), DataModel::Nullable(), + DataModel::Nullable(), DataModel::Nullable()); // Location B has name, uses map XX GetInstance()->AddSupportedLocation( supportedLocationId_B, DataModel::Nullable(supportedMapId_XX), "My Location B"_span, - DataModel::Nullable(), DataModel::Nullable(), - DataModel::Nullable(), DataModel::Nullable(), - DataModel::Nullable()); + DataModel::Nullable(), DataModel::Nullable(), DataModel::Nullable(), + DataModel::Nullable(), DataModel::Nullable()); // Location C has full SemData, no name, Map YY GetInstance()->AddSupportedLocation(supportedLocationId_C, DataModel::Nullable(supportedMapId_YY), CharSpan(), DataModel::Nullable(-1), - DataModel::Nullable(ServiceArea::AreaTypeTag::kPlayRoom), - DataModel::Nullable(ServiceArea::LandmarkTag::kBackDoor), - DataModel::Nullable(ServiceArea::PositionTag::kNextTo), - DataModel::Nullable(ServiceArea::FloorSurfaceTag::kConcrete)); + DataModel::Nullable(Globals::AreaTypeTag::kPlayRoom), + DataModel::Nullable(Globals::LandmarkTag::kBackDoor), + DataModel::Nullable(Globals::PositionTag::kNextTo), + DataModel::Nullable(Globals::FloorSurfaceTag::kConcrete)); // Location D has null values for all HomeLocationStruct fields, Map YY GetInstance()->AddSupportedLocation(supportedLocationId_D, DataModel::Nullable(supportedMapId_YY), "My Location D"_span, DataModel::Nullable(), - DataModel::Nullable(), - DataModel::Nullable(ServiceArea::LandmarkTag::kCouch), - DataModel::Nullable(ServiceArea::PositionTag::kNextTo), - DataModel::Nullable(ServiceArea::FloorSurfaceTag::kHardwood)); + DataModel::Nullable(), + DataModel::Nullable(Globals::LandmarkTag::kCouch), + DataModel::Nullable(Globals::PositionTag::kNextTo), + DataModel::Nullable(Globals::FloorSurfaceTag::kHardwood)); GetInstance()->SetCurrentLocation(supportedLocationId_C); diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index ab4f6f7b2e6ee8..cc9ddb1cce00cb 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 7b0f7ee75df290..409b11d68bcd9c 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 94696ef33210a7..1a3c1a76fa99ee 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 1be09ca8f753c9..1c787b7cc99803 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 8de2bcd4126529..ad0b9a109cad4f 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index dc26361d6dd600..abf0b4419ec713 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 8f4f6a1b37b697..71f8dd019590ad 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index ec75977eba422d..bae4ecfd37ea49 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 64f2e1ef40660a..fc651825cce654 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 7e86a64c7fa2d3..7037e2ed4540e8 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; diff --git a/src/app/clusters/service-area-server/service-area-cluster-objects.h b/src/app/clusters/service-area-server/service-area-cluster-objects.h index e46704796f74c3..1be2918795a1f0 100644 --- a/src/app/clusters/service-area-server/service-area-cluster-objects.h +++ b/src/app/clusters/service-area-server/service-area-cluster-objects.h @@ -38,8 +38,9 @@ struct LocationStructureWrapper : public chip::app::Clusters::ServiceArea::Struc { LocationStructureWrapper() { - Set(0, 0, CharSpan(), DataModel::Nullable(), DataModel::Nullable(), - DataModel::Nullable(), DataModel::Nullable(), DataModel::Nullable()); + Set(0, 0, CharSpan(), DataModel::Nullable(), DataModel::Nullable(), + DataModel::Nullable(), DataModel::Nullable(), + DataModel::Nullable()); } /** @@ -61,10 +62,10 @@ struct LocationStructureWrapper : public chip::app::Clusters::ServiceArea::Struc */ LocationStructureWrapper(uint32_t aLocationId, const DataModel::Nullable & aMapId, const CharSpan & aLocationName, const DataModel::Nullable & aFloorNumber, - const DataModel::Nullable & aAreaTypeTag, - const DataModel::Nullable & aLandmarkTag, - const DataModel::Nullable & aPositionTag, - const DataModel::Nullable & aSurfaceTag) + const DataModel::Nullable & aAreaTypeTag, + const DataModel::Nullable & aLandmarkTag, + const DataModel::Nullable & aPositionTag, + const DataModel::Nullable & aSurfaceTag) { Set(aLocationId, aMapId, aLocationName, aFloorNumber, aAreaTypeTag, aLandmarkTag, aPositionTag, aSurfaceTag); } @@ -120,9 +121,10 @@ struct LocationStructureWrapper : public chip::app::Clusters::ServiceArea::Struc * @note If aLocationName is an empty string and aFloorNumber and aAreaTypeTag are null, locationInfo will be set to null. */ void Set(uint32_t aLocationId, const DataModel::Nullable & aMapId, const CharSpan & aLocationName, - const DataModel::Nullable & aFloorNumber, const DataModel::Nullable & aAreaType, - const DataModel::Nullable & aLandmarkTag, const DataModel::Nullable & aPositionTag, - const DataModel::Nullable & aSurfaceTag) + const DataModel::Nullable & aFloorNumber, const DataModel::Nullable & aAreaType, + const DataModel::Nullable & aLandmarkTag, + const DataModel::Nullable & aPositionTag, + const DataModel::Nullable & aSurfaceTag) { locationID = aLocationId; mapID = aMapId; @@ -131,7 +133,7 @@ struct LocationStructureWrapper : public chip::app::Clusters::ServiceArea::Struc if ((!aLocationName.empty()) || (!aFloorNumber.IsNull()) || (!aAreaType.IsNull())) { // Create a home location info structure and fill it in except for the location name. This is done below. - locationInfo.locationInfo.SetNonNull(Structs::LocationDescriptorStruct::Type()); + locationInfo.locationInfo.SetNonNull(Globals::Structs::LocationDescriptorStruct::Type()); locationInfo.locationInfo.Value().floorNumber = aFloorNumber; locationInfo.locationInfo.Value().areaType = aAreaType; diff --git a/src/app/clusters/service-area-server/service-area-server.cpp b/src/app/clusters/service-area-server/service-area-server.cpp index 97775fb24f67c0..79837ff0bf216c 100644 --- a/src/app/clusters/service-area-server/service-area-server.cpp +++ b/src/app/clusters/service-area-server/service-area-server.cpp @@ -573,10 +573,10 @@ bool Instance::ReportEstimatedEndTimeChange(const DataModel::Nullable bool Instance::AddSupportedLocation(uint32_t aLocationId, const DataModel::Nullable & aMapId, const CharSpan & aLocationName, const DataModel::Nullable & aFloorNumber, - const DataModel::Nullable & aAreaType, - const DataModel::Nullable & aLandmarkTag, - const DataModel::Nullable & aPositionTag, - const DataModel::Nullable & aSurfaceTag) + const DataModel::Nullable & aAreaType, + const DataModel::Nullable & aLandmarkTag, + const DataModel::Nullable & aPositionTag, + const DataModel::Nullable & aSurfaceTag) { // Create location object for validation. LocationStructureWrapper aNewLocation(aLocationId, aMapId, aLocationName, aFloorNumber, aAreaType, aLandmarkTag, aPositionTag, @@ -625,10 +625,10 @@ bool Instance::AddSupportedLocation(uint32_t aLocationId, const DataModel::Nulla bool Instance::ModifySupportedLocation(uint32_t aLocationId, const DataModel::Nullable & aMapId, const CharSpan & aLocationName, const DataModel::Nullable & aFloorNumber, - const DataModel::Nullable & aAreaType, - const DataModel::Nullable & aLandmarkTag, - const DataModel::Nullable & aPositionTag, - const DataModel::Nullable & aSurfaceTag) + const DataModel::Nullable & aAreaType, + const DataModel::Nullable & aLandmarkTag, + const DataModel::Nullable & aPositionTag, + const DataModel::Nullable & aSurfaceTag) { bool mapIDChanged = false; uint32_t listIndex; diff --git a/src/app/clusters/service-area-server/service-area-server.h b/src/app/clusters/service-area-server/service-area-server.h index f43ea07337406f..d781987c8d26dd 100644 --- a/src/app/clusters/service-area-server/service-area-server.h +++ b/src/app/clusters/service-area-server/service-area-server.h @@ -183,10 +183,11 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface * @note if aLocationName is larger than kLocationNameMaxSize, it will be truncated. */ bool AddSupportedLocation(uint32_t aLocationId, const DataModel::Nullable & aMapId, const CharSpan & aLocationName, - const DataModel::Nullable & aFloorNumber, const DataModel::Nullable & aAreaType, - const DataModel::Nullable & aLandmarkTag, - const DataModel::Nullable & aPositionTag, - const DataModel::Nullable & aSurfaceTag); + const DataModel::Nullable & aFloorNumber, + const DataModel::Nullable & aAreaType, + const DataModel::Nullable & aLandmarkTag, + const DataModel::Nullable & aPositionTag, + const DataModel::Nullable & aSurfaceTag); /** * @brief Modify/replace an existing location in the supported locations list. @@ -207,10 +208,10 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface */ bool ModifySupportedLocation(uint32_t aLocationId, const DataModel::Nullable & aMapId, const CharSpan & aLocationName, const DataModel::Nullable & aFloorNumber, - const DataModel::Nullable & aAreaType, - const DataModel::Nullable & aLandmarkTag, - const DataModel::Nullable & aPositionTag, - const DataModel::Nullable & aSurfaceTag); + const DataModel::Nullable & aAreaType, + const DataModel::Nullable & aLandmarkTag, + const DataModel::Nullable & aPositionTag, + const DataModel::Nullable & aSurfaceTag); /** * @return true if the SupportedLocations attribute was not already null. diff --git a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml index 04f477a6094f5e..4e1ce5f3827298 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml @@ -15,19 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. --> - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml b/src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml index 8e6d9237e29d90..b79a5398d78bdb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml +++ b/src/app/zap-templates/zcl/data-model/chip/semantic-tag-namespace-enums.xml @@ -16,16 +16,8 @@ limitations under the License. --> - - - - @@ -43,10 +35,6 @@ TODO: Make these namespace enums global rather than defining them for each clust - - - - @@ -150,7 +138,6 @@ TODO: Make these namespace enums global rather than defining them for each clust - @@ -208,7 +195,6 @@ TODO: Make these namespace enums global rather than defining them for each clust - diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index c0e1f7cb0f2eb7..827e4e7ae084b5 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1,6 +1,202 @@ // This IDL was generated automatically by ZAP. // It is for view/code review purposes only. +enum AreaTypeTag : enum8 { + kAisle = 0; + kAttic = 1; + kBackDoor = 2; + kBackYard = 3; + kBalcony = 4; + kBallroom = 5; + kBathroom = 6; + kBedroom = 7; + kBorder = 8; + kBoxroom = 9; + kBreakfastRoom = 10; + kCarport = 11; + kCellar = 12; + kCloakroom = 13; + kCloset = 14; + kConservatory = 15; + kCorridor = 16; + kCraftRoom = 17; + kCupboard = 18; + kDeck = 19; + kDen = 20; + kDining = 21; + kDrawingRoom = 22; + kDressingRoom = 23; + kDriveway = 24; + kElevator = 25; + kEnsuite = 26; + kEntrance = 27; + kEntryway = 28; + kFamilyRoom = 29; + kFoyer = 30; + kFrontDoor = 31; + kFrontYard = 32; + kGameRoom = 33; + kGarage = 34; + kGarageDoor = 35; + kGarden = 36; + kGardenDoor = 37; + kGuestBathroom = 38; + kGuestBedroom = 39; + kGuestRestroom = 40; + kGuestRoom = 41; + kGym = 42; + kHallway = 43; + kHearthRoom = 44; + kKidsRoom = 45; + kKidsBedroom = 46; + kKitchen = 47; + kLarder = 48; + kLaundryRoom = 49; + kLawn = 50; + kLibrary = 51; + kLivingRoom = 52; + kLounge = 53; + kMediaTVRoom = 54; + kMudRoom = 55; + kMusicRoom = 56; + kNursery = 57; + kOffice = 58; + kOutdoorKitchen = 59; + kOutside = 60; + kPantry = 61; + kParkingLot = 62; + kParlor = 63; + kPatio = 64; + kPlayRoom = 65; + kPoolRoom = 66; + kPorch = 67; + kPrimaryBathroom = 68; + kPrimaryBedroom = 69; + kRamp = 70; + kReceptionRoom = 71; + kRecreationRoom = 72; + kRestroom = 73; + kRoof = 74; + kSauna = 75; + kScullery = 76; + kSewingRoom = 77; + kShed = 78; + kSideDoor = 79; + kSideYard = 80; + kSittingRoom = 81; + kSnug = 82; + kSpa = 83; + kStaircase = 84; + kSteamRoom = 85; + kStorageRoom = 86; + kStudio = 87; + kStudy = 88; + kSunRoom = 89; + kSwimmingPool = 90; + kTerrace = 91; + kUtilityRoom = 92; + kWard = 93; + kWorkshop = 94; +} + +enum FloorSurfaceTag : enum8 { + kCarpet = 0; + kCeramic = 1; + kConcrete = 2; + kCork = 3; + kDeepCarpet = 4; + kDirt = 5; + kEngineeredWood = 6; + kGlass = 7; + kGrass = 8; + kHardwood = 9; + kLaminate = 10; + kLinoleum = 11; + kMat = 12; + kMetal = 13; + kPlastic = 14; + kPolishedConcrete = 15; + kRubber = 16; + kRug = 17; + kSand = 18; + kStone = 19; + kTatami = 20; + kTerrazzo = 21; + kTile = 22; + kVinyl = 23; +} + +enum LandmarkTag : enum8 { + kAirConditioner = 0; + kAirPurifier = 1; + kBackDoor = 2; + kBarStool = 3; + kBathMat = 4; + kBathtub = 5; + kBed = 6; + kBookshelf = 7; + kChair = 8; + kChristmasTree = 9; + kCoatRack = 10; + kCoffeeTable = 11; + kCookingRange = 12; + kCouch = 13; + kCountertop = 14; + kCradle = 15; + kCrib = 16; + kDesk = 17; + kDiningTable = 18; + kDishwasher = 19; + kDoor = 20; + kDresser = 21; + kLaundryDryer = 22; + kFan = 23; + kFireplace = 24; + kFreezer = 25; + kFrontDoor = 26; + kHighChair = 27; + kKitchenIsland = 28; + kLamp = 29; + kLitterBox = 30; + kMirror = 31; + kNightstand = 32; + kOven = 33; + kPetBed = 34; + kPetBowl = 35; + kPetCrate = 36; + kRefrigerator = 37; + kScratchingPost = 38; + kShoeRack = 39; + kShower = 40; + kSideDoor = 41; + kSink = 42; + kSofa = 43; + kStove = 44; + kTable = 45; + kToilet = 46; + kTrashCan = 47; + kLaundryWasher = 48; + kWindow = 49; + kWineCooler = 50; +} + +enum PositionTag : enum8 { + kLeft = 0; + kRight = 1; + kTop = 2; + kBottom = 3; + kMiddle = 4; + kRow = 5; + kColumn = 6; + kUnder = 7; + kNextTo = 8; + kAround = 9; + kOn = 10; + kAbove = 11; + kFrontOf = 12; + kBehind = 13; +} + enum TestGlobalEnum : enum8 { kSomeValue = 0; kSomeOtherValue = 1; @@ -12,6 +208,12 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; @@ -6234,185 +6436,6 @@ deprecated cluster BarrierControl = 259 { provisional cluster ServiceArea = 336 { revision 1; // NOTE: Default/not specifically set - enum AreaTypeTag : enum8 { - kAisle = 0; - kAttic = 1; - kBackDoor = 2; - kBackYard = 3; - kBalcony = 4; - kBallroom = 5; - kBathroom = 6; - kBedroom = 7; - kBorder = 8; - kBoxroom = 9; - kBreakfastRoom = 10; - kCarport = 11; - kCellar = 12; - kCloakroom = 13; - kCloset = 14; - kConservatory = 15; - kCorridor = 16; - kCraftRoom = 17; - kCupboard = 18; - kDeck = 19; - kDen = 20; - kDining = 21; - kDrawingRoom = 22; - kDressingRoom = 23; - kDriveway = 24; - kElevator = 25; - kEnsuite = 26; - kEntrance = 27; - kEntryway = 28; - kFamilyRoom = 29; - kFoyer = 30; - kFrontDoor = 31; - kFrontYard = 32; - kGameRoom = 33; - kGarage = 34; - kGarageDoor = 35; - kGarden = 36; - kGardenDoor = 37; - kGuestBathroom = 38; - kGuestBedroom = 39; - kGuestRestroom = 40; - kGuestRoom = 41; - kGym = 42; - kHallway = 43; - kHearthRoom = 44; - kKidsRoom = 45; - kKidsBedroom = 46; - kKitchen = 47; - kLarder = 48; - kLaundryRoom = 49; - kLawn = 50; - kLibrary = 51; - kLivingRoom = 52; - kLounge = 53; - kMediaTVRoom = 54; - kMudRoom = 55; - kMusicRoom = 56; - kNursery = 57; - kOffice = 58; - kOutdoorKitchen = 59; - kOutside = 60; - kPantry = 61; - kParkingLot = 62; - kParlor = 63; - kPatio = 64; - kPlayRoom = 65; - kPoolRoom = 66; - kPorch = 67; - kPrimaryBathroom = 68; - kPrimaryBedroom = 69; - kRamp = 70; - kReceptionRoom = 71; - kRecreationRoom = 72; - kRestroom = 73; - kRoof = 74; - kSauna = 75; - kScullery = 76; - kSewingRoom = 77; - kShed = 78; - kSideDoor = 79; - kSideYard = 80; - kSittingRoom = 81; - kSnug = 82; - kSpa = 83; - kStaircase = 84; - kSteamRoom = 85; - kStorageRoom = 86; - kStudio = 87; - kStudy = 88; - kSunRoom = 89; - kSwimmingPool = 90; - kTerrace = 91; - kUtilityRoom = 92; - kWard = 93; - kWorkshop = 94; - } - - enum FloorSurfaceTag : enum8 { - kCarpet = 0; - kCeramic = 1; - kConcrete = 2; - kCork = 3; - kDeepCarpet = 4; - kDirt = 5; - kEngineeredWood = 6; - kGlass = 7; - kGrass = 8; - kHardwood = 9; - kLaminate = 10; - kLinoleum = 11; - kMat = 12; - kMetal = 13; - kPlastic = 14; - kPolishedConcrete = 15; - kRubber = 16; - kRug = 17; - kSand = 18; - kStone = 19; - kTatami = 20; - kTerrazzo = 21; - kTile = 22; - kVinyl = 23; - } - - enum LandmarkTag : enum8 { - kAirConditioner = 0; - kAirPurifier = 1; - kBackDoor = 2; - kBarStool = 3; - kBathMat = 4; - kBathtub = 5; - kBed = 6; - kBookshelf = 7; - kChair = 8; - kChristmasTree = 9; - kCoatRack = 10; - kCoffeeTable = 11; - kCookingRange = 12; - kCouch = 13; - kCountertop = 14; - kCradle = 15; - kCrib = 16; - kDesk = 17; - kDiningTable = 18; - kDishwasher = 19; - kDoor = 20; - kDresser = 21; - kLaundryDryer = 22; - kFan = 23; - kFireplace = 24; - kFreezer = 25; - kFrontDoor = 26; - kHighChair = 27; - kKitchenIsland = 28; - kLamp = 29; - kLitterBox = 30; - kMirror = 31; - kNightstand = 32; - kOven = 33; - kPetBed = 34; - kPetBowl = 35; - kPetCrate = 36; - kRefrigerator = 37; - kScratchingPost = 38; - kShoeRack = 39; - kShower = 40; - kSideDoor = 41; - kSink = 42; - kSofa = 43; - kStove = 44; - kTable = 45; - kToilet = 46; - kTrashCan = 47; - kLaundryWasher = 48; - kWindow = 49; - kWineCooler = 50; - } - enum OperationalStatusEnum : enum8 { kPending = 0; kOperating = 1; @@ -6420,23 +6443,6 @@ provisional cluster ServiceArea = 336 { kCompleted = 3; } - enum PositionTag : enum8 { - kLeft = 0; - kRight = 1; - kTop = 2; - kBottom = 3; - kMiddle = 4; - kRow = 5; - kColumn = 6; - kUnder = 7; - kNextTo = 8; - kAround = 9; - kOn = 10; - kAbove = 11; - kFrontOf = 12; - kBehind = 13; - } - enum SelectLocationsStatus : enum8 { kSuccess = 0; kUnsupportedLocation = 1; @@ -6456,12 +6462,6 @@ provisional cluster ServiceArea = 336 { kSelectWhileRunning = 0x2; } - struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; - } - struct LocationInfoStruct { nullable LocationDescriptorStruct locationInfo = 0; nullable LandmarkTag landmarkTag = 1; @@ -9337,117 +9337,6 @@ provisional cluster ContentAppObserver = 1296 { provisional cluster EcosystemInformation = 1872 { revision 1; - enum AreaTypeTag : enum8 { - kAisle = 0; - kAttic = 1; - kBackDoor = 2; - kBackYard = 3; - kBalcony = 4; - kBallroom = 5; - kBathroom = 6; - kBedroom = 7; - kBorder = 8; - kBoxroom = 9; - kBreakfastRoom = 10; - kCarport = 11; - kCellar = 12; - kCloakroom = 13; - kCloset = 14; - kConservatory = 15; - kCorridor = 16; - kCraftRoom = 17; - kCupboard = 18; - kDeck = 19; - kDen = 20; - kDining = 21; - kDrawingRoom = 22; - kDressingRoom = 23; - kDriveway = 24; - kElevator = 25; - kEnsuite = 26; - kEntrance = 27; - kEntryway = 28; - kFamilyRoom = 29; - kFoyer = 30; - kFrontDoor = 31; - kFrontYard = 32; - kGameRoom = 33; - kGarage = 34; - kGarageDoor = 35; - kGarden = 36; - kGardenDoor = 37; - kGuestBathroom = 38; - kGuestBedroom = 39; - kGuestRestroom = 40; - kGuestRoom = 41; - kGym = 42; - kHallway = 43; - kHearthRoom = 44; - kKidsRoom = 45; - kKidsBedroom = 46; - kKitchen = 47; - kLarder = 48; - kLaundryRoom = 49; - kLawn = 50; - kLibrary = 51; - kLivingRoom = 52; - kLounge = 53; - kMediaTVRoom = 54; - kMudRoom = 55; - kMusicRoom = 56; - kNursery = 57; - kOffice = 58; - kOutdoorKitchen = 59; - kOutside = 60; - kPantry = 61; - kParkingLot = 62; - kParlor = 63; - kPatio = 64; - kPlayRoom = 65; - kPoolRoom = 66; - kPorch = 67; - kPrimaryBathroom = 68; - kPrimaryBedroom = 69; - kRamp = 70; - kReceptionRoom = 71; - kRecreationRoom = 72; - kRestroom = 73; - kRoof = 74; - kSauna = 75; - kScullery = 76; - kSewingRoom = 77; - kShed = 78; - kSideDoor = 79; - kSideYard = 80; - kSittingRoom = 81; - kSnug = 82; - kSpa = 83; - kStaircase = 84; - kSteamRoom = 85; - kStorageRoom = 86; - kStudio = 87; - kStudy = 88; - kSunRoom = 89; - kSwimmingPool = 90; - kTerrace = 91; - kUtilityRoom = 92; - kWard = 93; - kWorkshop = 94; - } - - struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; - } - - fabric_scoped struct EcosystemLocationStruct { - fabric_sensitive char_string<64> uniqueLocationID = 0; - fabric_sensitive LocationDescriptorStruct locationDescriptor = 1; - fabric_sensitive epoch_us locationDescriptorLastEdit = 2; - fabric_idx fabricIndex = 254; - } - struct DeviceTypeStruct { devtype_id deviceType = 0; int16u revision = 1; @@ -9464,6 +9353,13 @@ provisional cluster EcosystemInformation = 1872 { fabric_idx fabricIndex = 254; } + fabric_scoped struct EcosystemLocationStruct { + fabric_sensitive char_string<64> uniqueLocationID = 0; + fabric_sensitive LocationDescriptorStruct locationDescriptor = 1; + fabric_sensitive epoch_us locationDescriptorLastEdit = 2; + fabric_idx fabricIndex = 254; + } + readonly attribute access(read: manage) optional nullable epoch_us removedOn = 0; readonly attribute access(read: manage) EcosystemDeviceStruct deviceDirectory[] = 1; readonly attribute access(read: manage) EcosystemLocationStruct locationDirectory[] = 2; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 5ab4c29beb623b..9e32eaab03ffac 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -9171,82 +9171,6 @@ public String toString() { return output.toString(); } } -public static class ServiceAreaClusterLocationDescriptorStruct { - public String locationName; - public @Nullable Integer floorNumber; - public @Nullable Integer areaType; - private static final long LOCATION_NAME_ID = 0L; - private static final long FLOOR_NUMBER_ID = 1L; - private static final long AREA_TYPE_ID = 2L; - - public ServiceAreaClusterLocationDescriptorStruct( - String locationName, - @Nullable Integer floorNumber, - @Nullable Integer areaType - ) { - this.locationName = locationName; - this.floorNumber = floorNumber; - this.areaType = areaType; - } - - public StructType encodeTlv() { - ArrayList values = new ArrayList<>(); - values.add(new StructElement(LOCATION_NAME_ID, new StringType(locationName))); - values.add(new StructElement(FLOOR_NUMBER_ID, floorNumber != null ? new IntType(floorNumber) : new NullType())); - values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new UIntType(areaType) : new NullType())); - - return new StructType(values); - } - - public static ServiceAreaClusterLocationDescriptorStruct decodeTlv(BaseTLVType tlvValue) { - if (tlvValue == null || tlvValue.type() != TLVType.Struct) { - return null; - } - String locationName = null; - @Nullable Integer floorNumber = null; - @Nullable Integer areaType = null; - for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == LOCATION_NAME_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - locationName = castingValue.value(String.class); - } - } else if (element.contextTagNum() == FLOOR_NUMBER_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.Int) { - IntType castingValue = element.value(IntType.class); - floorNumber = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == AREA_TYPE_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - areaType = castingValue.value(Integer.class); - } - } - } - return new ServiceAreaClusterLocationDescriptorStruct( - locationName, - floorNumber, - areaType - ); - } - - @Override - public String toString() { - StringBuilder output = new StringBuilder(); - output.append("ServiceAreaClusterLocationDescriptorStruct {\n"); - output.append("\tlocationName: "); - output.append(locationName); - output.append("\n"); - output.append("\tfloorNumber: "); - output.append(floorNumber); - output.append("\n"); - output.append("\tareaType: "); - output.append(areaType); - output.append("\n"); - output.append("}\n"); - return output.toString(); - } -} public static class ServiceAreaClusterLocationInfoStruct { public @Nullable ChipStructs.ServiceAreaClusterLocationDescriptorStruct locationInfo; public @Nullable Integer landmarkTag; @@ -9566,6 +9490,82 @@ public String toString() { return output.toString(); } } +public static class ServiceAreaClusterLocationDescriptorStruct { + public String locationName; + public @Nullable Integer floorNumber; + public @Nullable Integer areaType; + private static final long LOCATION_NAME_ID = 0L; + private static final long FLOOR_NUMBER_ID = 1L; + private static final long AREA_TYPE_ID = 2L; + + public ServiceAreaClusterLocationDescriptorStruct( + String locationName, + @Nullable Integer floorNumber, + @Nullable Integer areaType + ) { + this.locationName = locationName; + this.floorNumber = floorNumber; + this.areaType = areaType; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(LOCATION_NAME_ID, new StringType(locationName))); + values.add(new StructElement(FLOOR_NUMBER_ID, floorNumber != null ? new IntType(floorNumber) : new NullType())); + values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new UIntType(areaType) : new NullType())); + + return new StructType(values); + } + + public static ServiceAreaClusterLocationDescriptorStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String locationName = null; + @Nullable Integer floorNumber = null; + @Nullable Integer areaType = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == LOCATION_NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + locationName = castingValue.value(String.class); + } + } else if (element.contextTagNum() == FLOOR_NUMBER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + floorNumber = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AREA_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + areaType = castingValue.value(Integer.class); + } + } + } + return new ServiceAreaClusterLocationDescriptorStruct( + locationName, + floorNumber, + areaType + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ServiceAreaClusterLocationDescriptorStruct {\n"); + output.append("\tlocationName: "); + output.append(locationName); + output.append("\n"); + output.append("\tfloorNumber: "); + output.append(floorNumber); + output.append("\n"); + output.append("\tareaType: "); + output.append(areaType); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ThermostatClusterScheduleTransitionStruct { public Integer dayOfWeek; public Integer transitionTime; @@ -12511,173 +12511,6 @@ public String toString() { return output.toString(); } } -public static class EcosystemInformationClusterLocationDescriptorStruct { - public String locationName; - public @Nullable Integer floorNumber; - public @Nullable Integer areaType; - private static final long LOCATION_NAME_ID = 0L; - private static final long FLOOR_NUMBER_ID = 1L; - private static final long AREA_TYPE_ID = 2L; - - public EcosystemInformationClusterLocationDescriptorStruct( - String locationName, - @Nullable Integer floorNumber, - @Nullable Integer areaType - ) { - this.locationName = locationName; - this.floorNumber = floorNumber; - this.areaType = areaType; - } - - public StructType encodeTlv() { - ArrayList values = new ArrayList<>(); - values.add(new StructElement(LOCATION_NAME_ID, new StringType(locationName))); - values.add(new StructElement(FLOOR_NUMBER_ID, floorNumber != null ? new IntType(floorNumber) : new NullType())); - values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new UIntType(areaType) : new NullType())); - - return new StructType(values); - } - - public static EcosystemInformationClusterLocationDescriptorStruct decodeTlv(BaseTLVType tlvValue) { - if (tlvValue == null || tlvValue.type() != TLVType.Struct) { - return null; - } - String locationName = null; - @Nullable Integer floorNumber = null; - @Nullable Integer areaType = null; - for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == LOCATION_NAME_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - locationName = castingValue.value(String.class); - } - } else if (element.contextTagNum() == FLOOR_NUMBER_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.Int) { - IntType castingValue = element.value(IntType.class); - floorNumber = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == AREA_TYPE_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - areaType = castingValue.value(Integer.class); - } - } - } - return new EcosystemInformationClusterLocationDescriptorStruct( - locationName, - floorNumber, - areaType - ); - } - - @Override - public String toString() { - StringBuilder output = new StringBuilder(); - output.append("EcosystemInformationClusterLocationDescriptorStruct {\n"); - output.append("\tlocationName: "); - output.append(locationName); - output.append("\n"); - output.append("\tfloorNumber: "); - output.append(floorNumber); - output.append("\n"); - output.append("\tareaType: "); - output.append(areaType); - output.append("\n"); - output.append("}\n"); - return output.toString(); - } -} -public static class EcosystemInformationClusterEcosystemLocationStruct { - public String uniqueLocationID; - public ChipStructs.EcosystemInformationClusterLocationDescriptorStruct locationDescriptor; - public Long locationDescriptorLastEdit; - public Integer fabricIndex; - private static final long UNIQUE_LOCATION_I_D_ID = 0L; - private static final long LOCATION_DESCRIPTOR_ID = 1L; - private static final long LOCATION_DESCRIPTOR_LAST_EDIT_ID = 2L; - private static final long FABRIC_INDEX_ID = 254L; - - public EcosystemInformationClusterEcosystemLocationStruct( - String uniqueLocationID, - ChipStructs.EcosystemInformationClusterLocationDescriptorStruct locationDescriptor, - Long locationDescriptorLastEdit, - Integer fabricIndex - ) { - this.uniqueLocationID = uniqueLocationID; - this.locationDescriptor = locationDescriptor; - this.locationDescriptorLastEdit = locationDescriptorLastEdit; - this.fabricIndex = fabricIndex; - } - - public StructType encodeTlv() { - ArrayList values = new ArrayList<>(); - values.add(new StructElement(UNIQUE_LOCATION_I_D_ID, new StringType(uniqueLocationID))); - values.add(new StructElement(LOCATION_DESCRIPTOR_ID, locationDescriptor.encodeTlv())); - values.add(new StructElement(LOCATION_DESCRIPTOR_LAST_EDIT_ID, new UIntType(locationDescriptorLastEdit))); - values.add(new StructElement(FABRIC_INDEX_ID, new UIntType(fabricIndex))); - - return new StructType(values); - } - - public static EcosystemInformationClusterEcosystemLocationStruct decodeTlv(BaseTLVType tlvValue) { - if (tlvValue == null || tlvValue.type() != TLVType.Struct) { - return null; - } - String uniqueLocationID = null; - ChipStructs.EcosystemInformationClusterLocationDescriptorStruct locationDescriptor = null; - Long locationDescriptorLastEdit = null; - Integer fabricIndex = null; - for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == UNIQUE_LOCATION_I_D_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - uniqueLocationID = castingValue.value(String.class); - } - } else if (element.contextTagNum() == LOCATION_DESCRIPTOR_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.Struct) { - StructType castingValue = element.value(StructType.class); - locationDescriptor = ChipStructs.EcosystemInformationClusterLocationDescriptorStruct.decodeTlv(castingValue); - } - } else if (element.contextTagNum() == LOCATION_DESCRIPTOR_LAST_EDIT_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - locationDescriptorLastEdit = castingValue.value(Long.class); - } - } else if (element.contextTagNum() == FABRIC_INDEX_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - fabricIndex = castingValue.value(Integer.class); - } - } - } - return new EcosystemInformationClusterEcosystemLocationStruct( - uniqueLocationID, - locationDescriptor, - locationDescriptorLastEdit, - fabricIndex - ); - } - - @Override - public String toString() { - StringBuilder output = new StringBuilder(); - output.append("EcosystemInformationClusterEcosystemLocationStruct {\n"); - output.append("\tuniqueLocationID: "); - output.append(uniqueLocationID); - output.append("\n"); - output.append("\tlocationDescriptor: "); - output.append(locationDescriptor); - output.append("\n"); - output.append("\tlocationDescriptorLastEdit: "); - output.append(locationDescriptorLastEdit); - output.append("\n"); - output.append("\tfabricIndex: "); - output.append(fabricIndex); - output.append("\n"); - output.append("}\n"); - return output.toString(); - } -} public static class EcosystemInformationClusterDeviceTypeStruct { public Long deviceType; public Integer revision; @@ -12890,6 +12723,173 @@ public String toString() { return output.toString(); } } +public static class EcosystemInformationClusterEcosystemLocationStruct { + public String uniqueLocationID; + public ChipStructs.EcosystemInformationClusterLocationDescriptorStruct locationDescriptor; + public Long locationDescriptorLastEdit; + public Integer fabricIndex; + private static final long UNIQUE_LOCATION_I_D_ID = 0L; + private static final long LOCATION_DESCRIPTOR_ID = 1L; + private static final long LOCATION_DESCRIPTOR_LAST_EDIT_ID = 2L; + private static final long FABRIC_INDEX_ID = 254L; + + public EcosystemInformationClusterEcosystemLocationStruct( + String uniqueLocationID, + ChipStructs.EcosystemInformationClusterLocationDescriptorStruct locationDescriptor, + Long locationDescriptorLastEdit, + Integer fabricIndex + ) { + this.uniqueLocationID = uniqueLocationID; + this.locationDescriptor = locationDescriptor; + this.locationDescriptorLastEdit = locationDescriptorLastEdit; + this.fabricIndex = fabricIndex; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(UNIQUE_LOCATION_I_D_ID, new StringType(uniqueLocationID))); + values.add(new StructElement(LOCATION_DESCRIPTOR_ID, locationDescriptor.encodeTlv())); + values.add(new StructElement(LOCATION_DESCRIPTOR_LAST_EDIT_ID, new UIntType(locationDescriptorLastEdit))); + values.add(new StructElement(FABRIC_INDEX_ID, new UIntType(fabricIndex))); + + return new StructType(values); + } + + public static EcosystemInformationClusterEcosystemLocationStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String uniqueLocationID = null; + ChipStructs.EcosystemInformationClusterLocationDescriptorStruct locationDescriptor = null; + Long locationDescriptorLastEdit = null; + Integer fabricIndex = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == UNIQUE_LOCATION_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + uniqueLocationID = castingValue.value(String.class); + } + } else if (element.contextTagNum() == LOCATION_DESCRIPTOR_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + locationDescriptor = ChipStructs.EcosystemInformationClusterLocationDescriptorStruct.decodeTlv(castingValue); + } + } else if (element.contextTagNum() == LOCATION_DESCRIPTOR_LAST_EDIT_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + locationDescriptorLastEdit = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == FABRIC_INDEX_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + fabricIndex = castingValue.value(Integer.class); + } + } + } + return new EcosystemInformationClusterEcosystemLocationStruct( + uniqueLocationID, + locationDescriptor, + locationDescriptorLastEdit, + fabricIndex + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EcosystemInformationClusterEcosystemLocationStruct {\n"); + output.append("\tuniqueLocationID: "); + output.append(uniqueLocationID); + output.append("\n"); + output.append("\tlocationDescriptor: "); + output.append(locationDescriptor); + output.append("\n"); + output.append("\tlocationDescriptorLastEdit: "); + output.append(locationDescriptorLastEdit); + output.append("\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} +public static class EcosystemInformationClusterLocationDescriptorStruct { + public String locationName; + public @Nullable Integer floorNumber; + public @Nullable Integer areaType; + private static final long LOCATION_NAME_ID = 0L; + private static final long FLOOR_NUMBER_ID = 1L; + private static final long AREA_TYPE_ID = 2L; + + public EcosystemInformationClusterLocationDescriptorStruct( + String locationName, + @Nullable Integer floorNumber, + @Nullable Integer areaType + ) { + this.locationName = locationName; + this.floorNumber = floorNumber; + this.areaType = areaType; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(LOCATION_NAME_ID, new StringType(locationName))); + values.add(new StructElement(FLOOR_NUMBER_ID, floorNumber != null ? new IntType(floorNumber) : new NullType())); + values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new UIntType(areaType) : new NullType())); + + return new StructType(values); + } + + public static EcosystemInformationClusterLocationDescriptorStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String locationName = null; + @Nullable Integer floorNumber = null; + @Nullable Integer areaType = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == LOCATION_NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + locationName = castingValue.value(String.class); + } + } else if (element.contextTagNum() == FLOOR_NUMBER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + floorNumber = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AREA_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + areaType = castingValue.value(Integer.class); + } + } + } + return new EcosystemInformationClusterLocationDescriptorStruct( + locationName, + floorNumber, + areaType + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("EcosystemInformationClusterLocationDescriptorStruct {\n"); + output.append("\tlocationName: "); + output.append(locationName); + output.append("\n"); + output.append("\tfloorNumber: "); + output.append(floorNumber); + output.append("\n"); + output.append("\tareaType: "); + output.append(areaType); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class UnitTestingClusterSimpleStruct { public Integer a; public Boolean b; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 3795b08dd230e3..57211812f30b96 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -38,6 +38,218 @@ class Globals: class Enums: + class AreaTypeTag(MatterIntEnum): + kAisle = 0x00 + kAttic = 0x01 + kBackDoor = 0x02 + kBackYard = 0x03 + kBalcony = 0x04 + kBallroom = 0x05 + kBathroom = 0x06 + kBedroom = 0x07 + kBorder = 0x08 + kBoxroom = 0x09 + kBreakfastRoom = 0x0A + kCarport = 0x0B + kCellar = 0x0C + kCloakroom = 0x0D + kCloset = 0x0E + kConservatory = 0x0F + kCorridor = 0x10 + kCraftRoom = 0x11 + kCupboard = 0x12 + kDeck = 0x13 + kDen = 0x14 + kDining = 0x15 + kDrawingRoom = 0x16 + kDressingRoom = 0x17 + kDriveway = 0x18 + kElevator = 0x19 + kEnsuite = 0x1A + kEntrance = 0x1B + kEntryway = 0x1C + kFamilyRoom = 0x1D + kFoyer = 0x1E + kFrontDoor = 0x1F + kFrontYard = 0x20 + kGameRoom = 0x21 + kGarage = 0x22 + kGarageDoor = 0x23 + kGarden = 0x24 + kGardenDoor = 0x25 + kGuestBathroom = 0x26 + kGuestBedroom = 0x27 + kGuestRestroom = 0x28 + kGuestRoom = 0x29 + kGym = 0x2A + kHallway = 0x2B + kHearthRoom = 0x2C + kKidsRoom = 0x2D + kKidsBedroom = 0x2E + kKitchen = 0x2F + kLarder = 0x30 + kLaundryRoom = 0x31 + kLawn = 0x32 + kLibrary = 0x33 + kLivingRoom = 0x34 + kLounge = 0x35 + kMediaTvRoom = 0x36 + kMudRoom = 0x37 + kMusicRoom = 0x38 + kNursery = 0x39 + kOffice = 0x3A + kOutdoorKitchen = 0x3B + kOutside = 0x3C + kPantry = 0x3D + kParkingLot = 0x3E + kParlor = 0x3F + kPatio = 0x40 + kPlayRoom = 0x41 + kPoolRoom = 0x42 + kPorch = 0x43 + kPrimaryBathroom = 0x44 + kPrimaryBedroom = 0x45 + kRamp = 0x46 + kReceptionRoom = 0x47 + kRecreationRoom = 0x48 + kRestroom = 0x49 + kRoof = 0x4A + kSauna = 0x4B + kScullery = 0x4C + kSewingRoom = 0x4D + kShed = 0x4E + kSideDoor = 0x4F + kSideYard = 0x50 + kSittingRoom = 0x51 + kSnug = 0x52 + kSpa = 0x53 + kStaircase = 0x54 + kSteamRoom = 0x55 + kStorageRoom = 0x56 + kStudio = 0x57 + kStudy = 0x58 + kSunRoom = 0x59 + kSwimmingPool = 0x5A + kTerrace = 0x5B + kUtilityRoom = 0x5C + kWard = 0x5D + kWorkshop = 0x5E + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 95, + + class FloorSurfaceTag(MatterIntEnum): + kCarpet = 0x00 + kCeramic = 0x01 + kConcrete = 0x02 + kCork = 0x03 + kDeepCarpet = 0x04 + kDirt = 0x05 + kEngineeredWood = 0x06 + kGlass = 0x07 + kGrass = 0x08 + kHardwood = 0x09 + kLaminate = 0x0A + kLinoleum = 0x0B + kMat = 0x0C + kMetal = 0x0D + kPlastic = 0x0E + kPolishedConcrete = 0x0F + kRubber = 0x10 + kRug = 0x11 + kSand = 0x12 + kStone = 0x13 + kTatami = 0x14 + kTerrazzo = 0x15 + kTile = 0x16 + kVinyl = 0x17 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 24, + + class LandmarkTag(MatterIntEnum): + kAirConditioner = 0x00 + kAirPurifier = 0x01 + kBackDoor = 0x02 + kBarStool = 0x03 + kBathMat = 0x04 + kBathtub = 0x05 + kBed = 0x06 + kBookshelf = 0x07 + kChair = 0x08 + kChristmasTree = 0x09 + kCoatRack = 0x0A + kCoffeeTable = 0x0B + kCookingRange = 0x0C + kCouch = 0x0D + kCountertop = 0x0E + kCradle = 0x0F + kCrib = 0x10 + kDesk = 0x11 + kDiningTable = 0x12 + kDishwasher = 0x13 + kDoor = 0x14 + kDresser = 0x15 + kLaundryDryer = 0x16 + kFan = 0x17 + kFireplace = 0x18 + kFreezer = 0x19 + kFrontDoor = 0x1A + kHighChair = 0x1B + kKitchenIsland = 0x1C + kLamp = 0x1D + kLitterBox = 0x1E + kMirror = 0x1F + kNightstand = 0x20 + kOven = 0x21 + kPetBed = 0x22 + kPetBowl = 0x23 + kPetCrate = 0x24 + kRefrigerator = 0x25 + kScratchingPost = 0x26 + kShoeRack = 0x27 + kShower = 0x28 + kSideDoor = 0x29 + kSink = 0x2A + kSofa = 0x2B + kStove = 0x2C + kTable = 0x2D + kToilet = 0x2E + kTrashCan = 0x2F + kLaundryWasher = 0x30 + kWindow = 0x31 + kWineCooler = 0x32 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 51, + + class PositionTag(MatterIntEnum): + kLeft = 0x00 + kRight = 0x01 + kTop = 0x02 + kBottom = 0x03 + kMiddle = 0x04 + kRow = 0x05 + kColumn = 0x06 + kUnder = 0x07 + kNextTo = 0x08 + kAround = 0x09 + kOn = 0x0A + kAbove = 0x0B + kFrontOf = 0x0C + kBehind = 0x0D + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving an unknown + # enum value. This specific value should never be transmitted. + kUnknownEnumValue = 14, + class TestGlobalEnum(MatterIntEnum): kSomeValue = 0x00 kSomeOtherValue = 0x01 @@ -54,6 +266,21 @@ class TestGlobalBitmap(IntFlag): kSecondBit = 0x2 class Structs: + @dataclass + class LocationDescriptorStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), + ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, Globals.Enums.AreaTypeTag]), + ]) + + locationName: 'str' = "" + floorNumber: 'typing.Union[Nullable, int]' = NullValue + areaType: 'typing.Union[Nullable, Globals.Enums.AreaTypeTag]' = NullValue + @dataclass class TestGlobalStruct(ClusterObject): @ChipUtility.classproperty @@ -30914,197 +31141,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: clusterRevision: 'uint' = None class Enums: - class AreaTypeTag(MatterIntEnum): - kAisle = 0x00 - kAttic = 0x01 - kBackDoor = 0x02 - kBackYard = 0x03 - kBalcony = 0x04 - kBallroom = 0x05 - kBathroom = 0x06 - kBedroom = 0x07 - kBorder = 0x08 - kBoxroom = 0x09 - kBreakfastRoom = 0x0A - kCarport = 0x0B - kCellar = 0x0C - kCloakroom = 0x0D - kCloset = 0x0E - kConservatory = 0x0F - kCorridor = 0x10 - kCraftRoom = 0x11 - kCupboard = 0x12 - kDeck = 0x13 - kDen = 0x14 - kDining = 0x15 - kDrawingRoom = 0x16 - kDressingRoom = 0x17 - kDriveway = 0x18 - kElevator = 0x19 - kEnsuite = 0x1A - kEntrance = 0x1B - kEntryway = 0x1C - kFamilyRoom = 0x1D - kFoyer = 0x1E - kFrontDoor = 0x1F - kFrontYard = 0x20 - kGameRoom = 0x21 - kGarage = 0x22 - kGarageDoor = 0x23 - kGarden = 0x24 - kGardenDoor = 0x25 - kGuestBathroom = 0x26 - kGuestBedroom = 0x27 - kGuestRestroom = 0x28 - kGuestRoom = 0x29 - kGym = 0x2A - kHallway = 0x2B - kHearthRoom = 0x2C - kKidsRoom = 0x2D - kKidsBedroom = 0x2E - kKitchen = 0x2F - kLarder = 0x30 - kLaundryRoom = 0x31 - kLawn = 0x32 - kLibrary = 0x33 - kLivingRoom = 0x34 - kLounge = 0x35 - kMediaTvRoom = 0x36 - kMudRoom = 0x37 - kMusicRoom = 0x38 - kNursery = 0x39 - kOffice = 0x3A - kOutdoorKitchen = 0x3B - kOutside = 0x3C - kPantry = 0x3D - kParkingLot = 0x3E - kParlor = 0x3F - kPatio = 0x40 - kPlayRoom = 0x41 - kPoolRoom = 0x42 - kPorch = 0x43 - kPrimaryBathroom = 0x44 - kPrimaryBedroom = 0x45 - kRamp = 0x46 - kReceptionRoom = 0x47 - kRecreationRoom = 0x48 - kRestroom = 0x49 - kRoof = 0x4A - kSauna = 0x4B - kScullery = 0x4C - kSewingRoom = 0x4D - kShed = 0x4E - kSideDoor = 0x4F - kSideYard = 0x50 - kSittingRoom = 0x51 - kSnug = 0x52 - kSpa = 0x53 - kStaircase = 0x54 - kSteamRoom = 0x55 - kStorageRoom = 0x56 - kStudio = 0x57 - kStudy = 0x58 - kSunRoom = 0x59 - kSwimmingPool = 0x5A - kTerrace = 0x5B - kUtilityRoom = 0x5C - kWard = 0x5D - kWorkshop = 0x5E - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 95, - - class FloorSurfaceTag(MatterIntEnum): - kCarpet = 0x00 - kCeramic = 0x01 - kConcrete = 0x02 - kCork = 0x03 - kDeepCarpet = 0x04 - kDirt = 0x05 - kEngineeredWood = 0x06 - kGlass = 0x07 - kGrass = 0x08 - kHardwood = 0x09 - kLaminate = 0x0A - kLinoleum = 0x0B - kMat = 0x0C - kMetal = 0x0D - kPlastic = 0x0E - kPolishedConcrete = 0x0F - kRubber = 0x10 - kRug = 0x11 - kSand = 0x12 - kStone = 0x13 - kTatami = 0x14 - kTerrazzo = 0x15 - kTile = 0x16 - kVinyl = 0x17 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 24, - - class LandmarkTag(MatterIntEnum): - kAirConditioner = 0x00 - kAirPurifier = 0x01 - kBackDoor = 0x02 - kBarStool = 0x03 - kBathMat = 0x04 - kBathtub = 0x05 - kBed = 0x06 - kBookshelf = 0x07 - kChair = 0x08 - kChristmasTree = 0x09 - kCoatRack = 0x0A - kCoffeeTable = 0x0B - kCookingRange = 0x0C - kCouch = 0x0D - kCountertop = 0x0E - kCradle = 0x0F - kCrib = 0x10 - kDesk = 0x11 - kDiningTable = 0x12 - kDishwasher = 0x13 - kDoor = 0x14 - kDresser = 0x15 - kLaundryDryer = 0x16 - kFan = 0x17 - kFireplace = 0x18 - kFreezer = 0x19 - kFrontDoor = 0x1A - kHighChair = 0x1B - kKitchenIsland = 0x1C - kLamp = 0x1D - kLitterBox = 0x1E - kMirror = 0x1F - kNightstand = 0x20 - kOven = 0x21 - kPetBed = 0x22 - kPetBowl = 0x23 - kPetCrate = 0x24 - kRefrigerator = 0x25 - kScratchingPost = 0x26 - kShoeRack = 0x27 - kShower = 0x28 - kSideDoor = 0x29 - kSink = 0x2A - kSofa = 0x2B - kStove = 0x2C - kTable = 0x2D - kToilet = 0x2E - kTrashCan = 0x2F - kLaundryWasher = 0x30 - kWindow = 0x31 - kWineCooler = 0x32 - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 51, - class OperationalStatusEnum(MatterIntEnum): kPending = 0x00 kOperating = 0x01 @@ -31116,27 +31152,6 @@ class OperationalStatusEnum(MatterIntEnum): # enum value. This specific value should never be transmitted. kUnknownEnumValue = 4, - class PositionTag(MatterIntEnum): - kLeft = 0x00 - kRight = 0x01 - kTop = 0x02 - kBottom = 0x03 - kMiddle = 0x04 - kRow = 0x05 - kColumn = 0x06 - kUnder = 0x07 - kNextTo = 0x08 - kAround = 0x09 - kOn = 0x0A - kAbove = 0x0B - kFrontOf = 0x0C - kBehind = 0x0D - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 14, - class SelectLocationsStatus(MatterIntEnum): kSuccess = 0x00 kUnsupportedLocation = 0x01 @@ -31165,37 +31180,22 @@ class Feature(IntFlag): kSelectWhileRunning = 0x2 class Structs: - @dataclass - class LocationDescriptorStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), - ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, ServiceArea.Enums.AreaTypeTag]), - ]) - - locationName: 'str' = "" - floorNumber: 'typing.Union[Nullable, int]' = NullValue - areaType: 'typing.Union[Nullable, ServiceArea.Enums.AreaTypeTag]' = NullValue - @dataclass class LocationInfoStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="locationInfo", Tag=0, Type=typing.Union[Nullable, ServiceArea.Structs.LocationDescriptorStruct]), - ClusterObjectFieldDescriptor(Label="landmarkTag", Tag=1, Type=typing.Union[Nullable, ServiceArea.Enums.LandmarkTag]), - ClusterObjectFieldDescriptor(Label="positionTag", Tag=2, Type=typing.Union[Nullable, ServiceArea.Enums.PositionTag]), - ClusterObjectFieldDescriptor(Label="surfaceTag", Tag=3, Type=typing.Union[Nullable, ServiceArea.Enums.FloorSurfaceTag]), + ClusterObjectFieldDescriptor(Label="locationInfo", Tag=0, Type=typing.Union[Nullable, Globals.Structs.LocationDescriptorStruct]), + ClusterObjectFieldDescriptor(Label="landmarkTag", Tag=1, Type=typing.Union[Nullable, Globals.Enums.LandmarkTag]), + ClusterObjectFieldDescriptor(Label="positionTag", Tag=2, Type=typing.Union[Nullable, Globals.Enums.PositionTag]), + ClusterObjectFieldDescriptor(Label="surfaceTag", Tag=3, Type=typing.Union[Nullable, Globals.Enums.FloorSurfaceTag]), ]) - locationInfo: 'typing.Union[Nullable, ServiceArea.Structs.LocationDescriptorStruct]' = NullValue - landmarkTag: 'typing.Union[Nullable, ServiceArea.Enums.LandmarkTag]' = NullValue - positionTag: 'typing.Union[Nullable, ServiceArea.Enums.PositionTag]' = NullValue - surfaceTag: 'typing.Union[Nullable, ServiceArea.Enums.FloorSurfaceTag]' = NullValue + locationInfo: 'typing.Union[Nullable, Globals.Structs.LocationDescriptorStruct]' = NullValue + landmarkTag: 'typing.Union[Nullable, Globals.Enums.LandmarkTag]' = NullValue + positionTag: 'typing.Union[Nullable, Globals.Enums.PositionTag]' = NullValue + surfaceTag: 'typing.Union[Nullable, Globals.Enums.FloorSurfaceTag]' = NullValue @dataclass class LocationStruct(ClusterObject): @@ -46981,142 +46981,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: featureMap: 'uint' = None clusterRevision: 'uint' = None - class Enums: - class AreaTypeTag(MatterIntEnum): - kAisle = 0x00 - kAttic = 0x01 - kBackDoor = 0x02 - kBackYard = 0x03 - kBalcony = 0x04 - kBallroom = 0x05 - kBathroom = 0x06 - kBedroom = 0x07 - kBorder = 0x08 - kBoxroom = 0x09 - kBreakfastRoom = 0x0A - kCarport = 0x0B - kCellar = 0x0C - kCloakroom = 0x0D - kCloset = 0x0E - kConservatory = 0x0F - kCorridor = 0x10 - kCraftRoom = 0x11 - kCupboard = 0x12 - kDeck = 0x13 - kDen = 0x14 - kDining = 0x15 - kDrawingRoom = 0x16 - kDressingRoom = 0x17 - kDriveway = 0x18 - kElevator = 0x19 - kEnsuite = 0x1A - kEntrance = 0x1B - kEntryway = 0x1C - kFamilyRoom = 0x1D - kFoyer = 0x1E - kFrontDoor = 0x1F - kFrontYard = 0x20 - kGameRoom = 0x21 - kGarage = 0x22 - kGarageDoor = 0x23 - kGarden = 0x24 - kGardenDoor = 0x25 - kGuestBathroom = 0x26 - kGuestBedroom = 0x27 - kGuestRestroom = 0x28 - kGuestRoom = 0x29 - kGym = 0x2A - kHallway = 0x2B - kHearthRoom = 0x2C - kKidsRoom = 0x2D - kKidsBedroom = 0x2E - kKitchen = 0x2F - kLarder = 0x30 - kLaundryRoom = 0x31 - kLawn = 0x32 - kLibrary = 0x33 - kLivingRoom = 0x34 - kLounge = 0x35 - kMediaTvRoom = 0x36 - kMudRoom = 0x37 - kMusicRoom = 0x38 - kNursery = 0x39 - kOffice = 0x3A - kOutdoorKitchen = 0x3B - kOutside = 0x3C - kPantry = 0x3D - kParkingLot = 0x3E - kParlor = 0x3F - kPatio = 0x40 - kPlayRoom = 0x41 - kPoolRoom = 0x42 - kPorch = 0x43 - kPrimaryBathroom = 0x44 - kPrimaryBedroom = 0x45 - kRamp = 0x46 - kReceptionRoom = 0x47 - kRecreationRoom = 0x48 - kRestroom = 0x49 - kRoof = 0x4A - kSauna = 0x4B - kScullery = 0x4C - kSewingRoom = 0x4D - kShed = 0x4E - kSideDoor = 0x4F - kSideYard = 0x50 - kSittingRoom = 0x51 - kSnug = 0x52 - kSpa = 0x53 - kStaircase = 0x54 - kSteamRoom = 0x55 - kStorageRoom = 0x56 - kStudio = 0x57 - kStudy = 0x58 - kSunRoom = 0x59 - kSwimmingPool = 0x5A - kTerrace = 0x5B - kUtilityRoom = 0x5C - kWard = 0x5D - kWorkshop = 0x5E - # All received enum values that are not listed above will be mapped - # to kUnknownEnumValue. This is a helper enum value that should only - # be used by code to process how it handles receiving an unknown - # enum value. This specific value should never be transmitted. - kUnknownEnumValue = 95, - class Structs: - @dataclass - class LocationDescriptorStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), - ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, EcosystemInformation.Enums.AreaTypeTag]), - ]) - - locationName: 'str' = "" - floorNumber: 'typing.Union[Nullable, int]' = NullValue - areaType: 'typing.Union[Nullable, EcosystemInformation.Enums.AreaTypeTag]' = NullValue - - @dataclass - class EcosystemLocationStruct(ClusterObject): - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="uniqueLocationID", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="locationDescriptor", Tag=1, Type=EcosystemInformation.Structs.LocationDescriptorStruct), - ClusterObjectFieldDescriptor(Label="locationDescriptorLastEdit", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), - ]) - - uniqueLocationID: 'str' = "" - locationDescriptor: 'EcosystemInformation.Structs.LocationDescriptorStruct' = field(default_factory=lambda: EcosystemInformation.Structs.LocationDescriptorStruct()) - locationDescriptorLastEdit: 'uint' = 0 - fabricIndex: 'uint' = 0 - @dataclass class DeviceTypeStruct(ClusterObject): @ChipUtility.classproperty @@ -47155,6 +47020,23 @@ def descriptor(cls) -> ClusterObjectDescriptor: uniqueLocationIDsLastEdit: 'uint' = 0 fabricIndex: 'uint' = 0 + @dataclass + class EcosystemLocationStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="uniqueLocationID", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="locationDescriptor", Tag=1, Type=Globals.Structs.LocationDescriptorStruct), + ClusterObjectFieldDescriptor(Label="locationDescriptorLastEdit", Tag=2, Type=uint), + ClusterObjectFieldDescriptor(Label="fabricIndex", Tag=254, Type=uint), + ]) + + uniqueLocationID: 'str' = "" + locationDescriptor: 'Globals.Structs.LocationDescriptorStruct' = field(default_factory=lambda: EcosystemInformation.Structs.LocationDescriptorStruct()) + locationDescriptorLastEdit: 'uint' = 0 + fabricIndex: 'uint' = 0 + class Attributes: @dataclass class RemovedOn(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index c6d743173044cd..6e9fa8aa333a59 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -11201,7 +11201,7 @@ static id _Nullable DecodeAttributeValueForServiceAreaCluster(AttributeId aAttri if (entry_0.locationInfo.locationInfo.IsNull()) { newElement_0.locationInfo.locationInfo = nil; } else { - newElement_0.locationInfo.locationInfo = [MTRServiceAreaClusterLocationDescriptorStruct new]; + newElement_0.locationInfo.locationInfo = [MTRDataTypeLocationDescriptorStruct new]; newElement_0.locationInfo.locationInfo.locationName = AsString(entry_0.locationInfo.locationInfo.Value().locationName); if (newElement_0.locationInfo.locationInfo.locationName == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; @@ -17321,7 +17321,7 @@ static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(Attribute *aError = err; return nil; } - newElement_0.locationDescriptor = [MTREcosystemInformationClusterLocationDescriptorStruct new]; + newElement_0.locationDescriptor = [MTRDataTypeLocationDescriptorStruct new]; newElement_0.locationDescriptor.locationName = AsString(entry_0.locationDescriptor.locationName); if (newElement_0.locationDescriptor.locationName == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 0f17934d1ee74f..b151fcea89b3cc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -17210,6 +17210,202 @@ MTR_DEPRECATED("Please use MTRBaseClusterUnitTesting", ios(16.1, 16.4), macos(13 @interface MTRBaseClusterTestCluster : MTRBaseClusterUnitTesting @end +typedef NS_ENUM(uint8_t, MTRDataTypeAreaTypeTag) { + MTRDataTypeAreaTypeTagAisle MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRDataTypeAreaTypeTagAttic MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRDataTypeAreaTypeTagBackDoor MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRDataTypeAreaTypeTagBackYard MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRDataTypeAreaTypeTagBalcony MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRDataTypeAreaTypeTagBallroom MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRDataTypeAreaTypeTagBathroom MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRDataTypeAreaTypeTagBedroom MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRDataTypeAreaTypeTagBorder MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRDataTypeAreaTypeTagBoxroom MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRDataTypeAreaTypeTagBreakfastRoom MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRDataTypeAreaTypeTagCarport MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTRDataTypeAreaTypeTagCellar MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTRDataTypeAreaTypeTagCloakroom MTR_PROVISIONALLY_AVAILABLE = 0x0D, + MTRDataTypeAreaTypeTagCloset MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTRDataTypeAreaTypeTagConservatory MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTRDataTypeAreaTypeTagCorridor MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRDataTypeAreaTypeTagCraftRoom MTR_PROVISIONALLY_AVAILABLE = 0x11, + MTRDataTypeAreaTypeTagCupboard MTR_PROVISIONALLY_AVAILABLE = 0x12, + MTRDataTypeAreaTypeTagDeck MTR_PROVISIONALLY_AVAILABLE = 0x13, + MTRDataTypeAreaTypeTagDen MTR_PROVISIONALLY_AVAILABLE = 0x14, + MTRDataTypeAreaTypeTagDining MTR_PROVISIONALLY_AVAILABLE = 0x15, + MTRDataTypeAreaTypeTagDrawingRoom MTR_PROVISIONALLY_AVAILABLE = 0x16, + MTRDataTypeAreaTypeTagDressingRoom MTR_PROVISIONALLY_AVAILABLE = 0x17, + MTRDataTypeAreaTypeTagDriveway MTR_PROVISIONALLY_AVAILABLE = 0x18, + MTRDataTypeAreaTypeTagElevator MTR_PROVISIONALLY_AVAILABLE = 0x19, + MTRDataTypeAreaTypeTagEnsuite MTR_PROVISIONALLY_AVAILABLE = 0x1A, + MTRDataTypeAreaTypeTagEntrance MTR_PROVISIONALLY_AVAILABLE = 0x1B, + MTRDataTypeAreaTypeTagEntryway MTR_PROVISIONALLY_AVAILABLE = 0x1C, + MTRDataTypeAreaTypeTagFamilyRoom MTR_PROVISIONALLY_AVAILABLE = 0x1D, + MTRDataTypeAreaTypeTagFoyer MTR_PROVISIONALLY_AVAILABLE = 0x1E, + MTRDataTypeAreaTypeTagFrontDoor MTR_PROVISIONALLY_AVAILABLE = 0x1F, + MTRDataTypeAreaTypeTagFrontYard MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTRDataTypeAreaTypeTagGameRoom MTR_PROVISIONALLY_AVAILABLE = 0x21, + MTRDataTypeAreaTypeTagGarage MTR_PROVISIONALLY_AVAILABLE = 0x22, + MTRDataTypeAreaTypeTagGarageDoor MTR_PROVISIONALLY_AVAILABLE = 0x23, + MTRDataTypeAreaTypeTagGarden MTR_PROVISIONALLY_AVAILABLE = 0x24, + MTRDataTypeAreaTypeTagGardenDoor MTR_PROVISIONALLY_AVAILABLE = 0x25, + MTRDataTypeAreaTypeTagGuestBathroom MTR_PROVISIONALLY_AVAILABLE = 0x26, + MTRDataTypeAreaTypeTagGuestBedroom MTR_PROVISIONALLY_AVAILABLE = 0x27, + MTRDataTypeAreaTypeTagGuestRestroom MTR_PROVISIONALLY_AVAILABLE = 0x28, + MTRDataTypeAreaTypeTagGuestRoom MTR_PROVISIONALLY_AVAILABLE = 0x29, + MTRDataTypeAreaTypeTagGym MTR_PROVISIONALLY_AVAILABLE = 0x2A, + MTRDataTypeAreaTypeTagHallway MTR_PROVISIONALLY_AVAILABLE = 0x2B, + MTRDataTypeAreaTypeTagHearthRoom MTR_PROVISIONALLY_AVAILABLE = 0x2C, + MTRDataTypeAreaTypeTagKidsRoom MTR_PROVISIONALLY_AVAILABLE = 0x2D, + MTRDataTypeAreaTypeTagKidsBedroom MTR_PROVISIONALLY_AVAILABLE = 0x2E, + MTRDataTypeAreaTypeTagKitchen MTR_PROVISIONALLY_AVAILABLE = 0x2F, + MTRDataTypeAreaTypeTagLarder MTR_PROVISIONALLY_AVAILABLE = 0x30, + MTRDataTypeAreaTypeTagLaundryRoom MTR_PROVISIONALLY_AVAILABLE = 0x31, + MTRDataTypeAreaTypeTagLawn MTR_PROVISIONALLY_AVAILABLE = 0x32, + MTRDataTypeAreaTypeTagLibrary MTR_PROVISIONALLY_AVAILABLE = 0x33, + MTRDataTypeAreaTypeTagLivingRoom MTR_PROVISIONALLY_AVAILABLE = 0x34, + MTRDataTypeAreaTypeTagLounge MTR_PROVISIONALLY_AVAILABLE = 0x35, + MTRDataTypeAreaTypeTagMediaTVRoom MTR_PROVISIONALLY_AVAILABLE = 0x36, + MTRDataTypeAreaTypeTagMudRoom MTR_PROVISIONALLY_AVAILABLE = 0x37, + MTRDataTypeAreaTypeTagMusicRoom MTR_PROVISIONALLY_AVAILABLE = 0x38, + MTRDataTypeAreaTypeTagNursery MTR_PROVISIONALLY_AVAILABLE = 0x39, + MTRDataTypeAreaTypeTagOffice MTR_PROVISIONALLY_AVAILABLE = 0x3A, + MTRDataTypeAreaTypeTagOutdoorKitchen MTR_PROVISIONALLY_AVAILABLE = 0x3B, + MTRDataTypeAreaTypeTagOutside MTR_PROVISIONALLY_AVAILABLE = 0x3C, + MTRDataTypeAreaTypeTagPantry MTR_PROVISIONALLY_AVAILABLE = 0x3D, + MTRDataTypeAreaTypeTagParkingLot MTR_PROVISIONALLY_AVAILABLE = 0x3E, + MTRDataTypeAreaTypeTagParlor MTR_PROVISIONALLY_AVAILABLE = 0x3F, + MTRDataTypeAreaTypeTagPatio MTR_PROVISIONALLY_AVAILABLE = 0x40, + MTRDataTypeAreaTypeTagPlayRoom MTR_PROVISIONALLY_AVAILABLE = 0x41, + MTRDataTypeAreaTypeTagPoolRoom MTR_PROVISIONALLY_AVAILABLE = 0x42, + MTRDataTypeAreaTypeTagPorch MTR_PROVISIONALLY_AVAILABLE = 0x43, + MTRDataTypeAreaTypeTagPrimaryBathroom MTR_PROVISIONALLY_AVAILABLE = 0x44, + MTRDataTypeAreaTypeTagPrimaryBedroom MTR_PROVISIONALLY_AVAILABLE = 0x45, + MTRDataTypeAreaTypeTagRamp MTR_PROVISIONALLY_AVAILABLE = 0x46, + MTRDataTypeAreaTypeTagReceptionRoom MTR_PROVISIONALLY_AVAILABLE = 0x47, + MTRDataTypeAreaTypeTagRecreationRoom MTR_PROVISIONALLY_AVAILABLE = 0x48, + MTRDataTypeAreaTypeTagRestroom MTR_PROVISIONALLY_AVAILABLE = 0x49, + MTRDataTypeAreaTypeTagRoof MTR_PROVISIONALLY_AVAILABLE = 0x4A, + MTRDataTypeAreaTypeTagSauna MTR_PROVISIONALLY_AVAILABLE = 0x4B, + MTRDataTypeAreaTypeTagScullery MTR_PROVISIONALLY_AVAILABLE = 0x4C, + MTRDataTypeAreaTypeTagSewingRoom MTR_PROVISIONALLY_AVAILABLE = 0x4D, + MTRDataTypeAreaTypeTagShed MTR_PROVISIONALLY_AVAILABLE = 0x4E, + MTRDataTypeAreaTypeTagSideDoor MTR_PROVISIONALLY_AVAILABLE = 0x4F, + MTRDataTypeAreaTypeTagSideYard MTR_PROVISIONALLY_AVAILABLE = 0x50, + MTRDataTypeAreaTypeTagSittingRoom MTR_PROVISIONALLY_AVAILABLE = 0x51, + MTRDataTypeAreaTypeTagSnug MTR_PROVISIONALLY_AVAILABLE = 0x52, + MTRDataTypeAreaTypeTagSpa MTR_PROVISIONALLY_AVAILABLE = 0x53, + MTRDataTypeAreaTypeTagStaircase MTR_PROVISIONALLY_AVAILABLE = 0x54, + MTRDataTypeAreaTypeTagSteamRoom MTR_PROVISIONALLY_AVAILABLE = 0x55, + MTRDataTypeAreaTypeTagStorageRoom MTR_PROVISIONALLY_AVAILABLE = 0x56, + MTRDataTypeAreaTypeTagStudio MTR_PROVISIONALLY_AVAILABLE = 0x57, + MTRDataTypeAreaTypeTagStudy MTR_PROVISIONALLY_AVAILABLE = 0x58, + MTRDataTypeAreaTypeTagSunRoom MTR_PROVISIONALLY_AVAILABLE = 0x59, + MTRDataTypeAreaTypeTagSwimmingPool MTR_PROVISIONALLY_AVAILABLE = 0x5A, + MTRDataTypeAreaTypeTagTerrace MTR_PROVISIONALLY_AVAILABLE = 0x5B, + MTRDataTypeAreaTypeTagUtilityRoom MTR_PROVISIONALLY_AVAILABLE = 0x5C, + MTRDataTypeAreaTypeTagWard MTR_PROVISIONALLY_AVAILABLE = 0x5D, + MTRDataTypeAreaTypeTagWorkshop MTR_PROVISIONALLY_AVAILABLE = 0x5E, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRDataTypeFloorSurfaceTag) { + MTRDataTypeFloorSurfaceTagCarpet MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRDataTypeFloorSurfaceTagCeramic MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRDataTypeFloorSurfaceTagConcrete MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRDataTypeFloorSurfaceTagCork MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRDataTypeFloorSurfaceTagDeepCarpet MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRDataTypeFloorSurfaceTagDirt MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRDataTypeFloorSurfaceTagEngineeredWood MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRDataTypeFloorSurfaceTagGlass MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRDataTypeFloorSurfaceTagGrass MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRDataTypeFloorSurfaceTagHardwood MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRDataTypeFloorSurfaceTagLaminate MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRDataTypeFloorSurfaceTagLinoleum MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTRDataTypeFloorSurfaceTagMat MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTRDataTypeFloorSurfaceTagMetal MTR_PROVISIONALLY_AVAILABLE = 0x0D, + MTRDataTypeFloorSurfaceTagPlastic MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTRDataTypeFloorSurfaceTagPolishedConcrete MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTRDataTypeFloorSurfaceTagRubber MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRDataTypeFloorSurfaceTagRug MTR_PROVISIONALLY_AVAILABLE = 0x11, + MTRDataTypeFloorSurfaceTagSand MTR_PROVISIONALLY_AVAILABLE = 0x12, + MTRDataTypeFloorSurfaceTagStone MTR_PROVISIONALLY_AVAILABLE = 0x13, + MTRDataTypeFloorSurfaceTagTatami MTR_PROVISIONALLY_AVAILABLE = 0x14, + MTRDataTypeFloorSurfaceTagTerrazzo MTR_PROVISIONALLY_AVAILABLE = 0x15, + MTRDataTypeFloorSurfaceTagTile MTR_PROVISIONALLY_AVAILABLE = 0x16, + MTRDataTypeFloorSurfaceTagVinyl MTR_PROVISIONALLY_AVAILABLE = 0x17, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRDataTypeLandmarkTag) { + MTRDataTypeLandmarkTagAirConditioner MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRDataTypeLandmarkTagAirPurifier MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRDataTypeLandmarkTagBackDoor MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRDataTypeLandmarkTagBarStool MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRDataTypeLandmarkTagBathMat MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRDataTypeLandmarkTagBathtub MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRDataTypeLandmarkTagBed MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRDataTypeLandmarkTagBookshelf MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRDataTypeLandmarkTagChair MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRDataTypeLandmarkTagChristmasTree MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRDataTypeLandmarkTagCoatRack MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRDataTypeLandmarkTagCoffeeTable MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTRDataTypeLandmarkTagCookingRange MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTRDataTypeLandmarkTagCouch MTR_PROVISIONALLY_AVAILABLE = 0x0D, + MTRDataTypeLandmarkTagCountertop MTR_PROVISIONALLY_AVAILABLE = 0x0E, + MTRDataTypeLandmarkTagCradle MTR_PROVISIONALLY_AVAILABLE = 0x0F, + MTRDataTypeLandmarkTagCrib MTR_PROVISIONALLY_AVAILABLE = 0x10, + MTRDataTypeLandmarkTagDesk MTR_PROVISIONALLY_AVAILABLE = 0x11, + MTRDataTypeLandmarkTagDiningTable MTR_PROVISIONALLY_AVAILABLE = 0x12, + MTRDataTypeLandmarkTagDishwasher MTR_PROVISIONALLY_AVAILABLE = 0x13, + MTRDataTypeLandmarkTagDoor MTR_PROVISIONALLY_AVAILABLE = 0x14, + MTRDataTypeLandmarkTagDresser MTR_PROVISIONALLY_AVAILABLE = 0x15, + MTRDataTypeLandmarkTagLaundryDryer MTR_PROVISIONALLY_AVAILABLE = 0x16, + MTRDataTypeLandmarkTagFan MTR_PROVISIONALLY_AVAILABLE = 0x17, + MTRDataTypeLandmarkTagFireplace MTR_PROVISIONALLY_AVAILABLE = 0x18, + MTRDataTypeLandmarkTagFreezer MTR_PROVISIONALLY_AVAILABLE = 0x19, + MTRDataTypeLandmarkTagFrontDoor MTR_PROVISIONALLY_AVAILABLE = 0x1A, + MTRDataTypeLandmarkTagHighChair MTR_PROVISIONALLY_AVAILABLE = 0x1B, + MTRDataTypeLandmarkTagKitchenIsland MTR_PROVISIONALLY_AVAILABLE = 0x1C, + MTRDataTypeLandmarkTagLamp MTR_PROVISIONALLY_AVAILABLE = 0x1D, + MTRDataTypeLandmarkTagLitterBox MTR_PROVISIONALLY_AVAILABLE = 0x1E, + MTRDataTypeLandmarkTagMirror MTR_PROVISIONALLY_AVAILABLE = 0x1F, + MTRDataTypeLandmarkTagNightstand MTR_PROVISIONALLY_AVAILABLE = 0x20, + MTRDataTypeLandmarkTagOven MTR_PROVISIONALLY_AVAILABLE = 0x21, + MTRDataTypeLandmarkTagPetBed MTR_PROVISIONALLY_AVAILABLE = 0x22, + MTRDataTypeLandmarkTagPetBowl MTR_PROVISIONALLY_AVAILABLE = 0x23, + MTRDataTypeLandmarkTagPetCrate MTR_PROVISIONALLY_AVAILABLE = 0x24, + MTRDataTypeLandmarkTagRefrigerator MTR_PROVISIONALLY_AVAILABLE = 0x25, + MTRDataTypeLandmarkTagScratchingPost MTR_PROVISIONALLY_AVAILABLE = 0x26, + MTRDataTypeLandmarkTagShoeRack MTR_PROVISIONALLY_AVAILABLE = 0x27, + MTRDataTypeLandmarkTagShower MTR_PROVISIONALLY_AVAILABLE = 0x28, + MTRDataTypeLandmarkTagSideDoor MTR_PROVISIONALLY_AVAILABLE = 0x29, + MTRDataTypeLandmarkTagSink MTR_PROVISIONALLY_AVAILABLE = 0x2A, + MTRDataTypeLandmarkTagSofa MTR_PROVISIONALLY_AVAILABLE = 0x2B, + MTRDataTypeLandmarkTagStove MTR_PROVISIONALLY_AVAILABLE = 0x2C, + MTRDataTypeLandmarkTagTable MTR_PROVISIONALLY_AVAILABLE = 0x2D, + MTRDataTypeLandmarkTagToilet MTR_PROVISIONALLY_AVAILABLE = 0x2E, + MTRDataTypeLandmarkTagTrashCan MTR_PROVISIONALLY_AVAILABLE = 0x2F, + MTRDataTypeLandmarkTagLaundryWasher MTR_PROVISIONALLY_AVAILABLE = 0x30, + MTRDataTypeLandmarkTagWindow MTR_PROVISIONALLY_AVAILABLE = 0x31, + MTRDataTypeLandmarkTagWineCooler MTR_PROVISIONALLY_AVAILABLE = 0x32, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_ENUM(uint8_t, MTRDataTypePositionTag) { + MTRDataTypePositionTagLeft MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRDataTypePositionTagRight MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRDataTypePositionTagTop MTR_PROVISIONALLY_AVAILABLE = 0x02, + MTRDataTypePositionTagBottom MTR_PROVISIONALLY_AVAILABLE = 0x03, + MTRDataTypePositionTagMiddle MTR_PROVISIONALLY_AVAILABLE = 0x04, + MTRDataTypePositionTagRow MTR_PROVISIONALLY_AVAILABLE = 0x05, + MTRDataTypePositionTagColumn MTR_PROVISIONALLY_AVAILABLE = 0x06, + MTRDataTypePositionTagUnder MTR_PROVISIONALLY_AVAILABLE = 0x07, + MTRDataTypePositionTagNextTo MTR_PROVISIONALLY_AVAILABLE = 0x08, + MTRDataTypePositionTagAround MTR_PROVISIONALLY_AVAILABLE = 0x09, + MTRDataTypePositionTagOn MTR_PROVISIONALLY_AVAILABLE = 0x0A, + MTRDataTypePositionTagAbove MTR_PROVISIONALLY_AVAILABLE = 0x0B, + MTRDataTypePositionTagFrontOf MTR_PROVISIONALLY_AVAILABLE = 0x0C, + MTRDataTypePositionTagBehind MTR_PROVISIONALLY_AVAILABLE = 0x0D, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRDataTypeTestGlobalEnum) { MTRDataTypeTestGlobalEnumSomeValue MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRDataTypeTestGlobalEnumSomeOtherValue MTR_PROVISIONALLY_AVAILABLE = 0x01, @@ -19598,185 +19794,6 @@ typedef NS_OPTIONS(uint16_t, MTRBarrierControlSafetyStatus) { MTRBarrierControlSafetyStatusPositionFailure MTR_PROVISIONALLY_AVAILABLE = 0x8, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRServiceAreaAreaTypeTag) { - MTRServiceAreaAreaTypeTagAisle MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRServiceAreaAreaTypeTagAttic MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRServiceAreaAreaTypeTagBackDoor MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRServiceAreaAreaTypeTagBackYard MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRServiceAreaAreaTypeTagBalcony MTR_PROVISIONALLY_AVAILABLE = 0x04, - MTRServiceAreaAreaTypeTagBallroom MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTRServiceAreaAreaTypeTagBathroom MTR_PROVISIONALLY_AVAILABLE = 0x06, - MTRServiceAreaAreaTypeTagBedroom MTR_PROVISIONALLY_AVAILABLE = 0x07, - MTRServiceAreaAreaTypeTagBorder MTR_PROVISIONALLY_AVAILABLE = 0x08, - MTRServiceAreaAreaTypeTagBoxroom MTR_PROVISIONALLY_AVAILABLE = 0x09, - MTRServiceAreaAreaTypeTagBreakfastRoom MTR_PROVISIONALLY_AVAILABLE = 0x0A, - MTRServiceAreaAreaTypeTagCarport MTR_PROVISIONALLY_AVAILABLE = 0x0B, - MTRServiceAreaAreaTypeTagCellar MTR_PROVISIONALLY_AVAILABLE = 0x0C, - MTRServiceAreaAreaTypeTagCloakroom MTR_PROVISIONALLY_AVAILABLE = 0x0D, - MTRServiceAreaAreaTypeTagCloset MTR_PROVISIONALLY_AVAILABLE = 0x0E, - MTRServiceAreaAreaTypeTagConservatory MTR_PROVISIONALLY_AVAILABLE = 0x0F, - MTRServiceAreaAreaTypeTagCorridor MTR_PROVISIONALLY_AVAILABLE = 0x10, - MTRServiceAreaAreaTypeTagCraftRoom MTR_PROVISIONALLY_AVAILABLE = 0x11, - MTRServiceAreaAreaTypeTagCupboard MTR_PROVISIONALLY_AVAILABLE = 0x12, - MTRServiceAreaAreaTypeTagDeck MTR_PROVISIONALLY_AVAILABLE = 0x13, - MTRServiceAreaAreaTypeTagDen MTR_PROVISIONALLY_AVAILABLE = 0x14, - MTRServiceAreaAreaTypeTagDining MTR_PROVISIONALLY_AVAILABLE = 0x15, - MTRServiceAreaAreaTypeTagDrawingRoom MTR_PROVISIONALLY_AVAILABLE = 0x16, - MTRServiceAreaAreaTypeTagDressingRoom MTR_PROVISIONALLY_AVAILABLE = 0x17, - MTRServiceAreaAreaTypeTagDriveway MTR_PROVISIONALLY_AVAILABLE = 0x18, - MTRServiceAreaAreaTypeTagElevator MTR_PROVISIONALLY_AVAILABLE = 0x19, - MTRServiceAreaAreaTypeTagEnsuite MTR_PROVISIONALLY_AVAILABLE = 0x1A, - MTRServiceAreaAreaTypeTagEntrance MTR_PROVISIONALLY_AVAILABLE = 0x1B, - MTRServiceAreaAreaTypeTagEntryway MTR_PROVISIONALLY_AVAILABLE = 0x1C, - MTRServiceAreaAreaTypeTagFamilyRoom MTR_PROVISIONALLY_AVAILABLE = 0x1D, - MTRServiceAreaAreaTypeTagFoyer MTR_PROVISIONALLY_AVAILABLE = 0x1E, - MTRServiceAreaAreaTypeTagFrontDoor MTR_PROVISIONALLY_AVAILABLE = 0x1F, - MTRServiceAreaAreaTypeTagFrontYard MTR_PROVISIONALLY_AVAILABLE = 0x20, - MTRServiceAreaAreaTypeTagGameRoom MTR_PROVISIONALLY_AVAILABLE = 0x21, - MTRServiceAreaAreaTypeTagGarage MTR_PROVISIONALLY_AVAILABLE = 0x22, - MTRServiceAreaAreaTypeTagGarageDoor MTR_PROVISIONALLY_AVAILABLE = 0x23, - MTRServiceAreaAreaTypeTagGarden MTR_PROVISIONALLY_AVAILABLE = 0x24, - MTRServiceAreaAreaTypeTagGardenDoor MTR_PROVISIONALLY_AVAILABLE = 0x25, - MTRServiceAreaAreaTypeTagGuestBathroom MTR_PROVISIONALLY_AVAILABLE = 0x26, - MTRServiceAreaAreaTypeTagGuestBedroom MTR_PROVISIONALLY_AVAILABLE = 0x27, - MTRServiceAreaAreaTypeTagGuestRestroom MTR_PROVISIONALLY_AVAILABLE = 0x28, - MTRServiceAreaAreaTypeTagGuestRoom MTR_PROVISIONALLY_AVAILABLE = 0x29, - MTRServiceAreaAreaTypeTagGym MTR_PROVISIONALLY_AVAILABLE = 0x2A, - MTRServiceAreaAreaTypeTagHallway MTR_PROVISIONALLY_AVAILABLE = 0x2B, - MTRServiceAreaAreaTypeTagHearthRoom MTR_PROVISIONALLY_AVAILABLE = 0x2C, - MTRServiceAreaAreaTypeTagKidsRoom MTR_PROVISIONALLY_AVAILABLE = 0x2D, - MTRServiceAreaAreaTypeTagKidsBedroom MTR_PROVISIONALLY_AVAILABLE = 0x2E, - MTRServiceAreaAreaTypeTagKitchen MTR_PROVISIONALLY_AVAILABLE = 0x2F, - MTRServiceAreaAreaTypeTagLarder MTR_PROVISIONALLY_AVAILABLE = 0x30, - MTRServiceAreaAreaTypeTagLaundryRoom MTR_PROVISIONALLY_AVAILABLE = 0x31, - MTRServiceAreaAreaTypeTagLawn MTR_PROVISIONALLY_AVAILABLE = 0x32, - MTRServiceAreaAreaTypeTagLibrary MTR_PROVISIONALLY_AVAILABLE = 0x33, - MTRServiceAreaAreaTypeTagLivingRoom MTR_PROVISIONALLY_AVAILABLE = 0x34, - MTRServiceAreaAreaTypeTagLounge MTR_PROVISIONALLY_AVAILABLE = 0x35, - MTRServiceAreaAreaTypeTagMediaTVRoom MTR_PROVISIONALLY_AVAILABLE = 0x36, - MTRServiceAreaAreaTypeTagMudRoom MTR_PROVISIONALLY_AVAILABLE = 0x37, - MTRServiceAreaAreaTypeTagMusicRoom MTR_PROVISIONALLY_AVAILABLE = 0x38, - MTRServiceAreaAreaTypeTagNursery MTR_PROVISIONALLY_AVAILABLE = 0x39, - MTRServiceAreaAreaTypeTagOffice MTR_PROVISIONALLY_AVAILABLE = 0x3A, - MTRServiceAreaAreaTypeTagOutdoorKitchen MTR_PROVISIONALLY_AVAILABLE = 0x3B, - MTRServiceAreaAreaTypeTagOutside MTR_PROVISIONALLY_AVAILABLE = 0x3C, - MTRServiceAreaAreaTypeTagPantry MTR_PROVISIONALLY_AVAILABLE = 0x3D, - MTRServiceAreaAreaTypeTagParkingLot MTR_PROVISIONALLY_AVAILABLE = 0x3E, - MTRServiceAreaAreaTypeTagParlor MTR_PROVISIONALLY_AVAILABLE = 0x3F, - MTRServiceAreaAreaTypeTagPatio MTR_PROVISIONALLY_AVAILABLE = 0x40, - MTRServiceAreaAreaTypeTagPlayRoom MTR_PROVISIONALLY_AVAILABLE = 0x41, - MTRServiceAreaAreaTypeTagPoolRoom MTR_PROVISIONALLY_AVAILABLE = 0x42, - MTRServiceAreaAreaTypeTagPorch MTR_PROVISIONALLY_AVAILABLE = 0x43, - MTRServiceAreaAreaTypeTagPrimaryBathroom MTR_PROVISIONALLY_AVAILABLE = 0x44, - MTRServiceAreaAreaTypeTagPrimaryBedroom MTR_PROVISIONALLY_AVAILABLE = 0x45, - MTRServiceAreaAreaTypeTagRamp MTR_PROVISIONALLY_AVAILABLE = 0x46, - MTRServiceAreaAreaTypeTagReceptionRoom MTR_PROVISIONALLY_AVAILABLE = 0x47, - MTRServiceAreaAreaTypeTagRecreationRoom MTR_PROVISIONALLY_AVAILABLE = 0x48, - MTRServiceAreaAreaTypeTagRestroom MTR_PROVISIONALLY_AVAILABLE = 0x49, - MTRServiceAreaAreaTypeTagRoof MTR_PROVISIONALLY_AVAILABLE = 0x4A, - MTRServiceAreaAreaTypeTagSauna MTR_PROVISIONALLY_AVAILABLE = 0x4B, - MTRServiceAreaAreaTypeTagScullery MTR_PROVISIONALLY_AVAILABLE = 0x4C, - MTRServiceAreaAreaTypeTagSewingRoom MTR_PROVISIONALLY_AVAILABLE = 0x4D, - MTRServiceAreaAreaTypeTagShed MTR_PROVISIONALLY_AVAILABLE = 0x4E, - MTRServiceAreaAreaTypeTagSideDoor MTR_PROVISIONALLY_AVAILABLE = 0x4F, - MTRServiceAreaAreaTypeTagSideYard MTR_PROVISIONALLY_AVAILABLE = 0x50, - MTRServiceAreaAreaTypeTagSittingRoom MTR_PROVISIONALLY_AVAILABLE = 0x51, - MTRServiceAreaAreaTypeTagSnug MTR_PROVISIONALLY_AVAILABLE = 0x52, - MTRServiceAreaAreaTypeTagSpa MTR_PROVISIONALLY_AVAILABLE = 0x53, - MTRServiceAreaAreaTypeTagStaircase MTR_PROVISIONALLY_AVAILABLE = 0x54, - MTRServiceAreaAreaTypeTagSteamRoom MTR_PROVISIONALLY_AVAILABLE = 0x55, - MTRServiceAreaAreaTypeTagStorageRoom MTR_PROVISIONALLY_AVAILABLE = 0x56, - MTRServiceAreaAreaTypeTagStudio MTR_PROVISIONALLY_AVAILABLE = 0x57, - MTRServiceAreaAreaTypeTagStudy MTR_PROVISIONALLY_AVAILABLE = 0x58, - MTRServiceAreaAreaTypeTagSunRoom MTR_PROVISIONALLY_AVAILABLE = 0x59, - MTRServiceAreaAreaTypeTagSwimmingPool MTR_PROVISIONALLY_AVAILABLE = 0x5A, - MTRServiceAreaAreaTypeTagTerrace MTR_PROVISIONALLY_AVAILABLE = 0x5B, - MTRServiceAreaAreaTypeTagUtilityRoom MTR_PROVISIONALLY_AVAILABLE = 0x5C, - MTRServiceAreaAreaTypeTagWard MTR_PROVISIONALLY_AVAILABLE = 0x5D, - MTRServiceAreaAreaTypeTagWorkshop MTR_PROVISIONALLY_AVAILABLE = 0x5E, -} MTR_PROVISIONALLY_AVAILABLE; - -typedef NS_ENUM(uint8_t, MTRServiceAreaFloorSurfaceTag) { - MTRServiceAreaFloorSurfaceTagCarpet MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRServiceAreaFloorSurfaceTagCeramic MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRServiceAreaFloorSurfaceTagConcrete MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRServiceAreaFloorSurfaceTagCork MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRServiceAreaFloorSurfaceTagDeepCarpet MTR_PROVISIONALLY_AVAILABLE = 0x04, - MTRServiceAreaFloorSurfaceTagDirt MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTRServiceAreaFloorSurfaceTagEngineeredWood MTR_PROVISIONALLY_AVAILABLE = 0x06, - MTRServiceAreaFloorSurfaceTagGlass MTR_PROVISIONALLY_AVAILABLE = 0x07, - MTRServiceAreaFloorSurfaceTagGrass MTR_PROVISIONALLY_AVAILABLE = 0x08, - MTRServiceAreaFloorSurfaceTagHardwood MTR_PROVISIONALLY_AVAILABLE = 0x09, - MTRServiceAreaFloorSurfaceTagLaminate MTR_PROVISIONALLY_AVAILABLE = 0x0A, - MTRServiceAreaFloorSurfaceTagLinoleum MTR_PROVISIONALLY_AVAILABLE = 0x0B, - MTRServiceAreaFloorSurfaceTagMat MTR_PROVISIONALLY_AVAILABLE = 0x0C, - MTRServiceAreaFloorSurfaceTagMetal MTR_PROVISIONALLY_AVAILABLE = 0x0D, - MTRServiceAreaFloorSurfaceTagPlastic MTR_PROVISIONALLY_AVAILABLE = 0x0E, - MTRServiceAreaFloorSurfaceTagPolishedConcrete MTR_PROVISIONALLY_AVAILABLE = 0x0F, - MTRServiceAreaFloorSurfaceTagRubber MTR_PROVISIONALLY_AVAILABLE = 0x10, - MTRServiceAreaFloorSurfaceTagRug MTR_PROVISIONALLY_AVAILABLE = 0x11, - MTRServiceAreaFloorSurfaceTagSand MTR_PROVISIONALLY_AVAILABLE = 0x12, - MTRServiceAreaFloorSurfaceTagStone MTR_PROVISIONALLY_AVAILABLE = 0x13, - MTRServiceAreaFloorSurfaceTagTatami MTR_PROVISIONALLY_AVAILABLE = 0x14, - MTRServiceAreaFloorSurfaceTagTerrazzo MTR_PROVISIONALLY_AVAILABLE = 0x15, - MTRServiceAreaFloorSurfaceTagTile MTR_PROVISIONALLY_AVAILABLE = 0x16, - MTRServiceAreaFloorSurfaceTagVinyl MTR_PROVISIONALLY_AVAILABLE = 0x17, -} MTR_PROVISIONALLY_AVAILABLE; - -typedef NS_ENUM(uint8_t, MTRServiceAreaLandmarkTag) { - MTRServiceAreaLandmarkTagAirConditioner MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRServiceAreaLandmarkTagAirPurifier MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRServiceAreaLandmarkTagBackDoor MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRServiceAreaLandmarkTagBarStool MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRServiceAreaLandmarkTagBathMat MTR_PROVISIONALLY_AVAILABLE = 0x04, - MTRServiceAreaLandmarkTagBathtub MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTRServiceAreaLandmarkTagBed MTR_PROVISIONALLY_AVAILABLE = 0x06, - MTRServiceAreaLandmarkTagBookshelf MTR_PROVISIONALLY_AVAILABLE = 0x07, - MTRServiceAreaLandmarkTagChair MTR_PROVISIONALLY_AVAILABLE = 0x08, - MTRServiceAreaLandmarkTagChristmasTree MTR_PROVISIONALLY_AVAILABLE = 0x09, - MTRServiceAreaLandmarkTagCoatRack MTR_PROVISIONALLY_AVAILABLE = 0x0A, - MTRServiceAreaLandmarkTagCoffeeTable MTR_PROVISIONALLY_AVAILABLE = 0x0B, - MTRServiceAreaLandmarkTagCookingRange MTR_PROVISIONALLY_AVAILABLE = 0x0C, - MTRServiceAreaLandmarkTagCouch MTR_PROVISIONALLY_AVAILABLE = 0x0D, - MTRServiceAreaLandmarkTagCountertop MTR_PROVISIONALLY_AVAILABLE = 0x0E, - MTRServiceAreaLandmarkTagCradle MTR_PROVISIONALLY_AVAILABLE = 0x0F, - MTRServiceAreaLandmarkTagCrib MTR_PROVISIONALLY_AVAILABLE = 0x10, - MTRServiceAreaLandmarkTagDesk MTR_PROVISIONALLY_AVAILABLE = 0x11, - MTRServiceAreaLandmarkTagDiningTable MTR_PROVISIONALLY_AVAILABLE = 0x12, - MTRServiceAreaLandmarkTagDishwasher MTR_PROVISIONALLY_AVAILABLE = 0x13, - MTRServiceAreaLandmarkTagDoor MTR_PROVISIONALLY_AVAILABLE = 0x14, - MTRServiceAreaLandmarkTagDresser MTR_PROVISIONALLY_AVAILABLE = 0x15, - MTRServiceAreaLandmarkTagLaundryDryer MTR_PROVISIONALLY_AVAILABLE = 0x16, - MTRServiceAreaLandmarkTagFan MTR_PROVISIONALLY_AVAILABLE = 0x17, - MTRServiceAreaLandmarkTagFireplace MTR_PROVISIONALLY_AVAILABLE = 0x18, - MTRServiceAreaLandmarkTagFreezer MTR_PROVISIONALLY_AVAILABLE = 0x19, - MTRServiceAreaLandmarkTagFrontDoor MTR_PROVISIONALLY_AVAILABLE = 0x1A, - MTRServiceAreaLandmarkTagHighChair MTR_PROVISIONALLY_AVAILABLE = 0x1B, - MTRServiceAreaLandmarkTagKitchenIsland MTR_PROVISIONALLY_AVAILABLE = 0x1C, - MTRServiceAreaLandmarkTagLamp MTR_PROVISIONALLY_AVAILABLE = 0x1D, - MTRServiceAreaLandmarkTagLitterBox MTR_PROVISIONALLY_AVAILABLE = 0x1E, - MTRServiceAreaLandmarkTagMirror MTR_PROVISIONALLY_AVAILABLE = 0x1F, - MTRServiceAreaLandmarkTagNightstand MTR_PROVISIONALLY_AVAILABLE = 0x20, - MTRServiceAreaLandmarkTagOven MTR_PROVISIONALLY_AVAILABLE = 0x21, - MTRServiceAreaLandmarkTagPetBed MTR_PROVISIONALLY_AVAILABLE = 0x22, - MTRServiceAreaLandmarkTagPetBowl MTR_PROVISIONALLY_AVAILABLE = 0x23, - MTRServiceAreaLandmarkTagPetCrate MTR_PROVISIONALLY_AVAILABLE = 0x24, - MTRServiceAreaLandmarkTagRefrigerator MTR_PROVISIONALLY_AVAILABLE = 0x25, - MTRServiceAreaLandmarkTagScratchingPost MTR_PROVISIONALLY_AVAILABLE = 0x26, - MTRServiceAreaLandmarkTagShoeRack MTR_PROVISIONALLY_AVAILABLE = 0x27, - MTRServiceAreaLandmarkTagShower MTR_PROVISIONALLY_AVAILABLE = 0x28, - MTRServiceAreaLandmarkTagSideDoor MTR_PROVISIONALLY_AVAILABLE = 0x29, - MTRServiceAreaLandmarkTagSink MTR_PROVISIONALLY_AVAILABLE = 0x2A, - MTRServiceAreaLandmarkTagSofa MTR_PROVISIONALLY_AVAILABLE = 0x2B, - MTRServiceAreaLandmarkTagStove MTR_PROVISIONALLY_AVAILABLE = 0x2C, - MTRServiceAreaLandmarkTagTable MTR_PROVISIONALLY_AVAILABLE = 0x2D, - MTRServiceAreaLandmarkTagToilet MTR_PROVISIONALLY_AVAILABLE = 0x2E, - MTRServiceAreaLandmarkTagTrashCan MTR_PROVISIONALLY_AVAILABLE = 0x2F, - MTRServiceAreaLandmarkTagLaundryWasher MTR_PROVISIONALLY_AVAILABLE = 0x30, - MTRServiceAreaLandmarkTagWindow MTR_PROVISIONALLY_AVAILABLE = 0x31, - MTRServiceAreaLandmarkTagWineCooler MTR_PROVISIONALLY_AVAILABLE = 0x32, -} MTR_PROVISIONALLY_AVAILABLE; - typedef NS_ENUM(uint8_t, MTRServiceAreaOperationalStatus) { MTRServiceAreaOperationalStatusPending MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRServiceAreaOperationalStatusOperating MTR_PROVISIONALLY_AVAILABLE = 0x01, @@ -19784,23 +19801,6 @@ typedef NS_ENUM(uint8_t, MTRServiceAreaOperationalStatus) { MTRServiceAreaOperationalStatusCompleted MTR_PROVISIONALLY_AVAILABLE = 0x03, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTRServiceAreaPositionTag) { - MTRServiceAreaPositionTagLeft MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTRServiceAreaPositionTagRight MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTRServiceAreaPositionTagTop MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTRServiceAreaPositionTagBottom MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTRServiceAreaPositionTagMiddle MTR_PROVISIONALLY_AVAILABLE = 0x04, - MTRServiceAreaPositionTagRow MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTRServiceAreaPositionTagColumn MTR_PROVISIONALLY_AVAILABLE = 0x06, - MTRServiceAreaPositionTagUnder MTR_PROVISIONALLY_AVAILABLE = 0x07, - MTRServiceAreaPositionTagNextTo MTR_PROVISIONALLY_AVAILABLE = 0x08, - MTRServiceAreaPositionTagAround MTR_PROVISIONALLY_AVAILABLE = 0x09, - MTRServiceAreaPositionTagOn MTR_PROVISIONALLY_AVAILABLE = 0x0A, - MTRServiceAreaPositionTagAbove MTR_PROVISIONALLY_AVAILABLE = 0x0B, - MTRServiceAreaPositionTagFrontOf MTR_PROVISIONALLY_AVAILABLE = 0x0C, - MTRServiceAreaPositionTagBehind MTR_PROVISIONALLY_AVAILABLE = 0x0D, -} MTR_PROVISIONALLY_AVAILABLE; - typedef NS_ENUM(uint8_t, MTRServiceAreaSelectLocationsStatus) { MTRServiceAreaSelectLocationsStatusSuccess MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRServiceAreaSelectLocationsStatusUnsupportedLocation MTR_PROVISIONALLY_AVAILABLE = 0x01, @@ -21098,104 +21098,6 @@ typedef NS_ENUM(uint8_t, MTRContentAppObserverStatus) { MTRContentAppObserverStatusUnexpectedData MTR_PROVISIONALLY_AVAILABLE = 0x01, } MTR_PROVISIONALLY_AVAILABLE; -typedef NS_ENUM(uint8_t, MTREcosystemInformationAreaTypeTag) { - MTREcosystemInformationAreaTypeTagAisle MTR_PROVISIONALLY_AVAILABLE = 0x00, - MTREcosystemInformationAreaTypeTagAttic MTR_PROVISIONALLY_AVAILABLE = 0x01, - MTREcosystemInformationAreaTypeTagBackDoor MTR_PROVISIONALLY_AVAILABLE = 0x02, - MTREcosystemInformationAreaTypeTagBackYard MTR_PROVISIONALLY_AVAILABLE = 0x03, - MTREcosystemInformationAreaTypeTagBalcony MTR_PROVISIONALLY_AVAILABLE = 0x04, - MTREcosystemInformationAreaTypeTagBallroom MTR_PROVISIONALLY_AVAILABLE = 0x05, - MTREcosystemInformationAreaTypeTagBathroom MTR_PROVISIONALLY_AVAILABLE = 0x06, - MTREcosystemInformationAreaTypeTagBedroom MTR_PROVISIONALLY_AVAILABLE = 0x07, - MTREcosystemInformationAreaTypeTagBorder MTR_PROVISIONALLY_AVAILABLE = 0x08, - MTREcosystemInformationAreaTypeTagBoxroom MTR_PROVISIONALLY_AVAILABLE = 0x09, - MTREcosystemInformationAreaTypeTagBreakfastRoom MTR_PROVISIONALLY_AVAILABLE = 0x0A, - MTREcosystemInformationAreaTypeTagCarport MTR_PROVISIONALLY_AVAILABLE = 0x0B, - MTREcosystemInformationAreaTypeTagCellar MTR_PROVISIONALLY_AVAILABLE = 0x0C, - MTREcosystemInformationAreaTypeTagCloakroom MTR_PROVISIONALLY_AVAILABLE = 0x0D, - MTREcosystemInformationAreaTypeTagCloset MTR_PROVISIONALLY_AVAILABLE = 0x0E, - MTREcosystemInformationAreaTypeTagConservatory MTR_PROVISIONALLY_AVAILABLE = 0x0F, - MTREcosystemInformationAreaTypeTagCorridor MTR_PROVISIONALLY_AVAILABLE = 0x10, - MTREcosystemInformationAreaTypeTagCraftRoom MTR_PROVISIONALLY_AVAILABLE = 0x11, - MTREcosystemInformationAreaTypeTagCupboard MTR_PROVISIONALLY_AVAILABLE = 0x12, - MTREcosystemInformationAreaTypeTagDeck MTR_PROVISIONALLY_AVAILABLE = 0x13, - MTREcosystemInformationAreaTypeTagDen MTR_PROVISIONALLY_AVAILABLE = 0x14, - MTREcosystemInformationAreaTypeTagDining MTR_PROVISIONALLY_AVAILABLE = 0x15, - MTREcosystemInformationAreaTypeTagDrawingRoom MTR_PROVISIONALLY_AVAILABLE = 0x16, - MTREcosystemInformationAreaTypeTagDressingRoom MTR_PROVISIONALLY_AVAILABLE = 0x17, - MTREcosystemInformationAreaTypeTagDriveway MTR_PROVISIONALLY_AVAILABLE = 0x18, - MTREcosystemInformationAreaTypeTagElevator MTR_PROVISIONALLY_AVAILABLE = 0x19, - MTREcosystemInformationAreaTypeTagEnsuite MTR_PROVISIONALLY_AVAILABLE = 0x1A, - MTREcosystemInformationAreaTypeTagEntrance MTR_PROVISIONALLY_AVAILABLE = 0x1B, - MTREcosystemInformationAreaTypeTagEntryway MTR_PROVISIONALLY_AVAILABLE = 0x1C, - MTREcosystemInformationAreaTypeTagFamilyRoom MTR_PROVISIONALLY_AVAILABLE = 0x1D, - MTREcosystemInformationAreaTypeTagFoyer MTR_PROVISIONALLY_AVAILABLE = 0x1E, - MTREcosystemInformationAreaTypeTagFrontDoor MTR_PROVISIONALLY_AVAILABLE = 0x1F, - MTREcosystemInformationAreaTypeTagFrontYard MTR_PROVISIONALLY_AVAILABLE = 0x20, - MTREcosystemInformationAreaTypeTagGameRoom MTR_PROVISIONALLY_AVAILABLE = 0x21, - MTREcosystemInformationAreaTypeTagGarage MTR_PROVISIONALLY_AVAILABLE = 0x22, - MTREcosystemInformationAreaTypeTagGarageDoor MTR_PROVISIONALLY_AVAILABLE = 0x23, - MTREcosystemInformationAreaTypeTagGarden MTR_PROVISIONALLY_AVAILABLE = 0x24, - MTREcosystemInformationAreaTypeTagGardenDoor MTR_PROVISIONALLY_AVAILABLE = 0x25, - MTREcosystemInformationAreaTypeTagGuestBathroom MTR_PROVISIONALLY_AVAILABLE = 0x26, - MTREcosystemInformationAreaTypeTagGuestBedroom MTR_PROVISIONALLY_AVAILABLE = 0x27, - MTREcosystemInformationAreaTypeTagGuestRestroom MTR_PROVISIONALLY_AVAILABLE = 0x28, - MTREcosystemInformationAreaTypeTagGuestRoom MTR_PROVISIONALLY_AVAILABLE = 0x29, - MTREcosystemInformationAreaTypeTagGym MTR_PROVISIONALLY_AVAILABLE = 0x2A, - MTREcosystemInformationAreaTypeTagHallway MTR_PROVISIONALLY_AVAILABLE = 0x2B, - MTREcosystemInformationAreaTypeTagHearthRoom MTR_PROVISIONALLY_AVAILABLE = 0x2C, - MTREcosystemInformationAreaTypeTagKidsRoom MTR_PROVISIONALLY_AVAILABLE = 0x2D, - MTREcosystemInformationAreaTypeTagKidsBedroom MTR_PROVISIONALLY_AVAILABLE = 0x2E, - MTREcosystemInformationAreaTypeTagKitchen MTR_PROVISIONALLY_AVAILABLE = 0x2F, - MTREcosystemInformationAreaTypeTagLarder MTR_PROVISIONALLY_AVAILABLE = 0x30, - MTREcosystemInformationAreaTypeTagLaundryRoom MTR_PROVISIONALLY_AVAILABLE = 0x31, - MTREcosystemInformationAreaTypeTagLawn MTR_PROVISIONALLY_AVAILABLE = 0x32, - MTREcosystemInformationAreaTypeTagLibrary MTR_PROVISIONALLY_AVAILABLE = 0x33, - MTREcosystemInformationAreaTypeTagLivingRoom MTR_PROVISIONALLY_AVAILABLE = 0x34, - MTREcosystemInformationAreaTypeTagLounge MTR_PROVISIONALLY_AVAILABLE = 0x35, - MTREcosystemInformationAreaTypeTagMediaTVRoom MTR_PROVISIONALLY_AVAILABLE = 0x36, - MTREcosystemInformationAreaTypeTagMudRoom MTR_PROVISIONALLY_AVAILABLE = 0x37, - MTREcosystemInformationAreaTypeTagMusicRoom MTR_PROVISIONALLY_AVAILABLE = 0x38, - MTREcosystemInformationAreaTypeTagNursery MTR_PROVISIONALLY_AVAILABLE = 0x39, - MTREcosystemInformationAreaTypeTagOffice MTR_PROVISIONALLY_AVAILABLE = 0x3A, - MTREcosystemInformationAreaTypeTagOutdoorKitchen MTR_PROVISIONALLY_AVAILABLE = 0x3B, - MTREcosystemInformationAreaTypeTagOutside MTR_PROVISIONALLY_AVAILABLE = 0x3C, - MTREcosystemInformationAreaTypeTagPantry MTR_PROVISIONALLY_AVAILABLE = 0x3D, - MTREcosystemInformationAreaTypeTagParkingLot MTR_PROVISIONALLY_AVAILABLE = 0x3E, - MTREcosystemInformationAreaTypeTagParlor MTR_PROVISIONALLY_AVAILABLE = 0x3F, - MTREcosystemInformationAreaTypeTagPatio MTR_PROVISIONALLY_AVAILABLE = 0x40, - MTREcosystemInformationAreaTypeTagPlayRoom MTR_PROVISIONALLY_AVAILABLE = 0x41, - MTREcosystemInformationAreaTypeTagPoolRoom MTR_PROVISIONALLY_AVAILABLE = 0x42, - MTREcosystemInformationAreaTypeTagPorch MTR_PROVISIONALLY_AVAILABLE = 0x43, - MTREcosystemInformationAreaTypeTagPrimaryBathroom MTR_PROVISIONALLY_AVAILABLE = 0x44, - MTREcosystemInformationAreaTypeTagPrimaryBedroom MTR_PROVISIONALLY_AVAILABLE = 0x45, - MTREcosystemInformationAreaTypeTagRamp MTR_PROVISIONALLY_AVAILABLE = 0x46, - MTREcosystemInformationAreaTypeTagReceptionRoom MTR_PROVISIONALLY_AVAILABLE = 0x47, - MTREcosystemInformationAreaTypeTagRecreationRoom MTR_PROVISIONALLY_AVAILABLE = 0x48, - MTREcosystemInformationAreaTypeTagRestroom MTR_PROVISIONALLY_AVAILABLE = 0x49, - MTREcosystemInformationAreaTypeTagRoof MTR_PROVISIONALLY_AVAILABLE = 0x4A, - MTREcosystemInformationAreaTypeTagSauna MTR_PROVISIONALLY_AVAILABLE = 0x4B, - MTREcosystemInformationAreaTypeTagScullery MTR_PROVISIONALLY_AVAILABLE = 0x4C, - MTREcosystemInformationAreaTypeTagSewingRoom MTR_PROVISIONALLY_AVAILABLE = 0x4D, - MTREcosystemInformationAreaTypeTagShed MTR_PROVISIONALLY_AVAILABLE = 0x4E, - MTREcosystemInformationAreaTypeTagSideDoor MTR_PROVISIONALLY_AVAILABLE = 0x4F, - MTREcosystemInformationAreaTypeTagSideYard MTR_PROVISIONALLY_AVAILABLE = 0x50, - MTREcosystemInformationAreaTypeTagSittingRoom MTR_PROVISIONALLY_AVAILABLE = 0x51, - MTREcosystemInformationAreaTypeTagSnug MTR_PROVISIONALLY_AVAILABLE = 0x52, - MTREcosystemInformationAreaTypeTagSpa MTR_PROVISIONALLY_AVAILABLE = 0x53, - MTREcosystemInformationAreaTypeTagStaircase MTR_PROVISIONALLY_AVAILABLE = 0x54, - MTREcosystemInformationAreaTypeTagSteamRoom MTR_PROVISIONALLY_AVAILABLE = 0x55, - MTREcosystemInformationAreaTypeTagStorageRoom MTR_PROVISIONALLY_AVAILABLE = 0x56, - MTREcosystemInformationAreaTypeTagStudio MTR_PROVISIONALLY_AVAILABLE = 0x57, - MTREcosystemInformationAreaTypeTagStudy MTR_PROVISIONALLY_AVAILABLE = 0x58, - MTREcosystemInformationAreaTypeTagSunRoom MTR_PROVISIONALLY_AVAILABLE = 0x59, - MTREcosystemInformationAreaTypeTagSwimmingPool MTR_PROVISIONALLY_AVAILABLE = 0x5A, - MTREcosystemInformationAreaTypeTagTerrace MTR_PROVISIONALLY_AVAILABLE = 0x5B, - MTREcosystemInformationAreaTypeTagUtilityRoom MTR_PROVISIONALLY_AVAILABLE = 0x5C, - MTREcosystemInformationAreaTypeTagWard MTR_PROVISIONALLY_AVAILABLE = 0x5D, - MTREcosystemInformationAreaTypeTagWorkshop MTR_PROVISIONALLY_AVAILABLE = 0x5E, -} MTR_PROVISIONALLY_AVAILABLE; - typedef NS_OPTIONS(uint32_t, MTRCommissionerControlSupportedDeviceCategoryBitmap) { MTRCommissionerControlSupportedDeviceCategoryBitmapFabricSynchronization MTR_PROVISIONALLY_AVAILABLE = 0x1, } MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index d73fc257e6bcd6..3d9aa95d0c2cd8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -19,6 +19,13 @@ NS_ASSUME_NONNULL_BEGIN +MTR_PROVISIONALLY_AVAILABLE +@interface MTRDataTypeLocationDescriptorStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRDataTypeTestGlobalStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; @@ -1580,16 +1587,9 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nullable dataIndex MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end -MTR_PROVISIONALLY_AVAILABLE -@interface MTRServiceAreaClusterLocationDescriptorStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; -@end - MTR_PROVISIONALLY_AVAILABLE @interface MTRServiceAreaClusterLocationInfoStruct : NSObject -@property (nonatomic, copy) MTRServiceAreaClusterLocationDescriptorStruct * _Nullable locationInfo MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRDataTypeLocationDescriptorStruct * _Nullable locationInfo MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable landmarkTag MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable positionTag MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable surfaceTag MTR_PROVISIONALLY_AVAILABLE; @@ -2088,21 +2088,6 @@ MTR_PROVISIONALLY_AVAILABLE @interface MTRContentControlClusterRemainingScreenTimeExpiredEvent : NSObject @end -MTR_PROVISIONALLY_AVAILABLE -@interface MTREcosystemInformationClusterLocationDescriptorStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; -@end - -MTR_PROVISIONALLY_AVAILABLE -@interface MTREcosystemInformationClusterEcosystemLocationStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull uniqueLocationID MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) MTREcosystemInformationClusterLocationDescriptorStruct * _Nonnull locationDescriptor MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull locationDescriptorLastEdit MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_PROVISIONALLY_AVAILABLE; -@end - MTR_PROVISIONALLY_AVAILABLE @interface MTREcosystemInformationClusterDeviceTypeStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull deviceType MTR_PROVISIONALLY_AVAILABLE; @@ -2121,6 +2106,14 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTREcosystemInformationClusterEcosystemLocationStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull uniqueLocationID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRDataTypeLocationDescriptorStruct * _Nonnull locationDescriptor MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull locationDescriptorLastEdit MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRCommissionerControlClusterCommissioningRequestResultEvent : NSObject @property (nonatomic, copy) NSNumber * _Nonnull requestId MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 632b70647eb6d0..2cd6c479c1d9f5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -19,6 +19,39 @@ NS_ASSUME_NONNULL_BEGIN +@implementation MTRDataTypeLocationDescriptorStruct +- (instancetype)init +{ + if (self = [super init]) { + + _locationName = @""; + + _floorNumber = nil; + + _areaType = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRDataTypeLocationDescriptorStruct alloc] init]; + + other.locationName = self.locationName; + other.floorNumber = self.floorNumber; + other.areaType = self.areaType; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; + return descriptionString; +} + +@end + @implementation MTRDataTypeTestGlobalStruct - (instancetype)init { @@ -6577,39 +6610,6 @@ - (NSString *)description @end -@implementation MTRServiceAreaClusterLocationDescriptorStruct -- (instancetype)init -{ - if (self = [super init]) { - - _locationName = @""; - - _floorNumber = nil; - - _areaType = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone -{ - auto other = [[MTRServiceAreaClusterLocationDescriptorStruct alloc] init]; - - other.locationName = self.locationName; - other.floorNumber = self.floorNumber; - other.areaType = self.areaType; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; - return descriptionString; -} - -@end - @implementation MTRServiceAreaClusterLocationInfoStruct - (instancetype)init { @@ -8622,123 +8622,94 @@ - (NSString *)description @end -@implementation MTREcosystemInformationClusterLocationDescriptorStruct +@implementation MTREcosystemInformationClusterDeviceTypeStruct - (instancetype)init { if (self = [super init]) { - _locationName = @""; - - _floorNumber = nil; + _deviceType = @(0); - _areaType = nil; + _revision = @(0); } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTREcosystemInformationClusterLocationDescriptorStruct alloc] init]; + auto other = [[MTREcosystemInformationClusterDeviceTypeStruct alloc] init]; - other.locationName = self.locationName; - other.floorNumber = self.floorNumber; - other.areaType = self.areaType; + other.deviceType = self.deviceType; + other.revision = self.revision; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deviceType:%@; revision:%@; >", NSStringFromClass([self class]), _deviceType, _revision]; return descriptionString; } @end -@implementation MTREcosystemInformationClusterEcosystemLocationStruct +@implementation MTREcosystemInformationClusterEcosystemDeviceStruct - (instancetype)init { if (self = [super init]) { - _uniqueLocationID = @""; - - _locationDescriptor = [MTREcosystemInformationClusterLocationDescriptorStruct new]; - - _locationDescriptorLastEdit = @(0); - - _fabricIndex = @(0); - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone -{ - auto other = [[MTREcosystemInformationClusterEcosystemLocationStruct alloc] init]; + _deviceName = nil; - other.uniqueLocationID = self.uniqueLocationID; - other.locationDescriptor = self.locationDescriptor; - other.locationDescriptorLastEdit = self.locationDescriptorLastEdit; - other.fabricIndex = self.fabricIndex; + _deviceNameLastEdit = nil; - return other; -} + _bridgedEndpoint = @(0); -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: uniqueLocationID:%@; locationDescriptor:%@; locationDescriptorLastEdit:%@; fabricIndex:%@; >", NSStringFromClass([self class]), _uniqueLocationID, _locationDescriptor, _locationDescriptorLastEdit, _fabricIndex]; - return descriptionString; -} + _originalEndpoint = @(0); -@end + _deviceTypes = [NSArray array]; -@implementation MTREcosystemInformationClusterDeviceTypeStruct -- (instancetype)init -{ - if (self = [super init]) { + _uniqueLocationIDs = [NSArray array]; - _deviceType = @(0); + _uniqueLocationIDsLastEdit = @(0); - _revision = @(0); + _fabricIndex = @(0); } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTREcosystemInformationClusterDeviceTypeStruct alloc] init]; + auto other = [[MTREcosystemInformationClusterEcosystemDeviceStruct alloc] init]; - other.deviceType = self.deviceType; - other.revision = self.revision; + other.deviceName = self.deviceName; + other.deviceNameLastEdit = self.deviceNameLastEdit; + other.bridgedEndpoint = self.bridgedEndpoint; + other.originalEndpoint = self.originalEndpoint; + other.deviceTypes = self.deviceTypes; + other.uniqueLocationIDs = self.uniqueLocationIDs; + other.uniqueLocationIDsLastEdit = self.uniqueLocationIDsLastEdit; + other.fabricIndex = self.fabricIndex; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: deviceType:%@; revision:%@; >", NSStringFromClass([self class]), _deviceType, _revision]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: deviceName:%@; deviceNameLastEdit:%@; bridgedEndpoint:%@; originalEndpoint:%@; deviceTypes:%@; uniqueLocationIDs:%@; uniqueLocationIDsLastEdit:%@; fabricIndex:%@; >", NSStringFromClass([self class]), _deviceName, _deviceNameLastEdit, _bridgedEndpoint, _originalEndpoint, _deviceTypes, _uniqueLocationIDs, _uniqueLocationIDsLastEdit, _fabricIndex]; return descriptionString; } @end -@implementation MTREcosystemInformationClusterEcosystemDeviceStruct +@implementation MTREcosystemInformationClusterEcosystemLocationStruct - (instancetype)init { if (self = [super init]) { - _deviceName = nil; - - _deviceNameLastEdit = nil; - - _bridgedEndpoint = @(0); - - _originalEndpoint = @(0); - - _deviceTypes = [NSArray array]; + _uniqueLocationID = @""; - _uniqueLocationIDs = [NSArray array]; + _locationDescriptor = [MTRDataTypeLocationDescriptorStruct new]; - _uniqueLocationIDsLastEdit = @(0); + _locationDescriptorLastEdit = @(0); _fabricIndex = @(0); } @@ -8747,15 +8718,11 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTREcosystemInformationClusterEcosystemDeviceStruct alloc] init]; + auto other = [[MTREcosystemInformationClusterEcosystemLocationStruct alloc] init]; - other.deviceName = self.deviceName; - other.deviceNameLastEdit = self.deviceNameLastEdit; - other.bridgedEndpoint = self.bridgedEndpoint; - other.originalEndpoint = self.originalEndpoint; - other.deviceTypes = self.deviceTypes; - other.uniqueLocationIDs = self.uniqueLocationIDs; - other.uniqueLocationIDsLastEdit = self.uniqueLocationIDsLastEdit; + other.uniqueLocationID = self.uniqueLocationID; + other.locationDescriptor = self.locationDescriptor; + other.locationDescriptorLastEdit = self.locationDescriptorLastEdit; other.fabricIndex = self.fabricIndex; return other; @@ -8763,7 +8730,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: deviceName:%@; deviceNameLastEdit:%@; bridgedEndpoint:%@; originalEndpoint:%@; deviceTypes:%@; uniqueLocationIDs:%@; uniqueLocationIDsLastEdit:%@; fabricIndex:%@; >", NSStringFromClass([self class]), _deviceName, _deviceNameLastEdit, _bridgedEndpoint, _originalEndpoint, _deviceTypes, _uniqueLocationIDs, _uniqueLocationIDsLastEdit, _fabricIndex]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: uniqueLocationID:%@; locationDescriptor:%@; locationDescriptorLastEdit:%@; fabricIndex:%@; >", NSStringFromClass([self class]), _uniqueLocationID, _locationDescriptor, _locationDescriptorLastEdit, _fabricIndex]; return descriptionString; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 40ca9c4ab84f60..8a55a7680596c8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -24,9 +24,9 @@ namespace chip { namespace app { namespace Clusters { -static auto __attribute__((unused)) EnsureKnownEnumValue(detail::AreaTypeTag val) +static auto __attribute__((unused)) EnsureKnownEnumValue(Globals::AreaTypeTag val) { - using EnumType = detail::AreaTypeTag; + using EnumType = Globals::AreaTypeTag; switch (val) { case EnumType::kAisle: @@ -129,6 +129,7 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(detail::AreaTypeTag val return EnumType::kUnknownEnumValue; } } + static auto __attribute__((unused)) EnsureKnownEnumValue(detail::ChangeIndicationEnum val) { using EnumType = detail::ChangeIndicationEnum; @@ -168,6 +169,103 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(detail::ErrorStateEnum return EnumType::kUnknownEnumValue; } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Globals::FloorSurfaceTag val) +{ + using EnumType = Globals::FloorSurfaceTag; + switch (val) + { + case EnumType::kCarpet: + case EnumType::kCeramic: + case EnumType::kConcrete: + case EnumType::kCork: + case EnumType::kDeepCarpet: + case EnumType::kDirt: + case EnumType::kEngineeredWood: + case EnumType::kGlass: + case EnumType::kGrass: + case EnumType::kHardwood: + case EnumType::kLaminate: + case EnumType::kLinoleum: + case EnumType::kMat: + case EnumType::kMetal: + case EnumType::kPlastic: + case EnumType::kPolishedConcrete: + case EnumType::kRubber: + case EnumType::kRug: + case EnumType::kSand: + case EnumType::kStone: + case EnumType::kTatami: + case EnumType::kTerrazzo: + case EnumType::kTile: + case EnumType::kVinyl: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + +static auto __attribute__((unused)) EnsureKnownEnumValue(Globals::LandmarkTag val) +{ + using EnumType = Globals::LandmarkTag; + switch (val) + { + case EnumType::kAirConditioner: + case EnumType::kAirPurifier: + case EnumType::kBackDoor: + case EnumType::kBarStool: + case EnumType::kBathMat: + case EnumType::kBathtub: + case EnumType::kBed: + case EnumType::kBookshelf: + case EnumType::kChair: + case EnumType::kChristmasTree: + case EnumType::kCoatRack: + case EnumType::kCoffeeTable: + case EnumType::kCookingRange: + case EnumType::kCouch: + case EnumType::kCountertop: + case EnumType::kCradle: + case EnumType::kCrib: + case EnumType::kDesk: + case EnumType::kDiningTable: + case EnumType::kDishwasher: + case EnumType::kDoor: + case EnumType::kDresser: + case EnumType::kLaundryDryer: + case EnumType::kFan: + case EnumType::kFireplace: + case EnumType::kFreezer: + case EnumType::kFrontDoor: + case EnumType::kHighChair: + case EnumType::kKitchenIsland: + case EnumType::kLamp: + case EnumType::kLitterBox: + case EnumType::kMirror: + case EnumType::kNightstand: + case EnumType::kOven: + case EnumType::kPetBed: + case EnumType::kPetBowl: + case EnumType::kPetCrate: + case EnumType::kRefrigerator: + case EnumType::kScratchingPost: + case EnumType::kShoeRack: + case EnumType::kShower: + case EnumType::kSideDoor: + case EnumType::kSink: + case EnumType::kSofa: + case EnumType::kStove: + case EnumType::kTable: + case EnumType::kToilet: + case EnumType::kTrashCan: + case EnumType::kLaundryWasher: + case EnumType::kWindow: + case EnumType::kWineCooler: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(detail::LevelValueEnum val) { using EnumType = detail::LevelValueEnum; @@ -253,6 +351,31 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(detail::OperationalStat return EnumType::kUnknownEnumValue; } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Globals::PositionTag val) +{ + using EnumType = Globals::PositionTag; + switch (val) + { + case EnumType::kLeft: + case EnumType::kRight: + case EnumType::kTop: + case EnumType::kBottom: + case EnumType::kMiddle: + case EnumType::kRow: + case EnumType::kColumn: + case EnumType::kUnder: + case EnumType::kNextTo: + case EnumType::kAround: + case EnumType::kOn: + case EnumType::kAbove: + case EnumType::kFrontOf: + case EnumType::kBehind: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} + static auto __attribute__((unused)) EnsureKnownEnumValue(detail::ProductIdentifierTypeEnum val) { using EnumType = detail::ProductIdentifierTypeEnum; @@ -2429,101 +2552,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(WindowCovering::Type va } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ServiceArea::FloorSurfaceTag val) -{ - using EnumType = ServiceArea::FloorSurfaceTag; - switch (val) - { - case EnumType::kCarpet: - case EnumType::kCeramic: - case EnumType::kConcrete: - case EnumType::kCork: - case EnumType::kDeepCarpet: - case EnumType::kDirt: - case EnumType::kEngineeredWood: - case EnumType::kGlass: - case EnumType::kGrass: - case EnumType::kHardwood: - case EnumType::kLaminate: - case EnumType::kLinoleum: - case EnumType::kMat: - case EnumType::kMetal: - case EnumType::kPlastic: - case EnumType::kPolishedConcrete: - case EnumType::kRubber: - case EnumType::kRug: - case EnumType::kSand: - case EnumType::kStone: - case EnumType::kTatami: - case EnumType::kTerrazzo: - case EnumType::kTile: - case EnumType::kVinyl: - return val; - default: - return EnumType::kUnknownEnumValue; - } -} -static auto __attribute__((unused)) EnsureKnownEnumValue(ServiceArea::LandmarkTag val) -{ - using EnumType = ServiceArea::LandmarkTag; - switch (val) - { - case EnumType::kAirConditioner: - case EnumType::kAirPurifier: - case EnumType::kBackDoor: - case EnumType::kBarStool: - case EnumType::kBathMat: - case EnumType::kBathtub: - case EnumType::kBed: - case EnumType::kBookshelf: - case EnumType::kChair: - case EnumType::kChristmasTree: - case EnumType::kCoatRack: - case EnumType::kCoffeeTable: - case EnumType::kCookingRange: - case EnumType::kCouch: - case EnumType::kCountertop: - case EnumType::kCradle: - case EnumType::kCrib: - case EnumType::kDesk: - case EnumType::kDiningTable: - case EnumType::kDishwasher: - case EnumType::kDoor: - case EnumType::kDresser: - case EnumType::kLaundryDryer: - case EnumType::kFan: - case EnumType::kFireplace: - case EnumType::kFreezer: - case EnumType::kFrontDoor: - case EnumType::kHighChair: - case EnumType::kKitchenIsland: - case EnumType::kLamp: - case EnumType::kLitterBox: - case EnumType::kMirror: - case EnumType::kNightstand: - case EnumType::kOven: - case EnumType::kPetBed: - case EnumType::kPetBowl: - case EnumType::kPetCrate: - case EnumType::kRefrigerator: - case EnumType::kScratchingPost: - case EnumType::kShoeRack: - case EnumType::kShower: - case EnumType::kSideDoor: - case EnumType::kSink: - case EnumType::kSofa: - case EnumType::kStove: - case EnumType::kTable: - case EnumType::kToilet: - case EnumType::kTrashCan: - case EnumType::kLaundryWasher: - case EnumType::kWindow: - case EnumType::kWineCooler: - return val; - default: - return EnumType::kUnknownEnumValue; - } -} static auto __attribute__((unused)) EnsureKnownEnumValue(ServiceArea::OperationalStatusEnum val) { using EnumType = ServiceArea::OperationalStatusEnum; @@ -2538,30 +2566,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(ServiceArea::Operationa return EnumType::kUnknownEnumValue; } } -static auto __attribute__((unused)) EnsureKnownEnumValue(ServiceArea::PositionTag val) -{ - using EnumType = ServiceArea::PositionTag; - switch (val) - { - case EnumType::kLeft: - case EnumType::kRight: - case EnumType::kTop: - case EnumType::kBottom: - case EnumType::kMiddle: - case EnumType::kRow: - case EnumType::kColumn: - case EnumType::kUnder: - case EnumType::kNextTo: - case EnumType::kAround: - case EnumType::kOn: - case EnumType::kAbove: - case EnumType::kFrontOf: - case EnumType::kBehind: - return val; - default: - return EnumType::kUnknownEnumValue; - } -} static auto __attribute__((unused)) EnsureKnownEnumValue(ServiceArea::SelectLocationsStatus val) { using EnumType = ServiceArea::SelectLocationsStatus; 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 78d0a0085a9079..e375b394871e69 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 @@ -28,111 +28,6 @@ namespace Clusters { namespace detail { // Enums shared across multiple clusters. -// Enum for AreaTypeTag -enum class AreaTypeTag : uint8_t -{ - kAisle = 0x00, - kAttic = 0x01, - kBackDoor = 0x02, - kBackYard = 0x03, - kBalcony = 0x04, - kBallroom = 0x05, - kBathroom = 0x06, - kBedroom = 0x07, - kBorder = 0x08, - kBoxroom = 0x09, - kBreakfastRoom = 0x0A, - kCarport = 0x0B, - kCellar = 0x0C, - kCloakroom = 0x0D, - kCloset = 0x0E, - kConservatory = 0x0F, - kCorridor = 0x10, - kCraftRoom = 0x11, - kCupboard = 0x12, - kDeck = 0x13, - kDen = 0x14, - kDining = 0x15, - kDrawingRoom = 0x16, - kDressingRoom = 0x17, - kDriveway = 0x18, - kElevator = 0x19, - kEnsuite = 0x1A, - kEntrance = 0x1B, - kEntryway = 0x1C, - kFamilyRoom = 0x1D, - kFoyer = 0x1E, - kFrontDoor = 0x1F, - kFrontYard = 0x20, - kGameRoom = 0x21, - kGarage = 0x22, - kGarageDoor = 0x23, - kGarden = 0x24, - kGardenDoor = 0x25, - kGuestBathroom = 0x26, - kGuestBedroom = 0x27, - kGuestRestroom = 0x28, - kGuestRoom = 0x29, - kGym = 0x2A, - kHallway = 0x2B, - kHearthRoom = 0x2C, - kKidsRoom = 0x2D, - kKidsBedroom = 0x2E, - kKitchen = 0x2F, - kLarder = 0x30, - kLaundryRoom = 0x31, - kLawn = 0x32, - kLibrary = 0x33, - kLivingRoom = 0x34, - kLounge = 0x35, - kMediaTvRoom = 0x36, - kMudRoom = 0x37, - kMusicRoom = 0x38, - kNursery = 0x39, - kOffice = 0x3A, - kOutdoorKitchen = 0x3B, - kOutside = 0x3C, - kPantry = 0x3D, - kParkingLot = 0x3E, - kParlor = 0x3F, - kPatio = 0x40, - kPlayRoom = 0x41, - kPoolRoom = 0x42, - kPorch = 0x43, - kPrimaryBathroom = 0x44, - kPrimaryBedroom = 0x45, - kRamp = 0x46, - kReceptionRoom = 0x47, - kRecreationRoom = 0x48, - kRestroom = 0x49, - kRoof = 0x4A, - kSauna = 0x4B, - kScullery = 0x4C, - kSewingRoom = 0x4D, - kShed = 0x4E, - kSideDoor = 0x4F, - kSideYard = 0x50, - kSittingRoom = 0x51, - kSnug = 0x52, - kSpa = 0x53, - kStaircase = 0x54, - kSteamRoom = 0x55, - kStorageRoom = 0x56, - kStudio = 0x57, - kStudy = 0x58, - kSunRoom = 0x59, - kSwimmingPool = 0x5A, - kTerrace = 0x5B, - kUtilityRoom = 0x5C, - kWard = 0x5D, - kWorkshop = 0x5E, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 95, -}; - // Enum for ChangeIndicationEnum enum class ChangeIndicationEnum : uint8_t { @@ -279,6 +174,230 @@ enum class ProductIdentifierTypeEnum : uint8_t namespace Globals { // Global enums. +// Enum for AreaTypeTag +enum class AreaTypeTag : uint8_t +{ + kAisle = 0x00, + kAttic = 0x01, + kBackDoor = 0x02, + kBackYard = 0x03, + kBalcony = 0x04, + kBallroom = 0x05, + kBathroom = 0x06, + kBedroom = 0x07, + kBorder = 0x08, + kBoxroom = 0x09, + kBreakfastRoom = 0x0A, + kCarport = 0x0B, + kCellar = 0x0C, + kCloakroom = 0x0D, + kCloset = 0x0E, + kConservatory = 0x0F, + kCorridor = 0x10, + kCraftRoom = 0x11, + kCupboard = 0x12, + kDeck = 0x13, + kDen = 0x14, + kDining = 0x15, + kDrawingRoom = 0x16, + kDressingRoom = 0x17, + kDriveway = 0x18, + kElevator = 0x19, + kEnsuite = 0x1A, + kEntrance = 0x1B, + kEntryway = 0x1C, + kFamilyRoom = 0x1D, + kFoyer = 0x1E, + kFrontDoor = 0x1F, + kFrontYard = 0x20, + kGameRoom = 0x21, + kGarage = 0x22, + kGarageDoor = 0x23, + kGarden = 0x24, + kGardenDoor = 0x25, + kGuestBathroom = 0x26, + kGuestBedroom = 0x27, + kGuestRestroom = 0x28, + kGuestRoom = 0x29, + kGym = 0x2A, + kHallway = 0x2B, + kHearthRoom = 0x2C, + kKidsRoom = 0x2D, + kKidsBedroom = 0x2E, + kKitchen = 0x2F, + kLarder = 0x30, + kLaundryRoom = 0x31, + kLawn = 0x32, + kLibrary = 0x33, + kLivingRoom = 0x34, + kLounge = 0x35, + kMediaTvRoom = 0x36, + kMudRoom = 0x37, + kMusicRoom = 0x38, + kNursery = 0x39, + kOffice = 0x3A, + kOutdoorKitchen = 0x3B, + kOutside = 0x3C, + kPantry = 0x3D, + kParkingLot = 0x3E, + kParlor = 0x3F, + kPatio = 0x40, + kPlayRoom = 0x41, + kPoolRoom = 0x42, + kPorch = 0x43, + kPrimaryBathroom = 0x44, + kPrimaryBedroom = 0x45, + kRamp = 0x46, + kReceptionRoom = 0x47, + kRecreationRoom = 0x48, + kRestroom = 0x49, + kRoof = 0x4A, + kSauna = 0x4B, + kScullery = 0x4C, + kSewingRoom = 0x4D, + kShed = 0x4E, + kSideDoor = 0x4F, + kSideYard = 0x50, + kSittingRoom = 0x51, + kSnug = 0x52, + kSpa = 0x53, + kStaircase = 0x54, + kSteamRoom = 0x55, + kStorageRoom = 0x56, + kStudio = 0x57, + kStudy = 0x58, + kSunRoom = 0x59, + kSwimmingPool = 0x5A, + kTerrace = 0x5B, + kUtilityRoom = 0x5C, + kWard = 0x5D, + kWorkshop = 0x5E, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 95, +}; + +// Enum for FloorSurfaceTag +enum class FloorSurfaceTag : uint8_t +{ + kCarpet = 0x00, + kCeramic = 0x01, + kConcrete = 0x02, + kCork = 0x03, + kDeepCarpet = 0x04, + kDirt = 0x05, + kEngineeredWood = 0x06, + kGlass = 0x07, + kGrass = 0x08, + kHardwood = 0x09, + kLaminate = 0x0A, + kLinoleum = 0x0B, + kMat = 0x0C, + kMetal = 0x0D, + kPlastic = 0x0E, + kPolishedConcrete = 0x0F, + kRubber = 0x10, + kRug = 0x11, + kSand = 0x12, + kStone = 0x13, + kTatami = 0x14, + kTerrazzo = 0x15, + kTile = 0x16, + kVinyl = 0x17, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 24, +}; + +// Enum for LandmarkTag +enum class LandmarkTag : uint8_t +{ + kAirConditioner = 0x00, + kAirPurifier = 0x01, + kBackDoor = 0x02, + kBarStool = 0x03, + kBathMat = 0x04, + kBathtub = 0x05, + kBed = 0x06, + kBookshelf = 0x07, + kChair = 0x08, + kChristmasTree = 0x09, + kCoatRack = 0x0A, + kCoffeeTable = 0x0B, + kCookingRange = 0x0C, + kCouch = 0x0D, + kCountertop = 0x0E, + kCradle = 0x0F, + kCrib = 0x10, + kDesk = 0x11, + kDiningTable = 0x12, + kDishwasher = 0x13, + kDoor = 0x14, + kDresser = 0x15, + kLaundryDryer = 0x16, + kFan = 0x17, + kFireplace = 0x18, + kFreezer = 0x19, + kFrontDoor = 0x1A, + kHighChair = 0x1B, + kKitchenIsland = 0x1C, + kLamp = 0x1D, + kLitterBox = 0x1E, + kMirror = 0x1F, + kNightstand = 0x20, + kOven = 0x21, + kPetBed = 0x22, + kPetBowl = 0x23, + kPetCrate = 0x24, + kRefrigerator = 0x25, + kScratchingPost = 0x26, + kShoeRack = 0x27, + kShower = 0x28, + kSideDoor = 0x29, + kSink = 0x2A, + kSofa = 0x2B, + kStove = 0x2C, + kTable = 0x2D, + kToilet = 0x2E, + kTrashCan = 0x2F, + kLaundryWasher = 0x30, + kWindow = 0x31, + kWineCooler = 0x32, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 51, +}; + +// Enum for PositionTag +enum class PositionTag : uint8_t +{ + kLeft = 0x00, + kRight = 0x01, + kTop = 0x02, + kBottom = 0x03, + kMiddle = 0x04, + kRow = 0x05, + kColumn = 0x06, + kUnder = 0x07, + kNextTo = 0x08, + kAround = 0x09, + kOn = 0x0A, + kAbove = 0x0B, + kFrontOf = 0x0C, + kBehind = 0x0D, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 14, +}; + // Enum for TestGlobalEnum enum class TestGlobalEnum : uint8_t { @@ -3674,103 +3793,6 @@ enum class BarrierControlSafetyStatus : uint16_t namespace ServiceArea { -using AreaTypeTag = Clusters::detail::AreaTypeTag; - -// Enum for FloorSurfaceTag -enum class FloorSurfaceTag : uint8_t -{ - kCarpet = 0x00, - kCeramic = 0x01, - kConcrete = 0x02, - kCork = 0x03, - kDeepCarpet = 0x04, - kDirt = 0x05, - kEngineeredWood = 0x06, - kGlass = 0x07, - kGrass = 0x08, - kHardwood = 0x09, - kLaminate = 0x0A, - kLinoleum = 0x0B, - kMat = 0x0C, - kMetal = 0x0D, - kPlastic = 0x0E, - kPolishedConcrete = 0x0F, - kRubber = 0x10, - kRug = 0x11, - kSand = 0x12, - kStone = 0x13, - kTatami = 0x14, - kTerrazzo = 0x15, - kTile = 0x16, - kVinyl = 0x17, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 24, -}; - -// Enum for LandmarkTag -enum class LandmarkTag : uint8_t -{ - kAirConditioner = 0x00, - kAirPurifier = 0x01, - kBackDoor = 0x02, - kBarStool = 0x03, - kBathMat = 0x04, - kBathtub = 0x05, - kBed = 0x06, - kBookshelf = 0x07, - kChair = 0x08, - kChristmasTree = 0x09, - kCoatRack = 0x0A, - kCoffeeTable = 0x0B, - kCookingRange = 0x0C, - kCouch = 0x0D, - kCountertop = 0x0E, - kCradle = 0x0F, - kCrib = 0x10, - kDesk = 0x11, - kDiningTable = 0x12, - kDishwasher = 0x13, - kDoor = 0x14, - kDresser = 0x15, - kLaundryDryer = 0x16, - kFan = 0x17, - kFireplace = 0x18, - kFreezer = 0x19, - kFrontDoor = 0x1A, - kHighChair = 0x1B, - kKitchenIsland = 0x1C, - kLamp = 0x1D, - kLitterBox = 0x1E, - kMirror = 0x1F, - kNightstand = 0x20, - kOven = 0x21, - kPetBed = 0x22, - kPetBowl = 0x23, - kPetCrate = 0x24, - kRefrigerator = 0x25, - kScratchingPost = 0x26, - kShoeRack = 0x27, - kShower = 0x28, - kSideDoor = 0x29, - kSink = 0x2A, - kSofa = 0x2B, - kStove = 0x2C, - kTable = 0x2D, - kToilet = 0x2E, - kTrashCan = 0x2F, - kLaundryWasher = 0x30, - kWindow = 0x31, - kWineCooler = 0x32, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 51, -}; - // Enum for OperationalStatusEnum enum class OperationalStatusEnum : uint8_t { @@ -3785,30 +3807,6 @@ enum class OperationalStatusEnum : uint8_t kUnknownEnumValue = 4, }; -// Enum for PositionTag -enum class PositionTag : uint8_t -{ - kLeft = 0x00, - kRight = 0x01, - kTop = 0x02, - kBottom = 0x03, - kMiddle = 0x04, - kRow = 0x05, - kColumn = 0x06, - kUnder = 0x07, - kNextTo = 0x08, - kAround = 0x09, - kOn = 0x0A, - kAbove = 0x0B, - kFrontOf = 0x0C, - kBehind = 0x0D, - // All received enum values that are not listed above will be mapped - // to kUnknownEnumValue. This is a helper enum value that should only - // be used by code to process how it handles receiving and unknown - // enum value. This specific should never be transmitted. - kUnknownEnumValue = 14, -}; - // Enum for SelectLocationsStatus enum class SelectLocationsStatus : uint8_t { @@ -5257,10 +5255,7 @@ enum class StatusEnum : uint8_t }; } // namespace ContentAppObserver -namespace EcosystemInformation { - -using AreaTypeTag = Clusters::detail::AreaTypeTag; -} // namespace EcosystemInformation +namespace EcosystemInformation {} // namespace EcosystemInformation namespace CommissionerControl { 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 f206178484a6c3..d6a95147f59785 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 @@ -294,52 +294,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace MeasurementAccuracyStruct -namespace LocationDescriptorStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kLocationName), locationName); - encoder.Encode(to_underlying(Fields::kFloorNumber), floorNumber); - encoder.Encode(to_underlying(Fields::kAreaType), areaType); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kLocationName)) - { - err = DataModel::Decode(reader, locationName); - } - else if (__context_tag == to_underlying(Fields::kFloorNumber)) - { - err = DataModel::Decode(reader, floorNumber); - } - else if (__context_tag == to_underlying(Fields::kAreaType)) - { - err = DataModel::Decode(reader, areaType); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} - -} // namespace LocationDescriptorStruct - namespace DeviceTypeStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -556,6 +510,52 @@ namespace Globals { // Global structs namespace Structs { +namespace LocationDescriptorStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kLocationName), locationName); + encoder.Encode(to_underlying(Fields::kFloorNumber), floorNumber); + encoder.Encode(to_underlying(Fields::kAreaType), areaType); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kLocationName)) + { + err = DataModel::Decode(reader, locationName); + } + else if (__context_tag == to_underlying(Fields::kFloorNumber)) + { + err = DataModel::Decode(reader, floorNumber); + } + else if (__context_tag == to_underlying(Fields::kAreaType)) + { + err = DataModel::Decode(reader, areaType); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace LocationDescriptorStruct + namespace TestGlobalStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -28460,7 +28460,7 @@ namespace Events {} // namespace Events namespace EcosystemInformation { namespace Structs { -namespace EcosystemLocationStruct { +namespace EcosystemDeviceStruct { CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { return DoEncode(aWriter, aTag, NullOptional); @@ -28479,15 +28479,31 @@ CHIP_ERROR Type::DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optiona if (includeSensitive) { - encoder.Encode(to_underlying(Fields::kUniqueLocationID), uniqueLocationID); + encoder.Encode(to_underlying(Fields::kDeviceName), deviceName); } if (includeSensitive) { - encoder.Encode(to_underlying(Fields::kLocationDescriptor), locationDescriptor); + encoder.Encode(to_underlying(Fields::kDeviceNameLastEdit), deviceNameLastEdit); } if (includeSensitive) { - encoder.Encode(to_underlying(Fields::kLocationDescriptorLastEdit), locationDescriptorLastEdit); + encoder.Encode(to_underlying(Fields::kBridgedEndpoint), bridgedEndpoint); + } + if (includeSensitive) + { + encoder.Encode(to_underlying(Fields::kOriginalEndpoint), originalEndpoint); + } + if (includeSensitive) + { + encoder.Encode(to_underlying(Fields::kDeviceTypes), deviceTypes); + } + if (includeSensitive) + { + encoder.Encode(to_underlying(Fields::kUniqueLocationIDs), uniqueLocationIDs); + } + if (includeSensitive) + { + encoder.Encode(to_underlying(Fields::kUniqueLocationIDsLastEdit), uniqueLocationIDsLastEdit); } if (aAccessingFabricIndex.HasValue()) { @@ -28511,17 +28527,33 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kUniqueLocationID)) + if (__context_tag == to_underlying(Fields::kDeviceName)) { - err = DataModel::Decode(reader, uniqueLocationID); + err = DataModel::Decode(reader, deviceName); } - else if (__context_tag == to_underlying(Fields::kLocationDescriptor)) + else if (__context_tag == to_underlying(Fields::kDeviceNameLastEdit)) { - err = DataModel::Decode(reader, locationDescriptor); + err = DataModel::Decode(reader, deviceNameLastEdit); } - else if (__context_tag == to_underlying(Fields::kLocationDescriptorLastEdit)) + else if (__context_tag == to_underlying(Fields::kBridgedEndpoint)) { - err = DataModel::Decode(reader, locationDescriptorLastEdit); + err = DataModel::Decode(reader, bridgedEndpoint); + } + else if (__context_tag == to_underlying(Fields::kOriginalEndpoint)) + { + err = DataModel::Decode(reader, originalEndpoint); + } + else if (__context_tag == to_underlying(Fields::kDeviceTypes)) + { + err = DataModel::Decode(reader, deviceTypes); + } + else if (__context_tag == to_underlying(Fields::kUniqueLocationIDs)) + { + err = DataModel::Decode(reader, uniqueLocationIDs); + } + else if (__context_tag == to_underlying(Fields::kUniqueLocationIDsLastEdit)) + { + err = DataModel::Decode(reader, uniqueLocationIDsLastEdit); } else if (__context_tag == to_underlying(Fields::kFabricIndex)) { @@ -28535,9 +28567,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace EcosystemLocationStruct +} // namespace EcosystemDeviceStruct -namespace EcosystemDeviceStruct { +namespace EcosystemLocationStruct { CHIP_ERROR Type::EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { return DoEncode(aWriter, aTag, NullOptional); @@ -28556,31 +28588,15 @@ CHIP_ERROR Type::DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optiona if (includeSensitive) { - encoder.Encode(to_underlying(Fields::kDeviceName), deviceName); - } - if (includeSensitive) - { - encoder.Encode(to_underlying(Fields::kDeviceNameLastEdit), deviceNameLastEdit); - } - if (includeSensitive) - { - encoder.Encode(to_underlying(Fields::kBridgedEndpoint), bridgedEndpoint); - } - if (includeSensitive) - { - encoder.Encode(to_underlying(Fields::kOriginalEndpoint), originalEndpoint); - } - if (includeSensitive) - { - encoder.Encode(to_underlying(Fields::kDeviceTypes), deviceTypes); + encoder.Encode(to_underlying(Fields::kUniqueLocationID), uniqueLocationID); } if (includeSensitive) { - encoder.Encode(to_underlying(Fields::kUniqueLocationIDs), uniqueLocationIDs); + encoder.Encode(to_underlying(Fields::kLocationDescriptor), locationDescriptor); } if (includeSensitive) { - encoder.Encode(to_underlying(Fields::kUniqueLocationIDsLastEdit), uniqueLocationIDsLastEdit); + encoder.Encode(to_underlying(Fields::kLocationDescriptorLastEdit), locationDescriptorLastEdit); } if (aAccessingFabricIndex.HasValue()) { @@ -28604,33 +28620,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kDeviceName)) - { - err = DataModel::Decode(reader, deviceName); - } - else if (__context_tag == to_underlying(Fields::kDeviceNameLastEdit)) - { - err = DataModel::Decode(reader, deviceNameLastEdit); - } - else if (__context_tag == to_underlying(Fields::kBridgedEndpoint)) - { - err = DataModel::Decode(reader, bridgedEndpoint); - } - else if (__context_tag == to_underlying(Fields::kOriginalEndpoint)) - { - err = DataModel::Decode(reader, originalEndpoint); - } - else if (__context_tag == to_underlying(Fields::kDeviceTypes)) + if (__context_tag == to_underlying(Fields::kUniqueLocationID)) { - err = DataModel::Decode(reader, deviceTypes); + err = DataModel::Decode(reader, uniqueLocationID); } - else if (__context_tag == to_underlying(Fields::kUniqueLocationIDs)) + else if (__context_tag == to_underlying(Fields::kLocationDescriptor)) { - err = DataModel::Decode(reader, uniqueLocationIDs); + err = DataModel::Decode(reader, locationDescriptor); } - else if (__context_tag == to_underlying(Fields::kUniqueLocationIDsLastEdit)) + else if (__context_tag == to_underlying(Fields::kLocationDescriptorLastEdit)) { - err = DataModel::Decode(reader, uniqueLocationIDsLastEdit); + err = DataModel::Decode(reader, locationDescriptorLastEdit); } else if (__context_tag == to_underlying(Fields::kFabricIndex)) { @@ -28644,7 +28644,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace EcosystemDeviceStruct +} // namespace EcosystemLocationStruct } // namespace Structs namespace Commands {} // namespace Commands 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 719c1de9e28975..c5bca7bea6fc21 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 @@ -173,31 +173,6 @@ struct DecodableType }; } // namespace MeasurementAccuracyStruct -namespace LocationDescriptorStruct { -enum class Fields : uint8_t -{ - kLocationName = 0, - kFloorNumber = 1, - kAreaType = 2, -}; - -struct Type -{ -public: - chip::CharSpan locationName; - DataModel::Nullable floorNumber; - DataModel::Nullable areaType; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; -}; - -using DecodableType = Type; - -} // namespace LocationDescriptorStruct namespace DeviceTypeStruct { enum class Fields : uint8_t { @@ -323,6 +298,32 @@ namespace Globals { // Global structs. namespace Structs { +namespace LocationDescriptorStruct { +enum class Fields : uint8_t +{ + kLocationName = 0, + kFloorNumber = 1, + kAreaType = 2, +}; + +struct Type +{ +public: + chip::CharSpan locationName; + DataModel::Nullable floorNumber; + DataModel::Nullable areaType; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace LocationDescriptorStruct + namespace TestGlobalStruct { enum class Fields : uint8_t { @@ -28319,7 +28320,6 @@ struct TypeInfo } // namespace BarrierControl namespace ServiceArea { namespace Structs { -namespace LocationDescriptorStruct = Clusters::detail::Structs::LocationDescriptorStruct; namespace LocationInfoStruct { enum class Fields : uint8_t { @@ -28332,10 +28332,10 @@ enum class Fields : uint8_t struct Type { public: - DataModel::Nullable locationInfo; - DataModel::Nullable landmarkTag; - DataModel::Nullable positionTag; - DataModel::Nullable surfaceTag; + DataModel::Nullable locationInfo; + DataModel::Nullable landmarkTag; + DataModel::Nullable positionTag; + DataModel::Nullable surfaceTag; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -41610,42 +41610,6 @@ struct TypeInfo } // namespace ContentAppObserver namespace EcosystemInformation { namespace Structs { -namespace LocationDescriptorStruct = Clusters::detail::Structs::LocationDescriptorStruct; -namespace EcosystemLocationStruct { -enum class Fields : uint8_t -{ - kUniqueLocationID = 0, - kLocationDescriptor = 1, - kLocationDescriptorLastEdit = 2, - kFabricIndex = 254, -}; - -struct Type -{ -public: - chip::CharSpan uniqueLocationID; - Structs::LocationDescriptorStruct::Type locationDescriptor; - uint64_t locationDescriptorLastEdit = static_cast(0); - chip::FabricIndex fabricIndex = static_cast(0); - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = true; - - auto GetFabricIndex() const { return fabricIndex; } - - void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } - - CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const; - -private: - CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional & aAccessingFabricIndex) const; -}; - -using DecodableType = Type; - -} // namespace EcosystemLocationStruct namespace DeviceTypeStruct = Clusters::detail::Structs::DeviceTypeStruct; namespace EcosystemDeviceStruct { enum class Fields : uint8_t @@ -41707,6 +41671,41 @@ struct DecodableType }; } // namespace EcosystemDeviceStruct +namespace EcosystemLocationStruct { +enum class Fields : uint8_t +{ + kUniqueLocationID = 0, + kLocationDescriptor = 1, + kLocationDescriptorLastEdit = 2, + kFabricIndex = 254, +}; + +struct Type +{ +public: + chip::CharSpan uniqueLocationID; + Globals::Structs::LocationDescriptorStruct::Type locationDescriptor; + uint64_t locationDescriptorLastEdit = static_cast(0); + chip::FabricIndex fabricIndex = static_cast(0); + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = true; + + auto GetFabricIndex() const { return fabricIndex; } + + void SetFabricIndex(chip::FabricIndex fabricIndex_) { fabricIndex = fabricIndex_; } + + CHIP_ERROR EncodeForWrite(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + CHIP_ERROR EncodeForRead(TLV::TLVWriter & aWriter, TLV::Tag aTag, FabricIndex aAccessingFabricIndex) const; + +private: + CHIP_ERROR DoEncode(TLV::TLVWriter & aWriter, TLV::Tag aTag, const Optional & aAccessingFabricIndex) const; +}; + +using DecodableType = Type; + +} // namespace EcosystemLocationStruct } // namespace Structs namespace Attributes { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 8a9766461d448c..32b3967affe64e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -258,7 +258,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::Measu } CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::detail::Structs::LocationDescriptorStruct::Type & request, + chip::app::Clusters::Globals::Structs::LocationDescriptorStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); @@ -289,7 +289,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); } -void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::LocationDescriptorStruct::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::Globals::Structs::LocationDescriptorStruct::Type & request) { ComplexArgumentParser::Finalize(request.locationName); ComplexArgumentParser::Finalize(request.floorNumber); @@ -5560,55 +5560,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentControl::Struct ComplexArgumentParser::Finalize(request.ratingNameDesc); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("EcosystemLocationStruct.uniqueLocationID", "uniqueLocationID", - value.isMember("uniqueLocationID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("EcosystemLocationStruct.locationDescriptor", - "locationDescriptor", value.isMember("locationDescriptor"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("EcosystemLocationStruct.locationDescriptorLastEdit", - "locationDescriptorLastEdit", - value.isMember("locationDescriptorLastEdit"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "uniqueLocationID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.uniqueLocationID, value["uniqueLocationID"])); - valueCopy.removeMember("uniqueLocationID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "locationDescriptor"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.locationDescriptor, value["locationDescriptor"])); - valueCopy.removeMember("locationDescriptor"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "locationDescriptorLastEdit"); - ReturnErrorOnFailure( - ComplexArgumentParser::Setup(labelWithMember, request.locationDescriptorLastEdit, value["locationDescriptorLastEdit"])); - valueCopy.removeMember("locationDescriptorLastEdit"); - - if (value.isMember("fabricIndex")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); - } - valueCopy.removeMember("fabricIndex"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.uniqueLocationID); - ComplexArgumentParser::Finalize(request.locationDescriptor); - ComplexArgumentParser::Finalize(request.locationDescriptorLastEdit); - ComplexArgumentParser::Finalize(request.fabricIndex); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request, Json::Value & value) @@ -5689,6 +5640,55 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::EcosystemInformation:: ComplexArgumentParser::Finalize(request.fabricIndex); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("EcosystemLocationStruct.uniqueLocationID", "uniqueLocationID", + value.isMember("uniqueLocationID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("EcosystemLocationStruct.locationDescriptor", + "locationDescriptor", value.isMember("locationDescriptor"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("EcosystemLocationStruct.locationDescriptorLastEdit", + "locationDescriptorLastEdit", + value.isMember("locationDescriptorLastEdit"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "uniqueLocationID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.uniqueLocationID, value["uniqueLocationID"])); + valueCopy.removeMember("uniqueLocationID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "locationDescriptor"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.locationDescriptor, value["locationDescriptor"])); + valueCopy.removeMember("locationDescriptor"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "locationDescriptorLastEdit"); + ReturnErrorOnFailure( + ComplexArgumentParser::Setup(labelWithMember, request.locationDescriptorLastEdit, value["locationDescriptorLastEdit"])); + valueCopy.removeMember("locationDescriptorLastEdit"); + + if (value.isMember("fabricIndex")) + { + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "fabricIndex"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.fabricIndex, value["fabricIndex"])); + } + valueCopy.removeMember("fabricIndex"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.uniqueLocationID); + ComplexArgumentParser::Finalize(request.locationDescriptor); + ComplexArgumentParser::Finalize(request.locationDescriptorLastEdit); + ComplexArgumentParser::Finalize(request.fabricIndex); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 5bb0718efb81ea..82c9b590eb2920 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -47,10 +47,10 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs static void Finalize(chip::app::Clusters::detail::Structs::MeasurementAccuracyStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::LocationDescriptorStruct::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Globals::Structs::LocationDescriptorStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::detail::Structs::LocationDescriptorStruct::Type & request); +static void Finalize(chip::app::Clusters::Globals::Structs::LocationDescriptorStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::DeviceTypeStruct::Type & request, Json::Value & value); @@ -643,16 +643,16 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentControl: static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request); static CHIP_ERROR Setup(const char * label, - chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request, + chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request); +static void Finalize(chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request); static CHIP_ERROR Setup(const char * label, - chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request, + chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request); +static void Finalize(chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 7fe1851ba370ce..c0b553ca7103bb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -236,7 +236,7 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, } CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::LocationDescriptorStruct::DecodableType & value) + const chip::app::Clusters::Globals::Structs::LocationDescriptorStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -4901,104 +4901,104 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value) + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("UniqueLocationID", indent + 1, value.uniqueLocationID); + CHIP_ERROR err = LogValue("DeviceName", indent + 1, value.deviceName); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationID'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceName'"); return err; } } { - CHIP_ERROR err = LogValue("LocationDescriptor", indent + 1, value.locationDescriptor); + CHIP_ERROR err = LogValue("DeviceNameLastEdit", indent + 1, value.deviceNameLastEdit); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptor'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceNameLastEdit'"); return err; } } { - CHIP_ERROR err = LogValue("LocationDescriptorLastEdit", indent + 1, value.locationDescriptorLastEdit); + CHIP_ERROR err = LogValue("BridgedEndpoint", indent + 1, value.bridgedEndpoint); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptorLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BridgedEndpoint'"); return err; } } { - CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); + CHIP_ERROR err = LogValue("OriginalEndpoint", indent + 1, value.originalEndpoint); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OriginalEndpoint'"); return err; } } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("DeviceName", indent + 1, value.deviceName); + CHIP_ERROR err = LogValue("DeviceTypes", indent + 1, value.deviceTypes); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceName'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceTypes'"); return err; } } { - CHIP_ERROR err = LogValue("DeviceNameLastEdit", indent + 1, value.deviceNameLastEdit); + CHIP_ERROR err = LogValue("UniqueLocationIDs", indent + 1, value.uniqueLocationIDs); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceNameLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDs'"); return err; } } { - CHIP_ERROR err = LogValue("BridgedEndpoint", indent + 1, value.bridgedEndpoint); + CHIP_ERROR err = LogValue("UniqueLocationIDsLastEdit", indent + 1, value.uniqueLocationIDsLastEdit); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'BridgedEndpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDsLastEdit'"); return err; } } { - CHIP_ERROR err = LogValue("OriginalEndpoint", indent + 1, value.originalEndpoint); + CHIP_ERROR err = LogValue("FabricIndex", indent + 1, value.fabricIndex); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'OriginalEndpoint'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'FabricIndex'"); return err; } } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("DeviceTypes", indent + 1, value.deviceTypes); + CHIP_ERROR err = LogValue("UniqueLocationID", indent + 1, value.uniqueLocationID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'DeviceTypes'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationID'"); return err; } } { - CHIP_ERROR err = LogValue("UniqueLocationIDs", indent + 1, value.uniqueLocationIDs); + CHIP_ERROR err = LogValue("LocationDescriptor", indent + 1, value.locationDescriptor); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDs'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptor'"); return err; } } { - CHIP_ERROR err = LogValue("UniqueLocationIDsLastEdit", indent + 1, value.uniqueLocationIDsLastEdit); + CHIP_ERROR err = LogValue("LocationDescriptorLastEdit", indent + 1, value.locationDescriptorLastEdit); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'UniqueLocationIDsLastEdit'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'LocationDescriptorLastEdit'"); return err; } } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 52dede56ab7ec0..c7a0a925fc11f3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -36,7 +36,7 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::MeasurementAccuracyStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::LocationDescriptorStruct::DecodableType & value); + const chip::app::Clusters::Globals::Structs::LocationDescriptorStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::detail::Structs::DeviceTypeStruct::DecodableType & value); @@ -394,13 +394,13 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Structs::RatingNameStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::EcosystemInformation::Structs::EcosystemLocationStruct::DecodableType & value); -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value); From 852368cc067562b9d6131aff9689e1830aba3944 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 2 Aug 2024 14:41:41 -0400 Subject: [PATCH 38/40] Define an `ActionReturnStatus` for DataModel::Provider action returns (#34708) * In progress * ActionReturnStatus implementation * Start making use of ActionReturnStatus * Things seem to compile (but not yet passing) * nice log formatting * Propper formatting and comparisons in tests. Mock tests pass * Restyle * Restyle * Fix typo * Add missing files * Added some unit tests that pass * More tests * Restyle * Update src/app/codegen-data-model-provider/EmberMetadata.cpp Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/ActionReturnStatus.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/ActionReturnStatus.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/ActionReturnStatus.h Co-authored-by: Boris Zbarsky * Update src/lib/core/CHIPError.h Co-authored-by: Boris Zbarsky * Rename IsOutOfSpaceError and do not document specifics * Document invoke return codes * Use the new out of space method in checked * Restyle * Allow ClusterStatusCode to be constructed from a CHIP_ERROR * Format action statuses as c_str. HOWEVER this wastes 32 bytes of BSS * Fix error formatting * Restyle * Fix includes to be system paths * Update src/app/data-model-provider/Provider.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/Provider.h Co-authored-by: Boris Zbarsky * Fix status success and chip_no_error equivalence and add unit tests * Added more tests --------- Co-authored-by: Andrei Litvin Co-authored-by: Boris Zbarsky --- .../CodegenDataModelProvider.cpp | 4 +- .../CodegenDataModelProvider.h | 11 +- .../CodegenDataModelProvider_Read.cpp | 15 +- .../CodegenDataModelProvider_Write.cpp | 34 +-- .../EmberMetadata.cpp | 14 +- .../EmberMetadata.h | 15 +- .../tests/BUILD.gn | 5 +- .../tests/TestCodegenModelViaMocks.cpp | 55 ++--- .../ActionReturnStatus.cpp | 199 ++++++++++++++++++ .../data-model-provider/ActionReturnStatus.h | 97 +++++++++ src/app/data-model-provider/BUILD.gn | 16 ++ src/app/data-model-provider/Provider.h | 38 ++-- .../StringBuilderAdapters.cpp | 29 +++ .../StringBuilderAdapters.h | 46 ++++ src/app/data-model-provider/tests/BUILD.gn | 6 +- .../tests/TestActionReturnStatus.cpp | 113 ++++++++++ src/app/reporting/Engine.cpp | 18 +- src/app/reporting/Read-Checked.cpp | 29 +-- src/app/reporting/Read-Checked.h | 8 +- src/app/reporting/Read-DataModel.cpp | 32 ++- src/app/reporting/Read-DataModel.h | 9 +- src/app/reporting/Read-Ember.cpp | 8 +- src/app/reporting/Read-Ember.h | 8 +- src/app/tests/test-interaction-model-api.cpp | 9 +- src/app/tests/test-interaction-model-api.h | 10 +- .../tests/data_model/DataModelFixtures.cpp | 8 +- .../tests/data_model/DataModelFixtures.h | 10 +- src/lib/core/CHIPError.h | 10 + .../interaction_model/StatusCode.cpp | 24 +++ src/protocols/interaction_model/StatusCode.h | 1 + 30 files changed, 729 insertions(+), 152 deletions(-) create mode 100644 src/app/data-model-provider/ActionReturnStatus.cpp create mode 100644 src/app/data-model-provider/ActionReturnStatus.h create mode 100644 src/app/data-model-provider/StringBuilderAdapters.cpp create mode 100644 src/app/data-model-provider/StringBuilderAdapters.h create mode 100644 src/app/data-model-provider/tests/TestActionReturnStatus.cpp diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp index e3b9823efeef9a..cea75c8d0c1ccc 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp @@ -229,8 +229,8 @@ bool CodegenDataModelProvider::EmberCommandListIterator::Exists(const CommandId return (*mCurrentHint == toCheck); } -CHIP_ERROR CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, TLV::TLVReader & input_arguments, - CommandHandler * handler) +DataModel::ActionReturnStatus CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, + TLV::TLVReader & input_arguments, CommandHandler * handler) { // TODO: CommandHandlerInterface support is currently // residing in InteractionModelEngine itself. We may want to separate this out diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.h b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h index 21dc0cc87e1a31..b486b953976328 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.h +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h @@ -16,6 +16,7 @@ */ #pragma once +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -68,10 +69,12 @@ class CodegenDataModelProvider : public chip::app::DataModel::Provider /// Generic model implementations CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override; + DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) override; + DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) override; /// attribute tree iteration EndpointId FirstEndpoint() override; diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp index d27d18964dccf7..6ff4b730812d16 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Read.cpp @@ -47,7 +47,9 @@ namespace chip { namespace app { namespace { + using namespace chip::app::Compatibility::Internal; +using Protocols::InteractionModel::Status; /// Attempts to read via an attribute access interface (AAI) /// @@ -258,7 +260,8 @@ CHIP_ERROR EncodeEmberValue(ByteSpan data, const EmberAfAttributeMetadata * meta /// - validate ACL (only for non-internal requests) /// - Try to read attribute via the AttributeAccessInterface /// - Try to read the value from ember RAM storage -CHIP_ERROR CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) +DataModel::ActionReturnStatus CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) { ChipLogDetail(DataManagement, "Reading attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI " (expanded=%d)", @@ -290,12 +293,12 @@ CHIP_ERROR CodegenDataModelProvider::ReadAttribute(const DataModel::ReadAttribut auto metadata = Ember::FindAttributeMetadata(request.path); // Explicit failure in finding a suitable metadata - if (const CHIP_ERROR * err = std::get_if(&metadata)) + if (const Status * status = std::get_if(&metadata)) { - VerifyOrDie((*err == CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute))); - return *err; + VerifyOrDie((*status == Status::UnsupportedEndpoint) || // + (*status == Status::UnsupportedCluster) || // + (*status == Status::UnsupportedAttribute)); + return *status; } // Read via AAI diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp index 962355e8e47b08..925d5cce61bc87 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp @@ -43,6 +43,7 @@ namespace app { namespace { using namespace chip::app::Compatibility::Internal; +using Protocols::InteractionModel::Status; /// Attempts to write via an attribute access interface (AAI) /// @@ -266,8 +267,8 @@ CHIP_ERROR DecodeValueIntoEmberBuffer(AttributeValueDecoder & decoder, const Emb } // namespace -CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttributeRequest & request, - AttributeValueDecoder & decoder) +DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) { ChipLogDetail(DataManagement, "Writing attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI, ChipLogValueMEI(request.path.mClusterId), request.path.mEndpointId, ChipLogValueMEI(request.path.mAttributeId)); @@ -275,7 +276,7 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib // ACL check for non-internal requests if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { - ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); + ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), Status::UnsupportedAccess); Access::RequestPath requestPath{ .cluster = request.path.mClusterId, .endpoint = request.path.mEndpointId }; CHIP_ERROR err = Access::GetAccessControl().Check(*request.subjectDescriptor, requestPath, @@ -286,18 +287,19 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib ReturnErrorCodeIf(err != CHIP_ERROR_ACCESS_DENIED, err); // TODO: when wildcard/group writes are supported, handle them to discard rather than fail with status - return CHIP_IM_GLOBAL_STATUS(UnsupportedAccess); + return Status::UnsupportedAccess; } } auto metadata = Ember::FindAttributeMetadata(request.path); - if (const CHIP_ERROR * err = std::get_if(&metadata)) + // Explicit failure in finding a suitable metadata + if (const Status * status = std::get_if(&metadata)) { - VerifyOrDie((*err == CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)) || // - (*err == CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute))); - return *err; + VerifyOrDie((*status == Status::UnsupportedEndpoint) || // + (*status == Status::UnsupportedCluster) || // + (*status == Status::UnsupportedAttribute)); + return *status; } const EmberAfAttributeMetadata ** attributeMetadata = std::get_if(&metadata); @@ -316,15 +318,15 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib // Internal is allowed to bypass timed writes and read-only. if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { - VerifyOrReturnError(!isReadOnly, CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + VerifyOrReturnError(!isReadOnly, Status::UnsupportedWrite); VerifyOrReturnError(!(*attributeMetadata)->MustUseTimedWrite() || request.writeFlags.Has(DataModel::WriteFlags::kTimed), - CHIP_IM_GLOBAL_STATUS(NeedsTimedInteraction)); + Status::NeedsTimedInteraction); } // Extra check: internal requests can bypass the read only check, however global attributes // have no underlying storage, so write still cannot be done - VerifyOrReturnError(attributeMetadata != nullptr, CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + VerifyOrReturnError(attributeMetadata != nullptr, Status::UnsupportedWrite); if (request.path.mDataVersion.HasValue()) { @@ -333,14 +335,14 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib { ChipLogError(DataManagement, "Unable to get cluster info for Endpoint 0x%x, Cluster " ChipLogFormatMEI, request.path.mEndpointId, ChipLogValueMEI(request.path.mClusterId)); - return CHIP_IM_GLOBAL_STATUS(DataVersionMismatch); + return Status::DataVersionMismatch; } if (request.path.mDataVersion.Value() != clusterInfo->dataVersion) { ChipLogError(DataManagement, "Write Version mismatch for Endpoint 0x%x, Cluster " ChipLogFormatMEI, request.path.mEndpointId, ChipLogValueMEI(request.path.mClusterId)); - return CHIP_IM_GLOBAL_STATUS(DataVersionMismatch); + return Status::DataVersionMismatch; } } @@ -367,7 +369,7 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib if (dataBuffer.size() > (*attributeMetadata)->size) { ChipLogDetail(Zcl, "Data to write exceeds the attribute size claimed."); - return CHIP_IM_GLOBAL_STATUS(InvalidValue); + return Status::InvalidValue; } if (request.operationFlags.Has(DataModel::OperationFlags::kInternal)) @@ -386,7 +388,7 @@ CHIP_ERROR CodegenDataModelProvider::WriteAttribute(const DataModel::WriteAttrib if (status != Protocols::InteractionModel::Status::Success) { - return CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status); + return status; } // TODO: this WILL requre updates diff --git a/src/app/codegen-data-model-provider/EmberMetadata.cpp b/src/app/codegen-data-model-provider/EmberMetadata.cpp index b8d998d29f0b7e..69f9e3e889369c 100644 --- a/src/app/codegen-data-model-provider/EmberMetadata.cpp +++ b/src/app/codegen-data-model-provider/EmberMetadata.cpp @@ -24,9 +24,11 @@ namespace chip { namespace app { namespace Ember { +using Protocols::InteractionModel::Status; + std::variant FindAttributeMetadata(const ConcreteAttributePath & aPath) { @@ -41,8 +43,8 @@ FindAttributeMetadata(const ConcreteAttributePath & aPath) const EmberAfCluster * cluster = emberAfFindServerCluster(aPath.mEndpointId, aPath.mClusterId); if (cluster == nullptr) { - return (emberAfFindEndpointType(aPath.mEndpointId) == nullptr) ? CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint) - : CHIP_IM_GLOBAL_STATUS(UnsupportedCluster); + return (emberAfFindEndpointType(aPath.mEndpointId) == nullptr) ? Status::UnsupportedEndpoint + : Status::UnsupportedCluster; } return cluster; @@ -57,18 +59,18 @@ FindAttributeMetadata(const ConcreteAttributePath & aPath) const EmberAfEndpointType * type = emberAfFindEndpointType(aPath.mEndpointId); if (type == nullptr) { - return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); + return Status::UnsupportedEndpoint; } const EmberAfCluster * cluster = emberAfFindClusterInType(type, aPath.mClusterId, CLUSTER_MASK_SERVER); if (cluster == nullptr) { - return CHIP_IM_GLOBAL_STATUS(UnsupportedCluster); + return Status::UnsupportedCluster; } // Since we know the attribute is unsupported and the endpoint/cluster are // OK, this is the only option left. - return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); + return Status::UnsupportedAttribute; } return metadata; diff --git a/src/app/codegen-data-model-provider/EmberMetadata.h b/src/app/codegen-data-model-provider/EmberMetadata.h index f8f41312f1f7c9..64c0bfe736a25f 100644 --- a/src/app/codegen-data-model-provider/EmberMetadata.h +++ b/src/app/codegen-data-model-provider/EmberMetadata.h @@ -18,6 +18,7 @@ #include #include +#include #include @@ -31,13 +32,13 @@ namespace Ember { /// Possible return values: /// - EmberAfCluster (NEVER null) - Only for GlobalAttributesNotInMetaData /// - EmberAfAttributeMetadata (NEVER null) - if the attribute is known to ember datastore -/// - CHIP_ERROR, only specifically for unknown attributes, may only be one of: -/// - CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); -/// - CHIP_IM_GLOBAL_STATUS(UnsupportedCluster); -/// - CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute); -std::variant FindAttributeMetadata(const ConcreteAttributePath & aPath); diff --git a/src/app/codegen-data-model-provider/tests/BUILD.gn b/src/app/codegen-data-model-provider/tests/BUILD.gn index 451a276c0367d2..247685a91a0e7b 100644 --- a/src/app/codegen-data-model-provider/tests/BUILD.gn +++ b/src/app/codegen-data-model-provider/tests/BUILD.gn @@ -57,5 +57,8 @@ chip_test_suite("tests") { cflags = [ "-Wconversion" ] - public_deps = [ ":mock_model" ] + public_deps = [ + ":mock_model", + "${chip_root}/src/app/data-model-provider:string-builder-adapters", + ] } diff --git a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp index 947d0aecd9684d..a8862bd9036963 100644 --- a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp @@ -19,9 +19,6 @@ #include -#include "app/ConcreteCommandPath.h" -#include - #include #include #include @@ -35,9 +32,12 @@ #include #include #include +#include #include #include +#include #include +#include #include #include #include @@ -58,6 +58,7 @@ #include #include #include +#include using namespace chip; using namespace chip::Test; @@ -65,6 +66,8 @@ using namespace chip::app; using namespace chip::app::DataModel; using namespace chip::app::Clusters::Globals::Attributes; +using chip::Protocols::InteractionModel::Status; + namespace { constexpr FabricIndex kTestFabrixIndex = kMinValidFabricIndex; @@ -787,7 +790,7 @@ void TestEmberScalarTypeWrite(const typename NumericAttributeTraits::WorkingT AttributeValueDecoder decoder = test.DecoderFor(value); // write should succeed - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_NO_ERROR); + ASSERT_TRUE(model.WriteAttribute(test.request, decoder).IsSuccess()); // Validate data after write chip::ByteSpan writtenData = Test::GetEmberBuffer(); @@ -844,7 +847,7 @@ void TestEmberScalarNullWrite() AttributeValueDecoder decoder = test.DecoderFor(NullableType()); // write should succeed - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_NO_ERROR); + ASSERT_TRUE(model.WriteAttribute(test.request, decoder).IsSuccess()); // Validate data after write chip::ByteSpan writtenData = Test::GetEmberBuffer(); @@ -1298,7 +1301,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadAclDeny) ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedAccess); } TEST(TestCodegenModelViaMocks, ReadForInvalidGlobalAttributePath) @@ -1311,14 +1314,14 @@ TEST(TestCodegenModelViaMocks, ReadForInvalidGlobalAttributePath) TestReadRequest testRequest(kAdminSubjectDescriptor, ConcreteAttributePath(kEndpointIdThatIsMissing, MockClusterId(1), AttributeList::Id)); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedEndpoint); } { TestReadRequest testRequest(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, kInvalidClusterId, AttributeList::Id)); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedCluster); } } @@ -1334,7 +1337,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedAttribute); } // Invalid cluster @@ -1343,7 +1346,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) ConcreteAttributePath(kMockEndpoint1, MockClusterId(100), MockAttributeId(1))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedCluster); } // Invalid endpoint @@ -1352,7 +1355,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeInvalidRead) ConcreteAttributePath(kEndpointIdThatIsMissing, MockClusterId(1), MockAttributeId(1))); std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::UnsupportedEndpoint); } } @@ -1494,7 +1497,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadErrorReading) // Actual read via an encoder std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(Failure)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::Failure); } { @@ -1507,7 +1510,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeReadErrorReading) // Actual read via an encoder std::unique_ptr encoder = testRequest.StartEncoding(&model); - ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), CHIP_IM_GLOBAL_STATUS(Busy)); + ASSERT_EQ(model.ReadAttribute(testRequest.request, *encoder), Status::Busy); } // reset things to success to not affect other tests @@ -1994,7 +1997,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteAclDeny) TestWriteRequest test(kDenySubjectDescriptor, ConcreteDataAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAccess)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedAccess); ASSERT_TRUE(model.ChangeListener().DirtyList().empty()); } @@ -2065,7 +2068,7 @@ TEST(TestCodegenModelViaMocks, EmberTestWriteReservedNullPlaceholderToNullable) AttributeValueDecoder decoder = test.DecoderFor(0xFFFFFFFF); // write should fail: we are trying to write null which is out of range - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(ConstraintError)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::ConstraintError); } TEST(TestCodegenModelViaMocks, EmberTestWriteOutOfRepresentableRangeOddIntegerNonNullable) @@ -2173,7 +2176,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongStringOutOfBounds) AttributeValueDecoder decoder = test.DecoderFor( "this is a very long string that will be longer than the default attribute size for our mocks"_span); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(InvalidValue)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::InvalidValue); } TEST(TestCodegenModelViaMocks, EmberAttributeWriteLongString) @@ -2292,7 +2295,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteTimedWrite) TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), kAttributeIdTimedWrite)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(NeedsTimedInteraction)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::NeedsTimedInteraction); // writing as timed should be fine test.request.writeFlags.Set(WriteFlags::kTimed); @@ -2308,7 +2311,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteReadOnlyAttribute) TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), kAttributeIdReadOnly)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedWrite); // Internal writes bypass the read only requirement test.request.operationFlags.Set(OperationFlags::kInternal); @@ -2335,7 +2338,7 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteDataVersion) AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(DataVersionMismatch)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::DataVersionMismatch); // Write passes if we set the right version for the data test.request.path.mDataVersion = MakeOptional(GetVersion()); @@ -2351,18 +2354,18 @@ TEST(TestCodegenModelViaMocks, WriteToInvalidPath) { TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kInvalidEndpointId, MockClusterId(1234), 1234)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedEndpoint); } { TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1234), 1234)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedCluster)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedCluster); } { TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), 1234)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedAttribute); } } @@ -2374,7 +2377,7 @@ TEST(TestCodegenModelViaMocks, WriteToGlobalAttribute) TestWriteRequest test(kAdminSubjectDescriptor, ConcreteAttributePath(kMockEndpoint1, MockClusterId(1), AttributeList::Id)); AttributeValueDecoder decoder = test.DecoderFor(1234); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedWrite); } TEST(TestCodegenModelViaMocks, EmberWriteFailure) @@ -2390,12 +2393,12 @@ TEST(TestCodegenModelViaMocks, EmberWriteFailure) { AttributeValueDecoder decoder = test.DecoderFor(1234); chip::Test::SetEmberReadOutput(Protocols::InteractionModel::Status::Failure); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(Failure)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::Failure); } { AttributeValueDecoder decoder = test.DecoderFor(1234); chip::Test::SetEmberReadOutput(Protocols::InteractionModel::Status::Busy); - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(Busy)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::Busy); } // reset things to success to not affect other tests chip::Test::SetEmberReadOutput(ByteSpan()); @@ -2524,6 +2527,6 @@ TEST(TestCodegenModelViaMocks, EmberWriteInvalidDataType) // Embed specifically DOES NOT support structures. // Without AAI, we expect a data type error (translated to failure) - ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_IM_GLOBAL_STATUS(Failure)); + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::Failure); ASSERT_TRUE(model.ChangeListener().DirtyList().empty()); } diff --git a/src/app/data-model-provider/ActionReturnStatus.cpp b/src/app/data-model-provider/ActionReturnStatus.cpp new file mode 100644 index 00000000000000..7857246a0e861f --- /dev/null +++ b/src/app/data-model-provider/ActionReturnStatus.cpp @@ -0,0 +1,199 @@ +/* + * 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 +#include +#include +#include +#include + +#include + +namespace chip { +namespace app { +namespace DataModel { + +using Protocols::InteractionModel::ClusterStatusCode; +using Protocols::InteractionModel::Status; + +namespace { + +bool StatusIsTheSameAsError(const ClusterStatusCode & status, const CHIP_ERROR & err) +{ + auto cluster_code = status.GetClusterSpecificCode(); + if (!cluster_code.HasValue()) + { + // there exist Status::Success, however that may not be encoded + // as a CHIP_ERROR_IM_GLOBAL_STATUS_VALUE as it is just as well a CHIP_NO_ERROR. + // handle that separately + if ((status.GetStatus() == Status::Success) && (err == CHIP_NO_ERROR)) + { + return true; + } + + return err == CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status.GetStatus()); + } + + if (status.GetStatus() != Status::Failure) + { + return false; + } + + return err == CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(cluster_code.Value()); +} + +} // namespace + +bool ActionReturnStatus::operator==(const ActionReturnStatus & other) const +{ + if (mReturnStatus == other.mReturnStatus) + { + return true; + } + + const ClusterStatusCode * thisStatus = std::get_if(&mReturnStatus); + const ClusterStatusCode * otherStatus = std::get_if(&other.mReturnStatus); + + const CHIP_ERROR * thisErr = std::get_if(&mReturnStatus); + const CHIP_ERROR * otherErr = std::get_if(&other.mReturnStatus); + + if (thisStatus && otherErr) + { + return StatusIsTheSameAsError(*thisStatus, *otherErr); + } + + if (otherStatus && thisErr) + { + return StatusIsTheSameAsError(*otherStatus, *thisErr); + } + + return false; +} + +CHIP_ERROR ActionReturnStatus::GetUnderlyingError() const +{ + + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return *err; + } + + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { + if (status->IsSuccess()) + { + return CHIP_NO_ERROR; + } + + chip::Optional code = status->GetClusterSpecificCode(); + + return code.HasValue() ? CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(code.Value()) + : CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status->GetStatus()); + } + + chipDie(); +} + +ClusterStatusCode ActionReturnStatus::GetStatusCode() const +{ + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { + return *status; + } + + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return ClusterStatusCode(*err); + } + + // all std::variant cases exhausted + chipDie(); +} + +bool ActionReturnStatus::IsSuccess() const +{ + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return (*err == CHIP_NO_ERROR); + } + + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { + return status->IsSuccess(); + } + + // all std::variant cases exhausted + chipDie(); +} + +bool ActionReturnStatus::IsOutOfSpaceEncodingResponse() const +{ + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { + return (*err == CHIP_ERROR_NO_MEMORY) || (*err == CHIP_ERROR_BUFFER_TOO_SMALL); + } + + return false; +} + +const char * ActionReturnStatus::c_str() const +{ + + // Generally size should be sufficient. + // len("Status<123>, Code 255") == 21 (and then 22 for null terminator. We have slack.) + static chip::StringBuilder<32> sFormatBuffer; + + if (const CHIP_ERROR * err = std::get_if(&mReturnStatus)) + { +#if CHIP_CONFIG_ERROR_FORMAT_AS_STRING + return err->Format(); // any length +#else + sFormatBuffer.Reset().AddFormat("%" CHIP_ERROR_FORMAT, err->Format()); + return sFormatBuffer.c_str(); +#endif + } + + if (const ClusterStatusCode * status = std::get_if(&mReturnStatus)) + { +#if CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT + sFormatBuffer.AddFormat("%s(%d)", Protocols::InteractionModel::StatusName(status->GetStatus()), + static_cast(status->GetStatus())); +#else + if (status->IsSuccess()) + { + sFormatBuffer.Add("Success"); + } + else + { + sFormatBuffer.AddFormat("Status<%d>", static_cast(status->GetStatus())); + } +#endif + + chip::Optional clusterCode = status->GetClusterSpecificCode(); + if (clusterCode.HasValue()) + { + sFormatBuffer.AddFormat(", Code %d", static_cast(clusterCode.Value())); + } + return sFormatBuffer.c_str(); + } + + // all std::variant cases exhausted + chipDie(); +} + +} // namespace DataModel +} // namespace app +} // namespace chip diff --git a/src/app/data-model-provider/ActionReturnStatus.h b/src/app/data-model-provider/ActionReturnStatus.h new file mode 100644 index 00000000000000..516541483ad068 --- /dev/null +++ b/src/app/data-model-provider/ActionReturnStatus.h @@ -0,0 +1,97 @@ +/* + * 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 + +#include + +namespace chip { +namespace app { +namespace DataModel { + +/// An ActionReturnStatus encodes the result of a read/write/invoke. +/// +/// Generally such actions result in a StatusIB in the interaction model, +/// which is a code (InteractionModel::Status) and may have an associated +/// cluster-specific code. +/// +/// However some actions specifically may return additional information for +/// chunking, hence the existence of this class: +/// +/// - encapsulates a ClusterStatusCode for an actual action result +/// - encapsulates a underlying CHIP_ERROR for reporting purposes +/// - has a way to check for "chunking needed" status. +/// +/// The class is directly constructible from statuses (non-exlicit) to make +/// returning of values easy. +class ActionReturnStatus +{ +public: + ActionReturnStatus(CHIP_ERROR error) : mReturnStatus(error) {} + ActionReturnStatus(Protocols::InteractionModel::Status status) : + mReturnStatus(Protocols::InteractionModel::ClusterStatusCode(status)) + {} + ActionReturnStatus(Protocols::InteractionModel::ClusterStatusCode status) : mReturnStatus(status) {} + + /// Constructs a status code. Either returns the underlying code directly + /// or converts the underlying CHIP_ERROR into a cluster status code. + Protocols::InteractionModel::ClusterStatusCode GetStatusCode() const; + + /// Gets the underlying CHIP_ERROR if it exists, otherwise it will + /// return a CHIP_ERROR corresponding to the underlying return status. + /// + /// Success statusess will result in CHIP_NO_ERROR (i.e. cluster specitic success codes are lost) + CHIP_ERROR GetUnderlyingError() const; + + /// If this is a CHIP_NO_ERROR or a Status::Success + bool IsSuccess() const; + + /// Considers if the underlying error is an error or not (CHIP_NO_ERROR is the only non-erro) + /// or if the underlying statuscode is not an error (success and cluster specific successes + /// are not an error). + bool IsError() const { return !IsSuccess(); } + + /// Checks if the underlying error is an out of space condition (i.e. something that + /// chunking can handle by sending partial list data). + /// + /// Generally this is when the return is based on CHIP_ERROR_NO_MEMORY or CHIP_ERROR_BUFFER_TOO_SMALL + bool IsOutOfSpaceEncodingResponse() const; + + // NOTE: operator== will treat a CHIP_GLOBAL_IM_ERROR and a raw cluster status as equal if the statuses match, + // even though a CHIP_ERROR has some formatting info like file/line + bool operator==(const ActionReturnStatus & other) const; + bool operator!=(const ActionReturnStatus & other) const { return !(*this == other); } + + /// Get the formatted string of this status. + /// + /// NOTE: this is NOT thread safe in the general case, however the safety guarantees + /// are similar to chip::ErrorStr which also assumes a static buffer. + /// + /// Use this in the chip main event loop (and since that is a single thread, + /// there should be no races) + const char * c_str() const; + +private: + std::variant mReturnStatus; +}; + +} // namespace DataModel +} // namespace app +} // namespace chip diff --git a/src/app/data-model-provider/BUILD.gn b/src/app/data-model-provider/BUILD.gn index 5093cce2f4124d..40f34db127d501 100644 --- a/src/app/data-model-provider/BUILD.gn +++ b/src/app/data-model-provider/BUILD.gn @@ -12,10 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") source_set("data-model-provider") { sources = [ "ActionContext.h", + "ActionReturnStatus.cpp", + "ActionReturnStatus.h", "Context.h", "EventsGenerator.h", "MetadataTypes.cpp", @@ -40,3 +43,16 @@ source_set("data-model-provider") { "${chip_root}/src/messaging", ] } + +source_set("string-builder-adapters") { + sources = [ + "StringBuilderAdapters.cpp", + "StringBuilderAdapters.h", + ] + + public_deps = [ + ":data-model-provider", + "$dir_pw_string", + "${chip_root}/src/lib/core:string-builder-adapters", + ] +} diff --git a/src/app/data-model-provider/Provider.h b/src/app/data-model-provider/Provider.h index f5d550c806fd89..f38568319eb425 100644 --- a/src/app/data-model-provider/Provider.h +++ b/src/app/data-model-provider/Provider.h @@ -16,6 +16,7 @@ */ #pragma once +#include "lib/core/CHIPError.h" #include #include @@ -23,6 +24,7 @@ #include #include +#include #include #include #include @@ -66,18 +68,12 @@ class Provider : public ProviderMetadataTree /// > Else if reading from the attribute in the path requires a privilege that is not /// granted to access the cluster in the path, then the path SHALL be discarded. /// - /// Return codes: - /// CHIP_ERROR_NO_MEMORY or CHIP_ERROR_BUFFER_TOO_SMALL: + /// Return value notes: + /// ActionReturnStatus::IsOutOfSpaceEncodingResponse /// - Indicates that list encoding had insufficient buffer space to encode elements. /// - encoder::GetState().AllowPartialData() determines if these errors are permanent (no partial /// data allowed) or further encoding can be retried (AllowPartialData true for list encoding) - /// CHIP_IM_GLOBAL_STATUS(code): - /// - error codes that are translatable in IM status codes (otherwise we expect Failure to be reported) - /// - to check for this, CHIP_ERROR provides: - /// - ::IsPart(ChipError::SdkPart::kIMGlobalStatus) -> bool - /// - ::GetSdkCode() -> uint8_t to translate to the actual code - /// other internal falures - virtual CHIP_ERROR ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) = 0; + virtual ActionReturnStatus ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) = 0; /// Requests a write of an attribute. /// @@ -89,19 +85,21 @@ class Provider : public ProviderMetadataTree /// - ACL validation (see notes on OperationFlags::kInternal) /// - Validation of readability/writability (also controlled by OperationFlags::kInternal) /// - Validation of timed interaction required (also controlled by OperationFlags::kInternal) - /// - /// Return codes - /// CHIP_IM_GLOBAL_STATUS(code): - /// - error codes that are translatable to specific IM codes - /// - in particular, the following codes are interesting/expected - /// - `UnsupportedWrite` for attempts to write read-only data - /// - `UnsupportedAccess` for ACL failures - /// - `NeedsTimedInteraction` for writes that are not timed however are required to be so - virtual CHIP_ERROR WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) = 0; + virtual ActionReturnStatus WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) = 0; /// `handler` is used to send back the reply. - /// - returning a value other than CHIP_NO_ERROR implies an error reply (error and data are mutually exclusive) - virtual CHIP_ERROR Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) = 0; + /// - returning a value other than Success implies an error reply (error and data are mutually exclusive) + /// + /// Returning anything other than CHIP_NO_ERROR or Status::Success (i.e. success without a return code) + /// means that the invoke will be considered to be returning the given path-specific status WITHOUT any data (any data + /// that was sent via CommandHandler is to be rolled back/discarded). + /// + /// This is because only one of the following may be encoded in a response: + /// - data (as CommandDataIB) which is assumed a "response as a success" + /// - status (as a CommandStatusIB) which is considered a final status, usually an error however + /// cluster-specific success statuses also exist. + virtual ActionReturnStatus Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) = 0; private: InteractionModelContext mContext = { nullptr }; diff --git a/src/app/data-model-provider/StringBuilderAdapters.cpp b/src/app/data-model-provider/StringBuilderAdapters.cpp new file mode 100644 index 00000000000000..93ad9863fc9762 --- /dev/null +++ b/src/app/data-model-provider/StringBuilderAdapters.cpp @@ -0,0 +1,29 @@ +/* + * 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 + +#include + +namespace pw { + +template <> +StatusWithSize ToString(const chip::app::DataModel::ActionReturnStatus & status, + pw::span buffer) +{ + return pw::string::Format(buffer, "ActionReturnStatus<%s>", status.c_str()); +} + +} // namespace pw diff --git a/src/app/data-model-provider/StringBuilderAdapters.h b/src/app/data-model-provider/StringBuilderAdapters.h new file mode 100644 index 00000000000000..32da18f43f1681 --- /dev/null +++ b/src/app/data-model-provider/StringBuilderAdapters.h @@ -0,0 +1,46 @@ +/* + * 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 + +/// This header includes pigweed stringbuilder adaptations for various chip types. +/// You can see https://pigweed.dev/pw_string/guide.html as a reference. +/// +/// In particular, pigweed code generally looks like: +/// +/// pw::StringBuffer<42> sb; +/// sb << "Here is a value: "; +/// sb << value; +/// +/// Where specific formatters exist for "value". In particular these are used when +/// reporting unit test assertions such as ASSERT_EQ/EXPECT_EQ so if you write code +/// like: +/// +/// ASSERT_EQ(SomeCall(), CHIP_NO_ERROR); +/// +/// On failure without adapters, the objects are reported as "24-byte object at 0x....." +/// which is not as helpful as a full formatted output. + +#include + +#include + +namespace pw { + +template <> +StatusWithSize ToString(const chip::app::DataModel::ActionReturnStatus & status, + pw::span buffer); + +} // namespace pw diff --git a/src/app/data-model-provider/tests/BUILD.gn b/src/app/data-model-provider/tests/BUILD.gn index 23107b9b5b1fd8..9829a2f4622514 100644 --- a/src/app/data-model-provider/tests/BUILD.gn +++ b/src/app/data-model-provider/tests/BUILD.gn @@ -17,12 +17,16 @@ import("${chip_root}/build/chip/chip_test_suite.gni") chip_test_suite("tests") { output_name = "libIMInterfaceTests" - test_sources = [ "TestEventEmitting.cpp" ] + test_sources = [ + "TestActionReturnStatus.cpp", + "TestEventEmitting.cpp", + ] cflags = [ "-Wconversion" ] public_deps = [ "${chip_root}/src/app/data-model-provider", + "${chip_root}/src/app/data-model-provider:string-builder-adapters", "${chip_root}/src/lib/core:string-builder-adapters", ] } diff --git a/src/app/data-model-provider/tests/TestActionReturnStatus.cpp b/src/app/data-model-provider/tests/TestActionReturnStatus.cpp new file mode 100644 index 00000000000000..a194c0838d7d12 --- /dev/null +++ b/src/app/data-model-provider/tests/TestActionReturnStatus.cpp @@ -0,0 +1,113 @@ +/* + * + * 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 "lib/core/CHIPError.h" +#include "protocols/interaction_model/StatusCode.h" +#include "pw_unit_test/framework_backend.h" +#include +#include +#include + +#include + +using chip::app::DataModel::ActionReturnStatus; +using chip::Protocols::InteractionModel::ClusterStatusCode; +using chip::Protocols::InteractionModel::Status; + +TEST(TestActionReturnStatus, TestEquality) +{ + // equality should happen between equivalent statuses and chip_errors + ASSERT_EQ(ActionReturnStatus(Status::UnsupportedRead), Status::UnsupportedRead); + ASSERT_EQ(ActionReturnStatus(Status::UnsupportedWrite), CHIP_IM_GLOBAL_STATUS(UnsupportedWrite)); + + ASSERT_EQ(ActionReturnStatus(CHIP_IM_GLOBAL_STATUS(Busy)), Status::Busy); + ASSERT_EQ(ActionReturnStatus(CHIP_IM_GLOBAL_STATUS(Busy)), CHIP_IM_GLOBAL_STATUS(Busy)); + + ASSERT_EQ(ActionReturnStatus(CHIP_IM_CLUSTER_STATUS(123)), CHIP_IM_CLUSTER_STATUS(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)), CHIP_IM_CLUSTER_STATUS(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)), ClusterStatusCode::ClusterSpecificFailure(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)), ClusterStatusCode::ClusterSpecificSuccess(123)); + + // Successes (without cluster-specific codes) are equivalent + ASSERT_EQ(ActionReturnStatus(Status::Success), Status::Success); + ASSERT_EQ(ActionReturnStatus(CHIP_NO_ERROR), Status::Success); + ASSERT_EQ(ActionReturnStatus(Status::Success), CHIP_NO_ERROR); + + // status specific success is has more data, so there is no equality (i.e. an action return + // with specific success codes has more data than a simple success) + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)), Status::Success); + ASSERT_NE(ActionReturnStatus(CHIP_NO_ERROR), ClusterStatusCode::ClusterSpecificSuccess(123)); + ASSERT_NE(ActionReturnStatus(Status::Success), ClusterStatusCode::ClusterSpecificSuccess(123)); + + // things that are just not equal + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(11)), ClusterStatusCode::ClusterSpecificSuccess(22)); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(11)), ClusterStatusCode::ClusterSpecificSuccess(11)); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(11)), ClusterStatusCode::ClusterSpecificFailure(22)); + ASSERT_NE(ActionReturnStatus(CHIP_NO_ERROR), CHIP_ERROR_NOT_FOUND); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), CHIP_ERROR_NOT_FOUND); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), Status::Success); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_INVALID_ARGUMENT), Status::UnsupportedRead); + ASSERT_NE(ActionReturnStatus(Status::Success), Status::UnsupportedRead); + ASSERT_NE(ActionReturnStatus(Status::Success), CHIP_ERROR_INVALID_ARGUMENT); + ASSERT_NE(ActionReturnStatus(CHIP_ERROR_NOT_FOUND), Status::Failure); + ASSERT_NE(ActionReturnStatus(Status::Failure), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(Status::Failure), CHIP_ERROR_INVALID_ARGUMENT); + ASSERT_NE(ActionReturnStatus(Status::Failure), ClusterStatusCode::ClusterSpecificSuccess(1)); + ASSERT_NE(ActionReturnStatus(Status::Failure), ClusterStatusCode::ClusterSpecificFailure(2)); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(1)), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(2)), CHIP_NO_ERROR); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(3)), Status::Failure); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(4)), Status::Failure); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(3)), Status::Success); + ASSERT_NE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(4)), Status::Success); +} + +TEST(TestActionReturnStatus, TestIsError) +{ + ASSERT_TRUE(ActionReturnStatus(CHIP_IM_CLUSTER_STATUS(123)).IsError()); + ASSERT_TRUE(ActionReturnStatus(CHIP_ERROR_INTERNAL).IsError()); + ASSERT_TRUE(ActionReturnStatus(CHIP_ERROR_NO_MEMORY).IsError()); + ASSERT_TRUE(ActionReturnStatus(Status::UnsupportedRead).IsError()); + ASSERT_TRUE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)).IsError()); + + ASSERT_FALSE(ActionReturnStatus(Status::Success).IsError()); + ASSERT_FALSE(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)).IsError()); + ASSERT_FALSE(ActionReturnStatus(CHIP_NO_ERROR).IsError()); +} + +TEST(TestActionReturnStatus, TestUnderlyingError) +{ + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)).GetUnderlyingError(), CHIP_IM_CLUSTER_STATUS(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)).GetUnderlyingError(), CHIP_NO_ERROR); + ASSERT_EQ(ActionReturnStatus(Status::Busy).GetUnderlyingError(), CHIP_IM_GLOBAL_STATUS(Busy)); + ASSERT_EQ(ActionReturnStatus(CHIP_ERROR_INTERNAL).GetUnderlyingError(), CHIP_ERROR_INTERNAL); +} + +TEST(TestActionReturnStatus, TestStatusCode) +{ + ASSERT_EQ(ActionReturnStatus(CHIP_ERROR_INTERNAL).GetStatusCode(), ClusterStatusCode(Status::Failure)); + ASSERT_EQ(ActionReturnStatus(Status::Busy).GetStatusCode(), ClusterStatusCode(Status::Busy)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificSuccess(123)).GetStatusCode(), + ClusterStatusCode::ClusterSpecificSuccess(123)); + ASSERT_EQ(ActionReturnStatus(ClusterStatusCode::ClusterSpecificFailure(123)).GetStatusCode(), + ClusterStatusCode::ClusterSpecificFailure(123)); + ASSERT_EQ(ActionReturnStatus(CHIP_IM_CLUSTER_STATUS(0x12)).GetStatusCode(), ClusterStatusCode::ClusterSpecificFailure(0x12)); + ASSERT_EQ(ActionReturnStatus(CHIP_IM_GLOBAL_STATUS(Timeout)).GetStatusCode(), ClusterStatusCode(Status::Timeout)); +} diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index faf76e031e177e..b5621e94bd9f47 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -23,6 +23,7 @@ * */ +#include "app/data-model-provider/ActionReturnStatus.h" #include #if CHIP_CONFIG_ENABLE_ICD_SERVER #include // nogncheck @@ -182,15 +183,20 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu ConcreteReadAttributePath pathForRetrieval(readPath); // Load the saved state from previous encoding session for chunking of one single attribute (list chunking). AttributeEncodeState encodeState = apReadHandler->GetAttributeEncodeState(); - err = Impl::RetrieveClusterData(mpImEngine->GetDataModelProvider(), apReadHandler->GetSubjectDescriptor(), - apReadHandler->IsFabricFiltered(), attributeReportIBs, pathForRetrieval, &encodeState); - if (err != CHIP_NO_ERROR) + DataModel::ActionReturnStatus status = + Impl::RetrieveClusterData(mpImEngine->GetDataModelProvider(), apReadHandler->GetSubjectDescriptor(), + apReadHandler->IsFabricFiltered(), attributeReportIBs, pathForRetrieval, &encodeState); + if (status.IsError()) { + // Operation error set, since this will affect early return or override on status encoding + // it will also be used for error reporting below. + err = status.GetUnderlyingError(); + // If error is not an "out of writer space" error, rollback and encode status. // Otherwise, if partial data allowed, save the encode state. // Otherwise roll back. If we have already encoded some chunks, we are done; otherwise encode status. - if (encodeState.AllowPartialData() && IsOutOfWriterSpaceError(err)) + if (encodeState.AllowPartialData() && status.IsOutOfSpaceEncodingResponse()) { ChipLogDetail(DataManagement, "List does not fit in packet, chunk between list items for clusterId: " ChipLogFormatMEI @@ -210,7 +216,7 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu attributeReportIBs.Rollback(attributeBackup); apReadHandler->SetAttributeEncodeState(AttributeEncodeState()); - if (!IsOutOfWriterSpaceError(err)) + if (!status.IsOutOfSpaceEncodingResponse()) { ChipLogError(DataManagement, "Fail to retrieve data, roll back and encode status on clusterId: " ChipLogFormatMEI @@ -218,7 +224,7 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu ChipLogValueMEI(pathForRetrieval.mClusterId), ChipLogValueMEI(pathForRetrieval.mAttributeId), err.Format()); // Try to encode our error as a status response. - err = attributeReportIBs.EncodeAttributeStatus(pathForRetrieval, StatusIB(err)); + err = attributeReportIBs.EncodeAttributeStatus(pathForRetrieval, StatusIB(status.GetStatusCode())); if (err != CHIP_NO_ERROR) { // OK, just roll back again and give up; if we still ran out of space we diff --git a/src/app/reporting/Read-Checked.cpp b/src/app/reporting/Read-Checked.cpp index 3b434d5da5f624..cd821bc67ae4f6 100644 --- a/src/app/reporting/Read-Checked.cpp +++ b/src/app/reporting/Read-Checked.cpp @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" +#include "lib/support/StringBuilder.h" #include #include @@ -26,6 +28,8 @@ namespace reporting { namespace CheckedImpl { namespace { +using DataModel::ActionReturnStatus; + /// Checkpoints and saves the state (including error state) for a /// AttributeReportIBs::Builder class ScopedAttributeReportIBsBuilderState @@ -50,16 +54,16 @@ class ScopedAttributeReportIBsBuilderState } // namespace -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) +ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, + bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { ChipLogDetail(DataManagement, " Cluster %" PRIx32 ", Attribute %" PRIx32 " is dirty", path.mClusterId, path.mAttributeId); DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, DataModelCallbacks::OperationOrder::Pre, path); - CHIP_ERROR errEmber = CHIP_NO_ERROR; + ActionReturnStatus statusEmber(CHIP_NO_ERROR); uint32_t lengthWrittenEmber = 0; // a copy for DM logic only. Ember changes state directly @@ -68,21 +72,22 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su { ScopedAttributeReportIBsBuilderState builderState(reportBuilder); // temporary only - errEmber = + statusEmber = EmberImpl::RetrieveClusterData(dataModel, subjectDescriptor, isFabricFiltered, reportBuilder, path, encoderState); lengthWrittenEmber = reportBuilder.GetWriter()->GetLengthWritten(); } - CHIP_ERROR errDM = DataModelImpl::RetrieveClusterData(dataModel, subjectDescriptor, isFabricFiltered, reportBuilder, path, - encoderState != nullptr ? &stateDm : nullptr); + ActionReturnStatus statusDm = DataModelImpl::RetrieveClusterData(dataModel, subjectDescriptor, isFabricFiltered, reportBuilder, + path, encoderState != nullptr ? &stateDm : nullptr); - if (errEmber != errDM) + if (statusEmber != statusDm) { + StringBuilder<128> buffer; // Note log + chipDie instead of VerifyOrDie so that breakpoints (and usage of rr) // is easier to debug. ChipLogError(Test, "Different return codes between ember and DM"); - ChipLogError(Test, " Ember error: %" CHIP_ERROR_FORMAT, errEmber.Format()); - ChipLogError(Test, " DM error: %" CHIP_ERROR_FORMAT, errDM.Format()); + ChipLogError(Test, " Ember status: %s", statusEmber.c_str()); + ChipLogError(Test, " DM status: %s", statusDm.c_str()); // For time-dependent data, we may have size differences here: one data fitting in buffer // while another not, resulting in different errors (success vs out of space). @@ -120,7 +125,7 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su // For chunked reads, the encoder state MUST be identical (since this is what controls // where chunking resumes). - if ((errEmber == CHIP_ERROR_NO_MEMORY) || (errEmber == CHIP_ERROR_BUFFER_TOO_SMALL)) + if (statusEmber.IsOutOfSpaceEncodingResponse()) { // Encoder state MUST match on partial reads (used by chunking) // specifically ReadViaAccessInterface in ember-compatibility-functions only @@ -151,7 +156,7 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, DataModelCallbacks::OperationOrder::Post, path); - return errDM; + return statusDm; } } // namespace CheckedImpl diff --git a/src/app/reporting/Read-Checked.h b/src/app/reporting/Read-Checked.h index 2652d4f98c86d7..742b1e2fef8c3d 100644 --- a/src/app/reporting/Read-Checked.h +++ b/src/app/reporting/Read-Checked.h @@ -16,6 +16,7 @@ */ #pragma once +#include "app/data-model-provider/ActionReturnStatus.h" #include #include #include @@ -27,9 +28,10 @@ namespace app { namespace reporting { namespace CheckedImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); } // namespace CheckedImpl } // namespace reporting diff --git a/src/app/reporting/Read-DataModel.cpp b/src/app/reporting/Read-DataModel.cpp index 9364d5c5fde9ce..7df19e2c89ecfc 100644 --- a/src/app/reporting/Read-DataModel.cpp +++ b/src/app/reporting/Read-DataModel.cpp @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" +#include "lib/support/logging/TextOnlyLogging.h" #include #include @@ -24,18 +26,11 @@ namespace chip { namespace app { namespace reporting { namespace DataModelImpl { -namespace { -bool IsOutOfSpaceError(CHIP_ERROR err) -{ - return (err == CHIP_ERROR_NO_MEMORY || err == CHIP_ERROR_BUFFER_TOO_SMALL); -} - -} // namespace - -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { // Odd ifdef is to only do this if the `Read-Check` does not do it already. #if !CHIP_CONFIG_USE_EMBER_DATA_MODEL @@ -68,9 +63,10 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su reportBuilder.Checkpoint(checkpoint); AttributeValueEncoder attributeValueEncoder(reportBuilder, subjectDescriptor, path, version, isFabricFiltered, encoderState); - CHIP_ERROR err = dataModel->ReadAttribute(readRequest, attributeValueEncoder); - if (err == CHIP_NO_ERROR) + DataModel::ActionReturnStatus status = dataModel->ReadAttribute(readRequest, attributeValueEncoder); + + if (status.IsSuccess()) { // Odd ifdef is to only do this if the `Read-Check` does not do it already. #if !CHIP_CONFIG_USE_EMBER_DATA_MODEL @@ -82,12 +78,12 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, DataModelCallbacks::OperationOrder::Post, path); #endif // !CHIP_CONFIG_USE_EMBER_DATA_MODEL - return CHIP_NO_ERROR; + return status; } // Encoder state is relevant for errors in case they are retryable. // - // Generally only IsOutOfSpaceError(err) would be retryable, however we save the state + // Generally only out of space encoding errors would be retryable, however we save the state // for all errors in case this is information that is useful (retry or error position). if (encoderState != nullptr) { @@ -97,11 +93,11 @@ CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::Su // Out of space errors may be chunked data, reporting those cases would be very confusing // as they are not fully errors. Report only others (which presumably are not recoverable // and will be sent to the client as well). - if (!IsOutOfSpaceError(err)) + if (!status.IsOutOfSpaceEncodingResponse()) { - ChipLogError(DataManagement, "Failed to read attribute: %" CHIP_ERROR_FORMAT, err.Format()); + ChipLogError(DataManagement, "Failed to read attribute: %s", status.c_str()); } - return err; + return status; } } // namespace DataModelImpl diff --git a/src/app/reporting/Read-DataModel.h b/src/app/reporting/Read-DataModel.h index 346ebb2340f6d7..3a629e66e398d0 100644 --- a/src/app/reporting/Read-DataModel.h +++ b/src/app/reporting/Read-DataModel.h @@ -16,9 +16,11 @@ */ #pragma once +#include "app/data-model-provider/ActionReturnStatus.h" #include #include #include +#include #include #include @@ -27,9 +29,10 @@ namespace app { namespace reporting { namespace DataModelImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); } // namespace DataModelImpl } // namespace reporting diff --git a/src/app/reporting/Read-Ember.cpp b/src/app/reporting/Read-Ember.cpp index 3e9ad543a6e2b4..a7bf1023b3d841 100644 --- a/src/app/reporting/Read-Ember.cpp +++ b/src/app/reporting/Read-Ember.cpp @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -25,9 +26,10 @@ namespace app { namespace reporting { namespace EmberImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState) { // Odd ifdef is to only do this if the `Read-Check` does not do it already. #if !CHIP_CONFIG_USE_DATA_MODEL_INTERFACE diff --git a/src/app/reporting/Read-Ember.h b/src/app/reporting/Read-Ember.h index 5ff3fff4103dc5..129746baf1f9c8 100644 --- a/src/app/reporting/Read-Ember.h +++ b/src/app/reporting/Read-Ember.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -27,9 +28,10 @@ namespace app { namespace reporting { namespace EmberImpl { -CHIP_ERROR RetrieveClusterData(DataModel::Provider * dataModel, const Access::SubjectDescriptor & subjectDescriptor, - bool isFabricFiltered, AttributeReportIBs::Builder & reportBuilder, - const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); +DataModel::ActionReturnStatus RetrieveClusterData(DataModel::Provider * dataModel, + const Access::SubjectDescriptor & subjectDescriptor, bool isFabricFiltered, + AttributeReportIBs::Builder & reportBuilder, + const ConcreteReadAttributePath & path, AttributeEncodeState * encoderState); } // namespace EmberImpl } // namespace reporting diff --git a/src/app/tests/test-interaction-model-api.cpp b/src/app/tests/test-interaction-model-api.cpp index f626d061c2b107..f483f4b3de88a4 100644 --- a/src/app/tests/test-interaction-model-api.cpp +++ b/src/app/tests/test-interaction-model-api.cpp @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -153,7 +154,7 @@ TestImCustomDataModel & TestImCustomDataModel::Instance() return model; } -CHIP_ERROR TestImCustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) +ActionReturnStatus TestImCustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) { AttributeEncodeState mutableState(&encoder.GetState()); // provide a state copy to start. @@ -167,13 +168,13 @@ CHIP_ERROR TestImCustomDataModel::ReadAttribute(const ReadAttributeRequest & req return err; } -CHIP_ERROR TestImCustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) +ActionReturnStatus TestImCustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) { return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR TestImCustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) +ActionReturnStatus TestImCustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/app/tests/test-interaction-model-api.h b/src/app/tests/test-interaction-model-api.h index ccaf6514890546..6de6c9c34a2e21 100644 --- a/src/app/tests/test-interaction-model-api.h +++ b/src/app/tests/test-interaction-model-api.h @@ -118,10 +118,12 @@ class TestImCustomDataModel : public DataModel::Provider CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override; + DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) override; + DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; diff --git a/src/controller/tests/data_model/DataModelFixtures.cpp b/src/controller/tests/data_model/DataModelFixtures.cpp index ff22f2063e6e62..05fa16b956bb0c 100644 --- a/src/controller/tests/data_model/DataModelFixtures.cpp +++ b/src/controller/tests/data_model/DataModelFixtures.cpp @@ -17,6 +17,7 @@ */ #include "DataModelFixtures.h" +#include "app/data-model-provider/ActionReturnStatus.h" #include #include @@ -491,7 +492,7 @@ CustomDataModel & CustomDataModel::Instance() return model; } -CHIP_ERROR CustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) +ActionReturnStatus CustomDataModel::ReadAttribute(const ReadAttributeRequest & request, AttributeValueEncoder & encoder) { AttributeEncodeState mutableState(&encoder.GetState()); // provide a state copy to start. @@ -519,12 +520,13 @@ CHIP_ERROR CustomDataModel::ReadAttribute(const ReadAttributeRequest & request, return err; } -CHIP_ERROR CustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) +ActionReturnStatus CustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) { return CHIP_ERROR_NOT_IMPLEMENTED; } -CHIP_ERROR CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, CommandHandler * handler) +ActionReturnStatus CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/controller/tests/data_model/DataModelFixtures.h b/src/controller/tests/data_model/DataModelFixtures.h index a36e905c23ce41..cfb2edf5db83f3 100644 --- a/src/controller/tests/data_model/DataModelFixtures.h +++ b/src/controller/tests/data_model/DataModelFixtures.h @@ -115,10 +115,12 @@ class CustomDataModel : public DataModel::Provider CHIP_ERROR Shutdown() override { return CHIP_NO_ERROR; } - CHIP_ERROR ReadAttribute(const DataModel::ReadAttributeRequest & request, AttributeValueEncoder & encoder) override; - CHIP_ERROR WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - CHIP_ERROR Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + DataModel::ActionReturnStatus ReadAttribute(const DataModel::ReadAttributeRequest & request, + AttributeValueEncoder & encoder) override; + DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, + AttributeValueDecoder & decoder) override; + DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 23d83d868ea3df..84b0de1a47f3ba 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -453,6 +453,16 @@ using CHIP_ERROR = ::chip::ChipError; // #define CHIP_IM_CLUSTER_STATUS(type) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMClusterStatus, type) +// Defines a runtime-value for a chip-error that contains a cluster-specific error status. +// Must not be used with cluster-specific success status codes. +#if CHIP_CONFIG_ERROR_SOURCE +#define CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(status_value) \ + ::chip::ChipError(::chip::ChipError::SdkPart::kIMClusterStatus, status_value, __FILE__, __LINE__) +#else +#define CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(status_value) \ + ::chip::ChipError(::chip::ChipError::SdkPart::kIMClusterStatus, status_value) +#endif // CHIP_CONFIG_ERROR_SOURCE + // clang-format off /** diff --git a/src/protocols/interaction_model/StatusCode.cpp b/src/protocols/interaction_model/StatusCode.cpp index 36e1274f4e6c1e..b91817a0290e4a 100644 --- a/src/protocols/interaction_model/StatusCode.cpp +++ b/src/protocols/interaction_model/StatusCode.cpp @@ -37,6 +37,30 @@ const char * StatusName(Status status) return "Unallocated"; } #endif // CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT +// +ClusterStatusCode::ClusterStatusCode(CHIP_ERROR err) +{ + if (err.IsPart(ChipError::SdkPart::kIMClusterStatus)) + { + mStatus = Status::Failure; + mClusterSpecificCode = chip::MakeOptional(err.GetSdkCode()); + return; + } + + if (err == CHIP_NO_ERROR) + { + mStatus = Status::Success; + return; + } + + if (err.IsPart(ChipError::SdkPart::kIMGlobalStatus)) + { + mStatus = static_cast(err.GetSdkCode()); + return; + } + + mStatus = Status::Failure; +} } // namespace InteractionModel } // namespace Protocols diff --git a/src/protocols/interaction_model/StatusCode.h b/src/protocols/interaction_model/StatusCode.h index 9326c86653759c..b30ef95ea2d1e2 100644 --- a/src/protocols/interaction_model/StatusCode.h +++ b/src/protocols/interaction_model/StatusCode.h @@ -68,6 +68,7 @@ class ClusterStatusCode { public: explicit ClusterStatusCode(Status status) : mStatus(status) {} + explicit ClusterStatusCode(CHIP_ERROR err); // We only have simple copyable members, so we should be trivially copyable. ClusterStatusCode(const ClusterStatusCode & other) = default; From 138b5b877b41f74aa46105ea1da7f437eab8a6e3 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Fri, 2 Aug 2024 14:42:41 -0400 Subject: [PATCH 39/40] Fix ZAP CI with just regen (#34745) --- .../air-purifier-app.matter | 12 ++--- .../air-quality-sensor-app.matter | 12 ++--- .../all-clusters-app.matter | 12 ++--- .../all-clusters-minimal-app.matter | 12 ++--- .../bridge-common/bridge-app.matter | 12 ++--- ...p_rootnode_dimmablelight_bCwGYSDpoe.matter | 12 ++--- .../rootnode_airpurifier_73a6fe2651.matter | 12 ++--- ...umiditysensor_thermostat_56de3d5f45.matter | 12 ++--- ...ootnode_airqualitysensor_e63187f6c9.matter | 12 ++--- ...ootnode_basicvideoplayer_0ff86e943b.matter | 12 ++--- ...de_colortemperaturelight_hbUnzYVeyn.matter | 12 ++--- .../rootnode_contactsensor_27f76aeaf5.matter | 12 ++--- .../rootnode_contactsensor_lFAGG1bfRO.matter | 12 ++--- .../rootnode_dimmablelight_bCwGYSDpoe.matter | 12 ++--- ...tnode_dimmablepluginunit_f8a9a0b9d4.matter | 12 ++--- .../rootnode_dishwasher_cc105034fe.matter | 12 ++--- .../rootnode_doorlock_aNKYAreMXE.matter | 12 ++--- ...tnode_extendedcolorlight_8lcaaYJVAa.matter | 12 ++--- .../devices/rootnode_fan_7N2TobIlOX.matter | 12 ++--- .../rootnode_flowsensor_1zVxHedlaV.matter | 12 ++--- .../rootnode_genericswitch_2dfff6e516.matter | 12 ++--- .../rootnode_genericswitch_9866e35d0b.matter | 12 ++--- ...tnode_heatingcoolingunit_ncdGai1E5a.matter | 12 ++--- .../rootnode_humiditysensor_Xyj4gda6Hb.matter | 12 ++--- .../rootnode_laundrywasher_fb10d238c8.matter | 12 ++--- .../rootnode_lightsensor_lZQycTFcJK.matter | 12 ++--- ...rootnode_occupancysensor_iHyVgifZuo.matter | 12 ++--- .../rootnode_onofflight_bbs1b7IaOV.matter | 12 ++--- .../rootnode_onofflight_samplemei.matter | 12 ++--- ...ootnode_onofflightswitch_FsPlMr090Q.matter | 12 ++--- ...rootnode_onoffpluginunit_Wtf8ss5EBY.matter | 12 ++--- .../rootnode_pressuresensor_s0qC9wLH4k.matter | 12 ++--- .../devices/rootnode_pump_5f904818cc.matter | 12 ++--- .../devices/rootnode_pump_a811bb33a0.matter | 12 ++--- ...eraturecontrolledcabinet_ffdb696680.matter | 12 ++--- ...ode_roboticvacuumcleaner_1807ff0c49.matter | 12 ++--- ...tnode_roomairconditioner_9cf3607804.matter | 12 ++--- .../rootnode_smokecoalarm_686fe0dcb8.matter | 12 ++--- .../rootnode_speaker_RpzeXdimqA.matter | 12 ++--- ...otnode_temperaturesensor_Qy1zkNW7c3.matter | 12 ++--- .../rootnode_thermostat_bm3fb8dhYi.matter | 12 ++--- .../rootnode_windowcovering_RLCxaGi9Yx.matter | 12 ++--- .../contact-sensor-app.matter | 12 ++--- .../nxp/zap-lit/contact-sensor-app.matter | 12 ++--- .../nxp/zap-sit/contact-sensor-app.matter | 12 ++--- .../dishwasher-common/dishwasher-app.matter | 12 ++--- .../energy-management-app.matter | 12 ++--- .../fabric-bridge-app.matter | 12 ++--- .../nxp/zap/laundry-washer-app.matter | 12 ++--- .../light-switch-app.matter | 12 ++--- .../light-switch-app/qpg/zap/switch.matter | 12 ++--- .../data_model/lighting-app-ethernet.matter | 12 ++--- .../data_model/lighting-app-thread.matter | 12 ++--- .../data_model/lighting-app-wifi.matter | 12 ++--- .../lighting-common/lighting-app.matter | 12 ++--- .../nxp/zap/lighting-on-off.matter | 12 ++--- examples/lighting-app/qpg/zap/light.matter | 12 ++--- .../data_model/lighting-thread-app.matter | 12 ++--- .../data_model/lighting-wifi-app.matter | 12 ++--- .../lit-icd-common/lit-icd-server-app.matter | 12 ++--- examples/lock-app/lock-common/lock-app.matter | 12 ++--- examples/lock-app/nxp/zap/lock-app.matter | 12 ++--- examples/lock-app/qpg/zap/lock.matter | 12 ++--- .../log-source-common/log-source-app.matter | 12 ++--- .../microwave-oven-app.matter | 12 ++--- .../network-manager-app.matter | 12 ++--- .../ota-provider-app.matter | 12 ++--- .../ota-requestor-app.matter | 12 ++--- .../placeholder/linux/apps/app1/config.matter | 12 ++--- .../placeholder/linux/apps/app2/config.matter | 12 ++--- examples/pump-app/pump-common/pump-app.matter | 12 ++--- .../silabs/data_model/pump-thread-app.matter | 12 ++--- .../silabs/data_model/pump-wifi-app.matter | 12 ++--- .../pump-controller-app.matter | 12 ++--- .../refrigerator-app.matter | 12 ++--- examples/rvc-app/rvc-common/rvc-app.matter | 12 ++--- .../smoke-co-alarm-app.matter | 12 ++--- .../temperature-measurement.matter | 12 ++--- .../nxp/zap/thermostat_matter_thread.matter | 12 ++--- .../nxp/zap/thermostat_matter_wifi.matter | 12 ++--- .../qpg/zap/thermostaticRadiatorValve.matter | 12 ++--- .../thermostat-common/thermostat.matter | 12 ++--- examples/tv-app/tv-common/tv-app.matter | 12 ++--- .../tv-casting-common/tv-casting-app.matter | 12 ++--- .../virtual-device-app.matter | 12 ++--- examples/window-app/common/window-app.matter | 12 ++--- .../data_model/controller-clusters.matter | 12 ++--- .../python/chip/clusters/Objects.py | 28 ++++++------ .../CHIP/zap-generated/MTRStructsObjc.h | 14 +++--- .../CHIP/zap-generated/MTRStructsObjc.mm | 36 +++++++-------- .../zap-generated/cluster-objects.cpp | 44 +++++++++---------- .../zap-generated/cluster-objects.h | 32 +++++++------- 92 files changed, 599 insertions(+), 599 deletions(-) diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 6afbc96ec4e430..51a9dc6a155f1b 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index 80a93e41155b95..443a5d95056da8 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 2b4fb13c868d48..867da750b2a628 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 1f56b0d6f7f746..86f4335fe6c883 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 62fa99efa49f6f..ef70beb4fa8001 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index c2fdc613ff9eee..865ab9946a28d8 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index 6b6d2a9133839e..c9620818b035e2 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 4e21ce7185ece0..7c84e33077f67a 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index fb5fd600d280a5..d5cd9f968e9cae 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index e93e6a668dbd62..b0e6cb0dcb99f5 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index 8da8f1d4472762..c09d170fcfb211 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index 4a2f72084620e4..752331d2934dde 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 23672407e7c886..bd37aa7ee5435e 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index a32b134d6383c0..0c139383678084 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 64dd2192d29af0..7c1c3356948605 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 95af5647dd9d27..be4001d1e49b03 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 219f899194ff5b..a8233afe90b6c4 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index d846e358a907f9..27473072e657c0 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 493b69632f19ec..1cb3ba2c5a63a8 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 3df145b311d69a..8b4d4046f3b36f 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 7f7fecc0fad4fc..07a8e8ee7de63b 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index 25c5cb83071c67..204c7b2d7abf43 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 5bff3298a54008..208ddcea79b1bf 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 3a533a80b03adc..1aca96ae1e7824 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 85e0b196fdda71..5be2b0c409d982 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 02be0be6f65ad5..aab7ae74ee127b 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 40a115b86c3be8..6dc939d3aa2592 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 6906c4f30ebbae..e58601388e94bd 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index e374d50abab6e9..65a0c490f23a0d 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 4ece174e50db4c..88462157a1c691 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index a5e61ac7fe7406..7f7d67cedfdf1c 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 327132ea97cf51..92f14706269c2d 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index 6c7e8d6ad9f128..bd34fc60d32c57 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index 9fb13cb006fd90..bc1c5228dade49 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 5743a39e49847a..f68d7bf2aaefb0 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index dd9fe887bef6a4..6f88dc303da772 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index c3ef68e5e97da5..d6e843c5937189 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 671339d987c1a0..9354126302295d 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index 148afd99364923..bdad38f829a821 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index bcb7f16079e3e2..cb7eaa21e153a2 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 43f4bc7dace6bd..c65191a9e0b508 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 4dfbfbc41b8d9f..737c351984bb64 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index c25e9c9f5b8757..f721aa58e0fe15 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index efad0754f083a8..fb2cf8f8289734 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index 9afa33bd3ea3d8..21f793caedee04 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index cb9872e9e66045..e5027342d1edb2 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; 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 e9b0971aff8299..2b081f13a3827e 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 @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index db107fcf5bac43..33e1d992b677b1 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index fd62482a477bcc..b204bae6345a2d 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 3dbb78723e7e09..1f2c3728b3098d 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index 3b4bce66e4e99d..a8a28edb2fbcf0 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 95ec4192b1d0eb..f60a0c186bda97 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index aaf03062417f4e..eddf3d467b282c 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index c2e58783befefb..b65db2f043639c 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 9f1ed514fcd5ca..13c3138eb22676 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 4fb8cc0cb2effc..d4e0e18bc3e985 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index 9897f1b594cf81..652c45f6d83c71 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 2fcf8a6f8c714d..b7d967d3c5ef0e 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 0b6601b5fdb135..b1cd1c94be474a 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index a2f535b3a30a8f..f4c9fa01731c7c 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 8a259619dce5a6..50c416a2a937cf 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 97d6e3ae443c38..a8d2d9fd5eb230 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 4bc5c6657d6574..d3f76e4f719b5e 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 7633792300c4dd..38e6f51ee4d1de 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index 10eec889dee3bd..36df5a7a835c5f 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index 152f81961ba5f6..d3a951ddc9f624 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index e030d276cf954c..8b290cc5796e1a 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 4d46808ccc9756..eb1703c55b85b1 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 0592ef4e90ff49..44c2750954c902 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 807c80a0099157..2d1d39836a51c7 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index d6a3bd98a27dcb..172582ef4d1234 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index d933e5fed1bca3..dae1ee04e0f3ac 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index d933e5fed1bca3..dae1ee04e0f3ac 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index b65fb7a3151a26..8f5ae594b044f4 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 3b6ed201671901..3208239c974fa1 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index e619edae8f0b29..56eebaae7cded7 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index cc9ddb1cce00cb..cb192d1fa9ff1c 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 409b11d68bcd9c..c755a48de0f189 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 1a3c1a76fa99ee..7b115dff3c7889 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 1c787b7cc99803..2c4aaa2b37cd0a 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index ad0b9a109cad4f..9b7760d25744d2 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index abf0b4419ec713..1b8698f61b894b 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 71f8dd019590ad..02ef8118fa74df 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for switching devices between 'On' and 'Off' states. */ cluster OnOff = 6 { revision 6; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index bae4ecfd37ea49..0f42ef74d2fb94 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index fc651825cce654..7cc780ba68436e 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index 7037e2ed4540e8..446a3fb3f64e80 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 827e4e7ae084b5..54752ea0be20ea 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -208,18 +208,18 @@ bitmap TestGlobalBitmap : bitmap32 { kSecondBit = 0x2; } -struct LocationDescriptorStruct { - char_string<128> locationName = 0; - nullable int16s floorNumber = 1; - nullable AreaTypeTag areaType = 2; -} - struct TestGlobalStruct { char_string<128> name = 0; nullable TestGlobalBitmap myBitmap = 1; optional nullable TestGlobalEnum myEnum = 2; } +struct LocationDescriptorStruct { + char_string<128> locationName = 0; + nullable int16s floorNumber = 1; + nullable AreaTypeTag areaType = 2; +} + /** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ cluster Identify = 3 { revision 4; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 57211812f30b96..1a110f1bc09b74 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -267,34 +267,34 @@ class TestGlobalBitmap(IntFlag): class Structs: @dataclass - class LocationDescriptorStruct(ClusterObject): + class TestGlobalStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), - ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, Globals.Enums.AreaTypeTag]), + ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="myBitmap", Tag=1, Type=typing.Union[Nullable, uint]), + ClusterObjectFieldDescriptor(Label="myEnum", Tag=2, Type=typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]), ]) - locationName: 'str' = "" - floorNumber: 'typing.Union[Nullable, int]' = NullValue - areaType: 'typing.Union[Nullable, Globals.Enums.AreaTypeTag]' = NullValue + name: 'str' = "" + myBitmap: 'typing.Union[Nullable, uint]' = NullValue + myEnum: 'typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]' = None @dataclass - class TestGlobalStruct(ClusterObject): + class LocationDescriptorStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="name", Tag=0, Type=str), - ClusterObjectFieldDescriptor(Label="myBitmap", Tag=1, Type=typing.Union[Nullable, uint]), - ClusterObjectFieldDescriptor(Label="myEnum", Tag=2, Type=typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]), + ClusterObjectFieldDescriptor(Label="locationName", Tag=0, Type=str), + ClusterObjectFieldDescriptor(Label="floorNumber", Tag=1, Type=typing.Union[Nullable, int]), + ClusterObjectFieldDescriptor(Label="areaType", Tag=2, Type=typing.Union[Nullable, Globals.Enums.AreaTypeTag]), ]) - name: 'str' = "" - myBitmap: 'typing.Union[Nullable, uint]' = NullValue - myEnum: 'typing.Union[None, Nullable, Globals.Enums.TestGlobalEnum]' = None + locationName: 'str' = "" + floorNumber: 'typing.Union[Nullable, int]' = NullValue + areaType: 'typing.Union[Nullable, Globals.Enums.AreaTypeTag]' = NullValue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 3d9aa95d0c2cd8..6535195be109c9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -19,13 +19,6 @@ NS_ASSUME_NONNULL_BEGIN -MTR_PROVISIONALLY_AVAILABLE -@interface MTRDataTypeLocationDescriptorStruct : NSObject -@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; -@end - MTR_PROVISIONALLY_AVAILABLE @interface MTRDataTypeTestGlobalStruct : NSObject @property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; @@ -33,6 +26,13 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable myEnum MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRDataTypeLocationDescriptorStruct : NSObject +@property (nonatomic, copy) NSString * _Nonnull locationName MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable floorNumber MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable areaType MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)) @interface MTRDescriptorClusterDeviceTypeStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull deviceType MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 2cd6c479c1d9f5..6cafc8a4b50270 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -19,67 +19,67 @@ NS_ASSUME_NONNULL_BEGIN -@implementation MTRDataTypeLocationDescriptorStruct +@implementation MTRDataTypeTestGlobalStruct - (instancetype)init { if (self = [super init]) { - _locationName = @""; + _name = @""; - _floorNumber = nil; + _myBitmap = nil; - _areaType = nil; + _myEnum = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRDataTypeLocationDescriptorStruct alloc] init]; + auto other = [[MTRDataTypeTestGlobalStruct alloc] init]; - other.locationName = self.locationName; - other.floorNumber = self.floorNumber; - other.areaType = self.areaType; + other.name = self.name; + other.myBitmap = self.myBitmap; + other.myEnum = self.myEnum; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum]; return descriptionString; } @end -@implementation MTRDataTypeTestGlobalStruct +@implementation MTRDataTypeLocationDescriptorStruct - (instancetype)init { if (self = [super init]) { - _name = @""; + _locationName = @""; - _myBitmap = nil; + _floorNumber = nil; - _myEnum = nil; + _areaType = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRDataTypeTestGlobalStruct alloc] init]; + auto other = [[MTRDataTypeLocationDescriptorStruct alloc] init]; - other.name = self.name; - other.myBitmap = self.myBitmap; - other.myEnum = self.myEnum; + other.locationName = self.locationName; + other.floorNumber = self.floorNumber; + other.areaType = self.areaType; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: name:%@; myBitmap:%@; myEnum:%@; >", NSStringFromClass([self class]), _name, _myBitmap, _myEnum]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: locationName:%@; floorNumber:%@; areaType:%@; >", NSStringFromClass([self class]), _locationName, _floorNumber, _areaType]; return descriptionString; } 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 d6a95147f59785..b725407b284118 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 @@ -510,13 +510,13 @@ namespace Globals { // Global structs namespace Structs { -namespace LocationDescriptorStruct { +namespace TestGlobalStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kLocationName), locationName); - encoder.Encode(to_underlying(Fields::kFloorNumber), floorNumber); - encoder.Encode(to_underlying(Fields::kAreaType), areaType); + encoder.Encode(to_underlying(Fields::kName), name); + encoder.Encode(to_underlying(Fields::kMyBitmap), myBitmap); + encoder.Encode(to_underlying(Fields::kMyEnum), myEnum); return encoder.Finalize(); } @@ -534,17 +534,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kLocationName)) + if (__context_tag == to_underlying(Fields::kName)) { - err = DataModel::Decode(reader, locationName); + err = DataModel::Decode(reader, name); } - else if (__context_tag == to_underlying(Fields::kFloorNumber)) + else if (__context_tag == to_underlying(Fields::kMyBitmap)) { - err = DataModel::Decode(reader, floorNumber); + err = DataModel::Decode(reader, myBitmap); } - else if (__context_tag == to_underlying(Fields::kAreaType)) + else if (__context_tag == to_underlying(Fields::kMyEnum)) { - err = DataModel::Decode(reader, areaType); + err = DataModel::Decode(reader, myEnum); } else { @@ -554,15 +554,15 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace LocationDescriptorStruct +} // namespace TestGlobalStruct -namespace TestGlobalStruct { +namespace LocationDescriptorStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kName), name); - encoder.Encode(to_underlying(Fields::kMyBitmap), myBitmap); - encoder.Encode(to_underlying(Fields::kMyEnum), myEnum); + encoder.Encode(to_underlying(Fields::kLocationName), locationName); + encoder.Encode(to_underlying(Fields::kFloorNumber), floorNumber); + encoder.Encode(to_underlying(Fields::kAreaType), areaType); return encoder.Finalize(); } @@ -580,17 +580,17 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kName)) + if (__context_tag == to_underlying(Fields::kLocationName)) { - err = DataModel::Decode(reader, name); + err = DataModel::Decode(reader, locationName); } - else if (__context_tag == to_underlying(Fields::kMyBitmap)) + else if (__context_tag == to_underlying(Fields::kFloorNumber)) { - err = DataModel::Decode(reader, myBitmap); + err = DataModel::Decode(reader, floorNumber); } - else if (__context_tag == to_underlying(Fields::kMyEnum)) + else if (__context_tag == to_underlying(Fields::kAreaType)) { - err = DataModel::Decode(reader, myEnum); + err = DataModel::Decode(reader, areaType); } else { @@ -600,7 +600,7 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } -} // namespace TestGlobalStruct +} // namespace LocationDescriptorStruct } // namespace Structs } // namespace Globals 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 c5bca7bea6fc21..7ecd2334890ad8 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 @@ -298,20 +298,20 @@ namespace Globals { // Global structs. namespace Structs { -namespace LocationDescriptorStruct { +namespace TestGlobalStruct { enum class Fields : uint8_t { - kLocationName = 0, - kFloorNumber = 1, - kAreaType = 2, + kName = 0, + kMyBitmap = 1, + kMyEnum = 2, }; struct Type { public: - chip::CharSpan locationName; - DataModel::Nullable floorNumber; - DataModel::Nullable areaType; + chip::CharSpan name; + DataModel::Nullable> myBitmap; + Optional> myEnum; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -322,22 +322,22 @@ struct Type using DecodableType = Type; -} // namespace LocationDescriptorStruct +} // namespace TestGlobalStruct -namespace TestGlobalStruct { +namespace LocationDescriptorStruct { enum class Fields : uint8_t { - kName = 0, - kMyBitmap = 1, - kMyEnum = 2, + kLocationName = 0, + kFloorNumber = 1, + kAreaType = 2, }; struct Type { public: - chip::CharSpan name; - DataModel::Nullable> myBitmap; - Optional> myEnum; + chip::CharSpan locationName; + DataModel::Nullable floorNumber; + DataModel::Nullable areaType; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -348,7 +348,7 @@ struct Type using DecodableType = Type; -} // namespace TestGlobalStruct +} // namespace LocationDescriptorStruct } // namespace Structs From 26c816a5a61807cbc1d70ce93b4e8b9b49fd4aaf Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 2 Aug 2024 15:32:04 -0400 Subject: [PATCH 40/40] Remove StatusIB::InitFromChipError. (#34712) The constructor is a better fit for being able to convert CHIP_ERROR to ClusterStatusCode and then to StatusIB. --- .../chip-tool/commands/common/RemoteDataModelLogger.cpp | 3 +-- .../commands/common/RemoteDataModelLogger.cpp | 3 +-- src/app/CommandSender.h | 4 ++-- src/app/CommandSenderLegacyCallback.h | 4 ++-- src/app/MessageDef/StatusIB.cpp | 5 ++--- src/app/MessageDef/StatusIB.h | 9 +-------- src/app/ReadClient.h | 4 ++-- src/app/TimedRequest.h | 4 ++-- src/app/WriteClient.h | 4 ++-- src/app/tests/TestStatusIB.cpp | 9 +++------ src/controller/TypedReadCallback.h | 4 ++-- 11 files changed, 20 insertions(+), 33 deletions(-) diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp index 294673512882b3..3c6342752a0a61 100644 --- a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp @@ -160,8 +160,7 @@ CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error) VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); Json::Value value; - chip::app::StatusIB status; - status.InitFromChipError(error); + chip::app::StatusIB status(error); return LogError(value, status); } diff --git a/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp b/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp index 6334d42506d53f..0e51a1503ea3e1 100644 --- a/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp +++ b/examples/fabric-admin/commands/common/RemoteDataModelLogger.cpp @@ -160,8 +160,7 @@ CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error) VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); Json::Value value; - chip::app::StatusIB status; - status.InitFromChipError(error); + chip::app::StatusIB status(error); return LogError(value, status); } diff --git a/src/app/CommandSender.h b/src/app/CommandSender.h index 489c6aa9cd2965..ba98c7178a5c83 100644 --- a/src/app/CommandSender.h +++ b/src/app/CommandSender.h @@ -100,8 +100,8 @@ class CommandSender final : public Messaging::ExchangeDelegate * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing + * a StatusIB from the error can be used to extract the status. * - CHIP_ERROR*: All other cases. */ CHIP_ERROR error; diff --git a/src/app/CommandSenderLegacyCallback.h b/src/app/CommandSenderLegacyCallback.h index f6c63c1fd96292..2645dcbdee58df 100644 --- a/src/app/CommandSenderLegacyCallback.h +++ b/src/app/CommandSenderLegacyCallback.h @@ -65,8 +65,8 @@ class CommandSenderLegacyCallback * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific or path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing a + * StatusIB from the error can be used to extract the status. * - Note: a CommandSender using `CommandSender::Callback` only supports sending * a single InvokeRequest. As a result, only one path-specific error is expected * to ever be sent to the OnError callback. diff --git a/src/app/MessageDef/StatusIB.cpp b/src/app/MessageDef/StatusIB.cpp index 55fec8b92661de..d612f549aeeae1 100644 --- a/src/app/MessageDef/StatusIB.cpp +++ b/src/app/MessageDef/StatusIB.cpp @@ -149,7 +149,7 @@ CHIP_ERROR StatusIB::ToChipError() const return ChipError(ChipError::SdkPart::kIMGlobalStatus, to_underlying(mStatus)); } -void StatusIB::InitFromChipError(CHIP_ERROR aError) +StatusIB::StatusIB(CHIP_ERROR aError) { if (aError.IsPart(ChipError::SdkPart::kIMClusterStatus)) { @@ -204,8 +204,7 @@ bool FormatStatusIBError(char * buf, uint16_t bufSize, CHIP_ERROR err) constexpr size_t formattedSize = max(sizeof(generalFormat) + statusNameMaxLength, sizeof(clusterFormat)); char formattedString[formattedSize]; - StatusIB status; - status.InitFromChipError(err); + StatusIB status(err); if (status.mClusterStatus.HasValue()) { snprintf(formattedString, formattedSize, clusterFormat, status.mClusterStatus.Value()); diff --git a/src/app/MessageDef/StatusIB.h b/src/app/MessageDef/StatusIB.h index 08137045ffcd7b..291a68c7fd295d 100644 --- a/src/app/MessageDef/StatusIB.h +++ b/src/app/MessageDef/StatusIB.h @@ -60,7 +60,7 @@ struct StatusIB } } - explicit StatusIB(CHIP_ERROR error) { InitFromChipError(error); } + explicit StatusIB(CHIP_ERROR error); enum class Tag : uint8_t { @@ -105,13 +105,6 @@ struct StatusIB */ CHIP_ERROR ToChipError() const; - /** - * Extract a CHIP_ERROR into this StatusIB. If IsIMStatus() is false for - * the error, this might do a best-effort attempt to come up with a - * corresponding StatusIB, defaulting to a generic Status::Failure. - */ - void InitFromChipError(CHIP_ERROR aError); - /** * Test whether this status is a success. */ diff --git a/src/app/ReadClient.h b/src/app/ReadClient.h index 9bfb628b47e252..57852499c6ccbf 100644 --- a/src/app/ReadClient.h +++ b/src/app/ReadClient.h @@ -195,8 +195,8 @@ class ReadClient : public Messaging::ExchangeDelegate * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing + * a StatusIB from the error can be used to extract the status. * - CHIP_ERROR*: All other cases. * * This object MUST continue to exist after this call is completed. The application shall wait until it diff --git a/src/app/TimedRequest.h b/src/app/TimedRequest.h index edfe1d78cf8b6a..729c1266b4d401 100644 --- a/src/app/TimedRequest.h +++ b/src/app/TimedRequest.h @@ -38,8 +38,8 @@ class TimedRequest // but came in after we sent a timed request). // // If the response is a failure StatusResponse, its status will be - // encapsulated in the CHIP_ERROR this returns. In that case, - // StatusIB::InitFromChipError can be used to extract the status. + // encapsulated in the CHIP_ERROR this returns. In that case, constructing + // a StatusIB from the error can be used to extract the status. static CHIP_ERROR HandleResponse(const PayloadHeader & aPayloadHeader, System::PacketBufferHandle && aPayload); }; diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index b4d803981be3d8..b056d238bf7e6e 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -88,8 +88,8 @@ class WriteClient : public Messaging::ExchangeDelegate * - CHIP_ERROR_TIMEOUT: A response was not received within the expected response timeout. * - CHIP_ERROR_*TLV*: A malformed, non-compliant response was received from the server. * - CHIP_ERROR encapsulating a StatusIB: If we got a non-path-specific - * status response from the server. In that case, - * StatusIB::InitFromChipError can be used to extract the status. + * status response from the server. In that case, constructing + * a StatusIB from the error can be used to extract the status. * - CHIP_ERROR*: All other cases. * * The WriteClient object MUST continue to exist after this call is completed. The application shall wait until it diff --git a/src/app/tests/TestStatusIB.cpp b/src/app/tests/TestStatusIB.cpp index 22806168a9e6da..9234a4f2350210 100644 --- a/src/app/tests/TestStatusIB.cpp +++ b/src/app/tests/TestStatusIB.cpp @@ -46,8 +46,7 @@ class TestStatusIB : public ::testing::Test #define VERIFY_ROUNDTRIP(err, status) \ do \ { \ - StatusIB newStatus; \ - newStatus.InitFromChipError(err); \ + StatusIB newStatus(err); \ EXPECT_EQ(newStatus.mStatus, status.mStatus); \ EXPECT_EQ(newStatus.mClusterStatus, status.mClusterStatus); \ } while (0); @@ -86,16 +85,14 @@ TEST_F(TestStatusIB, TestStatusIBToFromChipError) err = status.ToChipError(); EXPECT_NE(err, CHIP_NO_ERROR); { - StatusIB newStatus; - newStatus.InitFromChipError(err); + StatusIB newStatus(err); EXPECT_EQ(newStatus.mStatus, Status::Failure); EXPECT_EQ(newStatus.mClusterStatus, status.mClusterStatus); } err = CHIP_ERROR_NO_MEMORY; { - StatusIB newStatus; - newStatus.InitFromChipError(err); + StatusIB newStatus(err); EXPECT_EQ(newStatus.mStatus, Status::Failure); EXPECT_FALSE(newStatus.mClusterStatus.HasValue()); } diff --git a/src/controller/TypedReadCallback.h b/src/controller/TypedReadCallback.h index 000b5d51d522ce..f65b4f2168bff7 100644 --- a/src/controller/TypedReadCallback.h +++ b/src/controller/TypedReadCallback.h @@ -43,8 +43,8 @@ namespace Controller { * encapsulate a StatusIB). This could be a path-specific error or it * could be a general error for the entire request; the distinction is not * that important, because we only have one path involved. If the - * CHIP_ERROR encapsulates a StatusIB, StatusIB::InitFromChipError can be - * used to extract the status. + * CHIP_ERROR encapsulates a StatusIB, constructing a StatusIB from it will + * extract the status. */ template class TypedReadAttributeCallback final : public app::ReadClient::Callback